If you look in the manual under HPWM. You can see that pbp HPWM is only 8bits.
In your code you have the duty set at 254, which is nearly 100%. I think you would want to set
the duty to 50% or 127.
untested
Code:TRISC.2 = 0 MAIN: HPWM 1,127, 38000 ' duty cycle 50% pauseus 1000 HPWM 1, 0, 38000 ' duty cycle 0 pauseus 1000 GOTO MAIN
Bookmarks