lord loh.
Member
I am new to microcontrollers and have read the stickey FAQ.
I tried to write a programme for 18F452. The programme is supposed to generate a pulse train of 30% dutycycle.
I tried to simulate it in MP Lab IDE.
When I tried to observer the RA0 pin in the logic analyser applet, all I got was a straight line.
Please help
I tried to write a programme for 18F452. The programme is supposed to generate a pulse train of 30% dutycycle.
I tried to simulate it in MP Lab IDE.
Code:
org 0000
movlw 0x03 ;Set PORT A to Digital
movwf 0x0fc1
bcf 0x0f92,0 ;Set bit0 of PORT A as output
loop:
movlw 0x03 ;Output a 30% Duty cycle pulse train.
bsf 0x0f80,0
call delay
bcf 0x0f80,0
movlw 0x07
call delay
goto loop
delay:
dcfsnz 0x00fe8 ;decrement W
return
bra delay
END
When I tried to observer the RA0 pin in the logic analyser applet, all I got was a straight line.
Please help