bitem2k
New Member
Im trying to make a 5x5 led matrix display, similar to the one found **broken link removed**
ive wired up the leds in rows and columns.
All the leds anodes in a column are wired up,
all the cathodes of leds in a row are wired up in series with a resistor.
Im utilising PortA ports 0,1,2,3,6 for the columns
and PortB ports 0,1,2,3,4 for the rows.
When i set PortA to 0xFF and portB to 0x00, most of the lights come on, appart from 3/25
Please consult picture.
I have checked the wiring on the LEDS and it all appears fine,
and obviously the wiring must be fine connecting the ports to the columns/rows as some leds on the row/column in question work.
Does anyone have any idea whats going on?
Heres my code:
Many thanks
ive wired up the leds in rows and columns.
All the leds anodes in a column are wired up,
all the cathodes of leds in a row are wired up in series with a resistor.
Im utilising PortA ports 0,1,2,3,6 for the columns
and PortB ports 0,1,2,3,4 for the rows.
When i set PortA to 0xFF and portB to 0x00, most of the lights come on, appart from 3/25
Please consult picture.
I have checked the wiring on the LEDS and it all appears fine,
and obviously the wiring must be fine connecting the ports to the columns/rows as some leds on the row/column in question work.
Does anyone have any idea whats going on?
Heres my code:
Code:
INCLUDE "P16F627A.INC"
LIST P=16F627A
__Config _INTOSC_OSC_NOCLKOUT & _DATA_CP_OFF & _CP_OFF &_LVP_OFF &_BOREN_ON & _MCLRE_OFF & _WDT_OFF & _PWRTE_OFF
cblock 0x20
delayOuter
delayInner
endc
org 0
poweron
BSF STATUS,RP0 ;MOVE TO BANK1
CLRF TRISB ;PORT B ALL OUTPUTS
CLRF TRISA ;PORT a ALL OUTPUTS, EXCLUDING A5 OBVIOUSLY
BCF STATUS, RP0 ;MOVE TO BANK0
CLRF PORTA
MOVLW 0x07 ;Turn comparators off and
MOVWF CMCON ;enable pins for I/O
movlw 0xff
movwf PORTA
again
MOVLW 0xff
movwf PORTA
MOVLW 0x00
MOVWF PORTB
call Delay
MOVLW 0x00
movwf PORTA
MOVLW 0x00
MOVWF PORTB
call Delay
GOTO again ;ENDLESS LOOP
Delay
MOVLW D'255' ;set up
MOVWF delayOuter ;outer number of delay loops
StartDelay
MOVLW D'255' ;set up
movwf delayInner ;Set inner loops
InnerDelay
decfsz delayInner
goto InnerDelay
decfsz delayOuter
goto StartDelay
return
END
Many thanks