Hi, this is driving me insane. I am unable to figure out why my code (below) to blink a LED on PortA does not work. The test circuit is fine. Everything compiles and burns onto the 628A PIC chip. But it does not do jack.
Could someone please help me out here.
Thank you, zalzon
------ ;portsend.asm to show to flash a led on porta, ra0.
;************************************* setup
list p = 16F628A ;processor type org 0020h
STATUS equ h'3' CMCON equ h'1F' TRISA equ h'85' RP1 equ h'6' RP0 equ h'5' PORTA equ h'05' reg1 equ h'20'
;************************************* program
goto Start
Start MOVLW 0x07 ;disable the comparators MOVWF CMCON
bsf STATUS, RP0 ;switch to bank 1 bcf STATUS, RP1
movlw b'00000000' ;all IO pins = outputs movwf TRISA
bcf STATUS, RP0 ;switch back to bank 0 bcf STATUS, RP1
movlw b'00000000' ; all port pins = low movwf PORTA goto Test
Test movlw d'255' ;counter to delay for a few milliseconds movwf reg1 BSF PORTA,0 ;set porta, bit 0 on goto Decrement1 ;begin delay Back1 BCF PORTA,0 ;set porta, bit 0 off movlw d'255' movwf reg1 goto Decrement2 Back2 goto Test
Decrement1 nop nop nop decfsz reg1, 1 goto Decrement1 goto Back1
Decrement2 nop nop nop decfsz reg1, 1 goto Decrement2 goto Back2
Finished end