Hi all,
Hope everyone has their Xmas wishlist prepared for Santa :P
Quick question... trying to use Timer3 on an 18F26J53 together with HPWM command to make an LED go dim/bright/dim/bright etc...
Code snippet:
Is there anything obviously wrong? I'm setting the remappable pin B1 for ECCP2, channel 2, etc, just can't get the LED to light using PWM.Code:EECON2 = $55 EECON2 = $AA PPSCON.0 = 0 RPOR4 = 19 EECON2 = $55 EECON2 = $AA PPSCON.0 = 1 CCP2CON = %00001100 PSTR2CON = %00000010 CCPTMRS0 = %00001000 t3con = %01001101 loop1: SEROUT2 Serial_out,84,[$a,$d,dec RPOR4," ",bin8 CCPTMRS0] hpwm 2,127,1000 pause 500 hpwm 2,255,1000 pause 500 goto loop1
Many thanks in advance
Jimbo




Bookmarks