HI.
I'm using pbp2.46 with MCS.
I'trying to LED dim controll.
like bellow program,
No complie error and ICD error.
but, LED dose not work.
What's wrong at this program.
DEFINE LOADER_USED 1 ' uses a bootloader
define OSC 20 ' *** SET THE CORRECT SPEED ***
DEFINE CCP1_REG PORTB
DEFINE CCP1_BIT 0
DEFINE CCP2_REG PORTB
DEFINE CCP2_BIT 1
DEFINE CCP3_REG PORTB
DEFINE CCP3_BIT 2
ADCON1 = 7
N1 var byte : N2 VAR BYTE :N3 VAR BYTE
trisa.1 = 1
trisa.2 = 1
trisa.3 = 0
trisa.0 =0
trisb =0
main1:
ptn1:
porta.3 = 0
for N1 = 1 to 254 'ptn1
HPWM 1,n1,1000
HPWM 2,n1,5000
HPWM 3,n1,5000
if porta.2 = 1 then
porta.3= 1
pause 500
goto ptn2
else
endif
next N1
Bookmarks