Hi,
I am using the following code to multiplex a 7x8 LED array. PORTA (0x05) controls which column is on and PORTB (0x06) controls the rows for each column using the values in COL1 - COL8. PORTB changes exactly as it should to show the patterns, however PORTA remains on b'00000000'. I have also tried to us BSF and BCF to turn on individual bits in PORTA but that doesn't work either.
Also, please don't make comments about using EQUs to get rid of annoying HEX codes as this is the way I prefer to program.
Thanks!
I am using the following code to multiplex a 7x8 LED array. PORTA (0x05) controls which column is on and PORTB (0x06) controls the rows for each column using the values in COL1 - COL8. PORTB changes exactly as it should to show the patterns, however PORTA remains on b'00000000'. I have also tried to us BSF and BCF to turn on individual bits in PORTA but that doesn't work either.
Code:
MULTIPLEX
CLRF 0x05 ; Turn off columns
CLRF 0x06 ; Turn off rows
MOVLW b'00000001'
MOVWF 0x05 ; Turn on column 1
MOVF COL1,W
MOVWF 0x06 ; Turn on rows for column 1
NOP
CLRF 0x06 ; Turn off rows
RLF 0x05,1 ; Turn on column 2
MOVF COL2,W
MOVWF 0x06 ; Turn on rows for column 2
CLRF 0x06 ; Turn off rows
RLF 0x05,1 ; Turn on column 3
MOVF COL3,W
MOVWF 0x06 ; Turn on rows for column 3
CLRF 0x06 ; Turn off rows
RLF 0x05,1 ; Turn on column 4
MOVF COL4,W
MOVWF 0x06 ; Turn on rows for column 4
CLRF 0x06 ; Turn off rows
RLF 0x05,1 ; Turn on column 5
MOVF COL5,W
MOVWF 0x06 ; Turn on rows for column 5
CLRF 0x06 ; Turn off rows
RLF 0x05,1 ; Turn on column 6
MOVF COL6,W
MOVWF 0x06 ; Turn on rows for column 6
CLRF 0x06 ; Turn off rows
RLF 0x05,1 ; Turn on column 7
MOVF COL7,W
MOVWF 0x06 ; Turn on rows for column 7
CLRF 0x05 ; Turn off columns
CLRF 0x06 ; Turn off rows
RETURN
Also, please don't make comments about using EQUs to get rid of annoying HEX codes as this is the way I prefer to program.
Thanks!