Gayan Soyza
Active Member
I’m making a 5X7 (5columns & 7 rows) matrix project. Rows driving from PORTB & columns driving from 74HC164.
I can scroll a letter nicely with a slow scrolling speed.
My problem is when I increase the speed of scrolling the letter is mirroring. Means some sort of shadow moving with the letter lines. So when scrolling speedily the letter is not sharp.
People who have experience with matrix designs may know this incident.
I can scroll a letter nicely with a slow scrolling speed.
My problem is when I increase the speed of scrolling the letter is mirroring. Means some sort of shadow moving with the letter lines. So when scrolling speedily the letter is not sharp.
People who have experience with matrix designs may know this incident.
Code:
Table addwf PCL,F
retlw b'00000000' ;Letter 'A'
retlw b'00111111'
retlw b'01001001'
retlw b'01001001'
retlw b'01001001'
retlw b'00111111'
retlw b'10000000' ;80h
;**************************
;Main routine
;**************************
Start call CLRREG ;clear all RAM variables
clrf Pointer
movlw .100
movwf Scan_Count
Show_Loop movf Pointer,W
call Table
movwf Col5 ;load to col 5
xorlw 80h ;end of letter??
btfsc STATUS,Z
goto Start
[COLOR="Red"]Loop1 call Scan
decfsz Scan_Count,F
goto Loop1
movlw .100
movwf Scan_Count[/COLOR]
call Shift
incf Pointer,F
goto Show_Loop
;*************************
;simple multiplex routine
;*************************
Scan bcf PORTA,2 ;reset SR-74HC164
nop ;//
nop ;//
bsf PORTA,2 ;
nop
bsf PORTA,1 ;enable data pin
movf Col1,W ;1
call Clock_Pulse
bcf PORTA,1 ;disable data pin
movf Col2,W ;2
call Clock_Pulse
movf Col3,W ;3
call Clock_Pulse
movf Col4,W ;4
call Clock_Pulse
movf Col5,W ;5
call Clock_Pulse
return
;**********************************
;Clock pulse routine to SR-74HC164
;**********************************
Clock_Pulse movwf Col_Data ;save column data
clrf PORTB
goto $+1
goto $+1
goto $+1
goto $+1
goto $+1
bsf PORTA,0 ;low to high transition
nop
bcf PORTA,0 ;make low for next transition
nop
movf Col_Data,W
movwf PORTB
goto $+1
goto $+1
return
;**************************************
;shift - moves one column data to left
;**************************************
Shift movf Col2,W ;2 to 1
movwf Col1
movf Col3,W ;3 to 2
movwf Col2
movf Col4,W ;4 to 3
movwf Col3
movf Col5,W ;5 to 4
movwf Col4
return
Last edited: