PDA

View Full Version : Is it possible to use HPWM and DT's MIBAM at the same time?



CuriousOne
- 7th February 2025, 07:27
Hello.

PIC16F1936.

Say I run DT's MIBAM on PORTB pins, but I also want to use existing HPWM module to generate something on PORTC pins.

Will it work?

https://www.picbasic.co.uk/forum/content.php/539-MIBAM-(Mirror-Imaged-Bit-Angle-Modulation)

As said there,

The module uses Timer1, and it cannot be used for any other purposes.
Consequently, the PIC being used must have a Timer1.

As I understand, while Timer1 and CCP1 share same pins, these are different hardware modules and can operate separately and independently?

richard
- 7th February 2025, 08:31
for hpwm timers 2,4 or 6 can be used so there is no conflict for pwm

CuriousOne
- 7th February 2025, 17:37
Yes, thanks, I've checked some datasheets.

For 16F1939 default timer for HPWM1 is Timer1, but it can be changed via registers.
For 16F722 default timer for HPWM1 is Timer2, so no change is needed.

However, it should be noted that these PICs have only Timer1 16 bit, others are 8 bit, so certain bytes of resolution will be lost...

richard
- 7th February 2025, 22:47
For 16F1939 default timer for HPWM1 is Timer1,

Incorrect , timer1 is not an option for hpwm1 ever
timer2 is the default for ccp1 on 16F1939

see CCPTMRS0: PWM TIMER SELECTION CONTROL REGISTER
9905

CuriousOne
- 8th February 2025, 05:23
I'm assembling test circuit with PIC16F722 today and will give it a try :)