Darkstar64
New Member
Here is the code im working with im chaliplexing 12 LED's with 4 outputs from the PIC included is the curcuit diagram for refrence. This is for the letter S it should cycle through each LED with a 100 µs delay between LED's as well as it loops 1000 times in 1 second
Delay Code
Diagram everything is based off of this
Code:
Sam
clrf sc ; Sets Counter's loop amount to 256
clrf sc1
clrf sc2
clrf sc3
letS movlw b'000000' ; Clears all LED's to low
movwf GPIO
call delay100
movlw b'010111' ; Letter S Q1 Completly lit
movwf GPIO
call delay100
movlw b'000011' ; Letter S Q2 LED #4 lit
movwf GPIO
call delay100
movlw b'010111' ; Letter S Q3 Completly lit
movlw GPIO
call delay100
movlw b'010111' ; Letter S Q4 Completly lit
movwf GPIO
call delay100
decfsz sc,f ; Inner Loop Counter
goto letS
decfsz sc1,f ; 1st Middle Loop Counter
goto letS
decfsz sc2,f
goto letS
decfsz sc3,f
goto letS
Delay Code
Code:
;****************** Delay Subroutine ( 100 µs )
delay100 ; Delay W x 100 µs
movlw .25 ; Delay = ( N x 4 - 1 + 2 cycles = N x 4 + 1 )
movwf dc4 ; Writes 25 or N to register
dc5 nop ; No Operation
decfsz dc4,f ; Decrement Counter
goto dc5 ; If Decrement Counter is 0 then skips this if its not 0 then it loops untill 0
retlw 0
Diagram everything is based off of this