list p=12C509A
[FONT=Arial][SIZE=2]include <p12C509A.inc>
__CONFIG _IntRC_OSC & _WDT_OFF
cblock 0x07
LED
Dly
endc
org 0x0000
goto Start[/SIZE][/FONT]
[FONT=Arial][SIZE=2]L_TRIS addwf PCL, F ; LED TRIS 00 thru 20 (00 = off)
dt 0xFF,0xCF,0xEB,0xF9,0xFC,0xCF,0xEB,0xF9,0xFC,0xDB,0xFA
dt 0xDB,0xFA,0xDD,0xDD,0xED,0xED,0xEE,0xEE,0xDE,0xDE
L_GPIO addwf PCL, F ; LED GPIO 00 thru 20 (00 = off)
dt 0x00,0x20,0x10,0x04,0x02,0x10,0x04,0x02,0x01,0x20,0x04
dt 0x04,0x01,0x20,0x02,0x10,0x02,0x10,0x01,0x20,0x01[/SIZE][/FONT]
[FONT=Arial][SIZE=2]Start movlw .20
movwf LED[/SIZE][/FONT]
[FONT=Arial][SIZE=2]Next movf LED, W
call L_TRIS ; get the port TriState value
TRIS GPIO ; set the tristate
movf LED,W
call L_GPIO ;
movwf GPIO ;
decfsz Dly
goto $-1 ; delay
decfsz LED
goto Next
goto Start
END[/SIZE][/FONT]