In your defines you have to state what pin PWM 1 is (as well as 2, 3, 99, etc.; page 148 of the Manual). It looks like this:
DEFINE CCP1_REG PORTC
DEFINE CCP1_BIT 2
DEFINE CCP2_REG PORTC
DEFINE CCP2_BIT 1
Hope this helps.
In your defines you have to state what pin PWM 1 is (as well as 2, 3, 99, etc.; page 148 of the Manual). It looks like this:
DEFINE CCP1_REG PORTC
DEFINE CCP1_BIT 2
DEFINE CCP2_REG PORTC
DEFINE CCP2_BIT 1
Hope this helps.
I meant a slightly different thing.
Say I have 16F870. No specific DEFINE's added.
Since this chip has 1 hpwm channel only, hpwm 1,100,1000 works. But if I type hpwm 4,100,1000, compiler will give error, since there's no such hardware port. In case of 18F45K20, compiler absolutely does not cares, what port address you enter in hpwm statement. This is the problem.
Does 16F870 have PWM enabled by default?
What about 18F45K20?
I make it a habit not to assume and set feature registers as required.
Robert
According to manual, HPWM statement does all required configs by itself.
Here not problem in HPWM not working, here problem is compiler passing any garbage to hpwm statement without error.
Bookmarks