PDA

View Full Version : Two different frequencies with HPWM question



Tobias
- 15th July 2014, 22:06
Using an 18F6722

It has three ECCP's

In the help file it states "Some devices have 1, 2 or 3 PWM channels. On devices with 2 channels, the Frequency must be the same on both channels. "

Does this mean with the current chip I can do two different frequencies? If so, I haven't been able to figure it out yet. Any ideas?

DEFINE HPWM2_TIMER 1 'Hpwm 2 timer select
DEFINE HPWM3_TIMER 2 'Hpwm 3 timer select

HPWM 2,127,20000
HPWM 3,127,30000


I can get individual HPWM's to work. When I fire both up though I get random flat lining. I have tried HPWM1 and HPWM2, then HPWM1 and HPWM3 plus HPWM2 and HPWM3 combinations.

Demon
- 16th July 2014, 11:21
Section 1.2 says you can have up to 4 different time bases.

I can only think that you are forgetting to set a register.

Robert

Tobias
- 18th July 2014, 02:58
Thank you that helped. I found the right register and I think I have it sorted out.

T3CON.6=0
T3CON.3=1

Took care of it.