bigal_scorpio
Active Member
Hi to all,
I have built a 12 x 12 LED matrix and built a controller for it.
The controller consists of ULN2803s sinking the columns and discrete npn transistors to supply the rows thus each requires a logic high to turn on.
The way I'm driving it is by a 16F874A pic and using 24 of the available pins. I didn't go with the more conventional method of using a latching counter simply to keep the component count down.
My circuit works ok as I have written a program to send a stripe across it which works ok and shows the circuit and the display are ok.
Now my problems start! Because of my use of the port pins in a non contiguous way I am struggling to find a method to display the characters that I designed it to do. For instance my rows are RD1, RD2, RD0, RD3, RC3,RC4,RC1,RC5,RC0,RC6,RE2,RC7 Which not only is not in order but also spans parts of ports. The columns are RA0,RB7,RA1,RB6,RA2,RB5,RA3,RB4,RE1,RB3,RA5,RB2.
Now I know I could rewire the LED matrix connector to get more of a semblence of order but I could never get it totally in order and I would still have the problem of crossing the ports.
I have puzzled over this for some time and am unable to come up with a solution. I write using PicBasicPro and as I have said before I am no expert but I thought stupidly that since I wanted just to display 3 static characters one after the other in a loop that it would be easy enough to figure out a way of doing it. I was wrong as usual!
I am posting my test code, though it is probably absolute rubbish in terms of programming I thought it would also let the reader see the order of things.
Any help appreciated very much, Al
I have built a 12 x 12 LED matrix and built a controller for it.
The controller consists of ULN2803s sinking the columns and discrete npn transistors to supply the rows thus each requires a logic high to turn on.
The way I'm driving it is by a 16F874A pic and using 24 of the available pins. I didn't go with the more conventional method of using a latching counter simply to keep the component count down.
My circuit works ok as I have written a program to send a stripe across it which works ok and shows the circuit and the display are ok.
Now my problems start! Because of my use of the port pins in a non contiguous way I am struggling to find a method to display the characters that I designed it to do. For instance my rows are RD1, RD2, RD0, RD3, RC3,RC4,RC1,RC5,RC0,RC6,RE2,RC7 Which not only is not in order but also spans parts of ports. The columns are RA0,RB7,RA1,RB6,RA2,RB5,RA3,RB4,RE1,RB3,RA5,RB2.
Now I know I could rewire the LED matrix connector to get more of a semblence of order but I could never get it totally in order and I would still have the problem of crossing the ports.
I have puzzled over this for some time and am unable to come up with a solution. I write using PicBasicPro and as I have said before I am no expert but I thought stupidly that since I wanted just to display 3 static characters one after the other in a loop that it would be easy enough to figure out a way of doing it. I was wrong as usual!
I am posting my test code, though it is probably absolute rubbish in terms of programming I thought it would also let the reader see the order of things.
Any help appreciated very much, Al
Code:
'****************************************************************
'* Name : 12x12matrixtest.BAS *
'* Author : BiGal *
'* Notice : Copyright (c) 2012 *
'* : All Rights Reserved *
'* Date : 12/10/2012 *
'* Version : 1.0 *
'* Notes : For 12x12 DIY matrix Needs High on Row and Column *
'* : Using 16F874A *
'****************************************************************
ADCON1 = 7
CMCON = 7
define XTAL = 20
TRISA = %00000000
TRISB = %00000000
TRISC = %00000000
TRISD = %00000000
TRISE = %00000000
MAIN:
PORTD.1 = 1
GOSUB COLUMN
PORTD.1 = 0
PORTD.2 = 1
GOSUB COLUMN
PORTD.2 = 0
PORTD.0 = 1
GOSUB COLUMN
PORTD.0 = 0
PORTD.3 = 1
GOSUB COLUMN
PORTD.3 = 0
PORTC.3 = 1
GOSUB COLUMN
PORTC.3 = 0
PORTC.4 = 1
GOSUB COLUMN
PORTC.4 = 0
PORTC.1 = 1
GOSUB COLUMN
PORTC.1 = 0
PORTC.5 = 1
GOSUB COLUMN
PORTC.5 = 0
PORTC.0 = 1
GOSUB COLUMN
PORTC.0 = 0
PORTC.6 = 1
GOSUB COLUMN
PORTC.6 = 0
PORTE.2 = 1
GOSUB COLUMN
PORTE.2 = 0
PORTC.7 = 1
GOSUB COLUMN
PORTC.7 = 0
GOTO MAIN
COLUMN:
PORTB.2 = 1
PAUSE 10
PORTB.2 = 0
PORTA.5 = 1
PAUSE 10
PORTA.5 = 0
PORTB.3 = 1
PAUSE 10
PORTB.3 = 0
PORTE.1 = 1
PAUSE 10
PORTE.1 = 0
PORTB.4 = 1
PAUSE 10
PORTB.4 = 0
PORTA.3 = 1
PAUSE 10
PORTA.3 = 0
PORTB.5 = 1
PAUSE 10
PORTB.5 = 0
PORTA.2 = 1
PAUSE 10
PORTA.2 = 0
PORTB.6 = 1
PAUSE 10
PORTB.6 = 0
PORTA.1 = 1
PAUSE 10
PORTA.1 = 0
PORTB.7 = 1
PAUSE 10
PORTB.7 = 0
PORTA.0 = 1
PAUSE 10
PORTA.0 = 0
RETURN
END