Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Can anyone suggest a solution to a matrix display problem?

Status
Not open for further replies.

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
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
 
from what i understand, your biggest problem is to deal with mix and match of I/O.
there are different ways to do this but i' would just create function that has
has simple input and handles your "swiss cheese" outputs.
after this is done, you life to control those outputs will be piece of cake...

here is an example of doing the same thing but with inputs (in C and on different controller)

Code:
int Read_In(void)   // read inputs
{
   int in,x,y;

   in=RdPortI(PGDR);    // read from port G           ;
   x = in >>7;          // extract PG7 as X0          ;

   in=RdPortI(PBDR);    // read from port B           ;
   y = in & 0x3c;       // extract bits 2,3,4,5       ;
   x = x | (y>>1);      // map them as X1,X2,X3,X4    ;
   y = in &  0x80;      // extract bit PB7            ;
   x = x | (y>>2);      // map it as X5               ;

   in=RdPortI(PFDR);    // read from port F           ;
   y = in & 0x03;       // extract bits 0 and 1       ;
   x = x | (y<<6);      // map them as X6 and X7      ;
   y = in & 0xf0;       // extract bits 4..7          ;
   x = x | (y<<8);      // map them as XC..XF         ;

   in=RdPortI(PEDR);    // read from port E           ;
   y = in & 0x03;       // extract bits 0 and 1       ;
   x = x | (y<<8);      // map them as X8 and X9      ;
   y = in & 0x30;       // extract bits 4 and 5       ;
   x = x | (y<<6);      // map them as XA and XB      ;
   return x;
}
 
Hi panic mode,

Love the analogy! Why didn't I think of Swiss Cheese!

As to the code maybe its because its in C which I don't understand or if its just too complex but I don't get it at all.

I am only used to PicBasic or at a push MikroBasic and am not too good at seeing the Logic part of equations.

Thanks though mate, I will keep studying it, never know something may sink in eventually.

Al
 
all i did in that function is bit manipulation

AND with some mask to extract bits of interest
shift (if needed) to align them
OR to combine them

from what i can see PicBasic may not have corresponding instructions and one would need to resort to inline assembler or stick with single bit instructions (CLEARBIT, GETBIT etc.)
 
One simple trick is to use #defines to give names to the rows or columns. Then you can use the #defined name, not the actual pin name, and you only need to mess with the pins once, in the top of the code.

" For instance my rows are RD1, RD2, RD0, RD3, RC3, ...."
Code:
#define  ROW1   PORTD.F1;
#define  ROW2   PORTD.F2;
#define  ROW3   PORTD.F0;
#define  ROW4   PORTD.F3;
#define  ROW5   PORTC.F3; (etc)

//then in code;

ROW1 = 1;   // turns row1 on
ROW3 = 0;   // turns row3 off etc

That should still execute fairly fast, as "ROW1 = 1" shoucl compile down to "BSF PORTD.F1" which is a single instruction.
 
Last edited:
Hi Roman,

That seems a good idea mate I will have a go at that.

A thought occurs. Could I use the same thing but with the number as a variable, as in ROW(x) where (x) would be 0 to 11. Providing I have pre defined all the ports as you suggested?

What do you reckon mate?

Al
 
Greetings Al. Hope you and family are well.

There's a couple things you could do to make programming this matrix a little easier. May I recommend, (1) that you use a buffer to hold the image that you're trying to display, and, (2) that you use an interrupt routine to refresh the display from the buffer automatically as a background task?

The buffer can be organized so that it mirrors the display, that is, each bit in the buffer array would correspond to a pixel in the same position on the 12x12 matrix, perhaps something like this;

Code:
    int display[] = { 0b000000000000,           // row 00
                      0b000000000000,           // row 01
                      0b000111000000,           // row 02
                      0b001000100000,           // row 03
                      0b001000100000,           // row 04
                      0b001111100000,           // row 05
                      0b001000100000,           // row 06
                      0b001000100000,           // row 07
                      0b001000100000,           // row 08
                      0b000000000000,           // row 09
                      0b000000000000,           // row 10
                      0b000000000000 };         // row 11

Placing an image into this type of "row" array can be tricky. Scrolling the array (and display) left or right would involve shifting each of the twelve "row" array elements left or right one bit.

Instead of a "row" array, you might use a "column" array where each of the twelve array elements represents a column of 12 pixels. This type array would probably be easier to load with patterns from your character tables. Scrolling the array (and display) left or right would involve shifting the entire array left or right one word.

Your interrupt driven display driver could use periodic timer interrupts to refresh the display one row or one column at a time, depending on how you've designed the matrix. You should try for a relatively high refresh rate to avoid flicker. For example, using 1 msec interrupts would yield an ~83 Hz refresh rate (1/12-msecs=83.333 Hz). Your interrupt driver would need to perform the following tasks;

(1) blank the display (turn off the currently displayed column or row)
(2) set or clear 12 row or column bits on the display by translation from the array
(3) enable and display the new column or row
(4) bump your column or row counter variable in preparation for next interrupt

This method allows managing the display in your main program by simply turning bits in the display[] buffer array on or off while refreshing the display is being handled in the background.

Food for thought... I can't help you with PICBASICPRO. Sorry!

Cheerful regards, Mike
 
Last edited:
A thought occurs. Could I use the same thing but with the number as a variable, as in ROW(x) where (x) would be 0 to 11. Providing I have pre defined all the ports as you suggested?
Depending on the language you're using, you could use a lookup table (e.g. an array) to get the port address and bitmask for any given pin.

So to set Row(r) you might end up writing (in C at least):

Code:
#define SetRow(r, value) do{if(value)PortLookup[r] |= BitmaskLookup[r]; else PortLookup[r] &= ~BitmaskLookup[r];}while(0)
 
... A thought occurs. Could I use the same thing but with the number as a variable, as in ROW(x) where (x) would be 0 to 11. Providing I have pre defined all the ports as you suggested?
...

That's possible if you need that type of addressing. Mike and Dougy have given a couple of ways to do it, another way is to use a function;
set_row(unsigned char x)
or
clr_row(unsigned char x)
and inside the function use a lookup table to even a switch/case statement to set and clr the row.
 
Hi Guys,

I am getting more and more confused by this code problem. All the more so because "C" is so strange to me.

Probably any of your suggestions would be ok but for the fact that I can't get my head around them. I have never used this sort of program before and all of the things it needs are alien to me.

One of the most puzzling things is one which I am certain that I need to apply here, Arrays!

I have read all the PBP manual has to say about them which is about 40 words and from that gained nothing other than how to make an array called "fish"! Nothing about how the data in it is stored or accessed has sunk in. From the very few scraps I have found on the net it seems I have simply to set up the data I need in order and name it and state the amount.

The code below is how I see the array being set up. Is it right or wrong? Is the number ok for the data [12]? Or should it somehow be in one part and encompass the whole data and be [144]?

What really annoys me is my own stupidity as I used to be able to easily write programs 30 years ago when I had the CBM64, and people said that the CBM64 basic was diffuicult to use. I am now unable to grasp these simple sounding concepts without actually seeing an example. But then again I still have the 64 manual and it is a hell of a lot thicker and more informative than the PBP one! So maybe its not just me becoming denser but the people who write the manuals being less able to teach me?

Anyway rant over. Can anyone look at my proposed array and see if it is correct please.

Al

Code:
  ADCON1 = 7
  CMCON = 7
 define XTAL = 20
 
 CHARB var word[12]
 CHARM var word[12]
 CHARW var word[12]
   
 TRISA = %00000000
 TRISB = %00000000
 TRISC = %00000000
 TRISD = %00000000
 TRISE = %00000000
 
CHARB[0]= %000000000000  '1st character data
CHARB[1]= %111111111111
CHARB[2]= %111111111111
CHARB[3]= %110001100011
CHARB[4]= %110001100011
CHARB[5]= %110001100011
CHARB[6]= %110011100011
CHARB[7]= %011111100011
CHARB[8]= %001101111110
CHARB[9]= %000000111100
CHARB[10]=%000000000000
CHARB[11]=%000000000000


CHARM[0]= %111111111111  '2nd character data
CHARM[1]= %111111111111
CHARM[2]= %011100000000
CHARM[3]= %001110000000
CHARM[4]= %000111000000
CHARM[5]= %000011100000
CHARM[6]= %000011100000
CHARM[7]= %000111000000
CHARM[8]= %001110000000
CHARM[9]= %011100000000
CHARM[10]=%111111111111
CHARM[11]=%111111111111


CHARW[0]= %111111111111  '3rd character data
CHARW[1]= %111111111111
CHARW[2]= %000000001110
CHARW[3]= %000000011100
CHARW[4]= %000000111000
CHARW[5]= %000001110000
CHARW[6]= %000001110000
CHARW[7]= %000000111000
CHARW[8]= %000000011100
CHARW[9]= %000000001110
CHARW[10]=%111111111111
CHARW[11]=%111111111111
 
I have been playing with your 12 X 12 matrix for BMW, take a look at this, the last box shows what will be on for each letter by showing as black, each box is 3 lines.
Another idea is to use a diode matrix to drive each LED or string of LEDs if you can figure how to string them together. For instance, if you could figure out how to make a bunch of 4 or 6 LED strings. If there is nothing in the 4th box, you don't need that LED, it never lights.
Kinarfi
 
Hi Jeff,

Wow mate, that looks pretty complicated in wiring terms. At the moment I am having a bit of a bad spell with a cold and even counting LEDs seems complicated at present.

I am on the verge of redesigning the whole driver to give contiguous port pins to drive the LEDs but even then I have the problem of using more than one port which complicates things.

Wish I could go back 30 odd years, things were so much easier to learn then! ;)

Al
 
Last edited:
Take a look at this, I think you'll see what I'm doing, making strings of 12 and a few of 9. I also change the B to use 72 leds
 
I am on the verge of redesigning the whole driver to give contiguous port pins to drive the LEDs but even then I have the problem of using more than one port which complicates things.
I've attached some code that should remap from RowPortValue and ColPortValue to the actual ports. You simply set the values you want in these two variables, which can hold the full 12 bits of the Row/Col, then call (i.e. GOSUB) the SetPortValues function.

IMO PBP is not a nice language to use and it encourages bad programming style.

Code:
RowPortValue var word
ColPortValue var word
tempa var byte
tempb var byte
tempc var byte
tempd var byte
tempe var byte



SetPortValues:
' Rows: RD1, RD2, RD0, RD3, RC3,RC4,RC1,RC5,RC0,RC6,RE2,RC7 
' columns are RA0,RB7,RA1,RB6,RA2,RB5,RA3,RB4,RE1,RB3,RA5,RB2.
' uses 	RA0,1,2,3,5
	tempa = PORTA & %11010000
'		RB2,3,4,5,6,7
	tempb = PORTB & %00000011
'		RC0,1,3,4,5,6,7
	tempc = PORTC & %00000100
'		RD0,1,2,3
	tempd = PORTD & %11110000
'		RE1,2
	tempe = PORTE & %11111001

' Rows: RD1, RD2, RD0, RD3, RC3,RC4,RC1,RC5,RC0,RC6,RE2,RC7 
	if RowPortValue & 1 then 
		tempd =	tempd | 2
	end if
	if RowPortValue & 2 then
		tempd =	tempd | 4
	end if
	if RowPortValue & 4 then
		tempd =	tempd | 1
	end if
	if RowPortValue & 8 then
		tempd =	tempd | 8
	end if
	if RowPortValue & 16 then
		tempc =	tempc | 8
	end if
	if RowPortValue & 32 then
		tempc =	tempc | 16
	end if
	if RowPortValue & 64 then
		tempc =	tempc | 2
	end if
	if RowPortValue & 128 then
		tempc =	tempc | 32
	end if
	if RowPortValue & 256 then
		tempc =	tempc | 1
	end if
	if RowPortValue & 512 then
		tempc =	tempc | 64
	end if
	if RowPortValue & 1024 then
		tempe =	tempe | 4
	end if
	if RowPortValue & 2048 then
		tempc =	tempc | 128	
	end if

' columns are RA0,RB7,RA1,RB6,RA2,RB5,RA3,RB4,RE1,RB3,RA5,RB2.
	if ColPortValue & 1 then
		tempa =	tempa | 1
	end if
	if ColPortValue & 2 then
		tempb =	tempb | 128
	end if
	if ColPortValue & 4 then
		tempa =	tempa | 2
	end if
	if ColPortValue & 8 then
		tempb =	tempb | 64
	end if
	if ColPortValue & 16 then
		tempa =	tempa | 4
	end if
	if ColPortValue & 32 then
		tempb =	tempb | 32
	end if
	if ColPortValue & 64 then
		tempa =	tempa | 8
	end if
	if ColPortValue & 128 then
		tempb =	tempb | 16
	end if
	if ColPortValue & 256 then
		tempe =	tempe | 2
	end if
	if ColPortValue & 512 then
		tempb =	tempb | 16
	end if
	if ColPortValue & 1024 then
		tempa =	tempa | 32
	end if
	if ColPortValue & 2048 then
		tempb =	tempb | 4
	end if
	
	' copy the calculated values back into the ports
	PORTA =	tempa
	PORTB =	tempb
	PORTC =	tempc
	PORTD =	tempd
	PORTE =	tempe
	
	return

To use the above function it'd go something like this:
Code:
RowPortValue = %010010101001     ' some value you want displayed
ColPortValue = %000000000100     ' set column 3 high
gosub SetPortValues
 
Last edited:
Still playing with your LED matrix, kind of a brain teaser, what LEDs are you using, what is the current and voltage of each, do they have a common ground or can you string them together in groups and what are you using to power them with?
With 3 characters, BMW, there 8 possible combinations, from not ever on, 000, to on for ever letter, 123, 1 is on for B, 2 is on for M, 3 is on for W. 103 would mean the LED is on for B & W, etc etc. The possible combinations are:
100 36 3X12
020 10
003 On for 1 letter 8
023 10
103 12
120 On for 2 letters 36 3X12
123 On for 3 letters 16 2X8
000 Never on 16 2X8
so depending on what it takes to power the LEDs you only need 7 different "ON" signals, or just 3 if you use a diode matrix to power up each string for each time period.
I would suggest for MY 1970s version, assuming 3.2 V/LED & 20ma, plan for 7 strings of 12, 5 strings of 8, 2 strings 10, a 45 v power supply for the LEDs, 14 LM317 current limiters, 3 switching FETs and your timer / driver each letter.
 
memory's usually cheap

Howdy, it'll be a lot of labor up front, but build separate arrays 1/port for each character to be displayed. Align all array base addresses on hard, simple boundaries. Use an index as the character "code" (i.e. if ASCII, "0"=$30) fetch & transfer from each array by index to each port.

Yes, it IS a lot up front to build the arrays. I've use a spreadsheet to help "break" the array coding. Define an array as the "display" array. You put a value (any nonblank will do), in a "pixel", have the cell definition change its' own color if value is nonblank.

Start by defining 1 port array: Have their cell definitions dependent on the display arrays' value as blank/nonblank. Next define single cells for each row and/or column that compress the array positions into a single numeric value (use decimal) that represent the ports' bit positions. Make the display cell references "static" ($a,$4 as req'd). Copy & paste this array definition, 1/port used. Alter each array to match the port it represents.

Usage: stuff a blank/nonblank into the display array as the image bitmap. Transfer the array valueset for each port to your code listing, use comma delimited format. Since it's decimal, you (should) only have to add the line opcode. Label the 1st arrays' base address for each character. Use it with a fixed offset to transfer each array value to its' port, then step to the next index (from 0 to 11 in your case).

This Does chew up LOTS of program memory, but also greatly simplifies & speeds up your runtime routine. As with so many things, the first time is a struggle, but gets easier thereafter.

A former colleague thought nothing of changing display segment mappings if it meant a simpler board layout on any given revision. I came up with the spreadsheet method to keep me from wringing his stupid neck, but I've never used it in a row/column scenerio. Good Hunting... <<<)))
 
Still playing, just need to make my 555 & 2 flip flops. When I run this, it takes forever, any one know how to speed it up with out buying a new computer?
 
Last edited:
Hi Guys,

Thanks for all the posts, had a lot to chew over there!

I have been reading and reading info on matrices and together with ideas from here I got a version cobbled together that actually works. :D

At the moment I only have the display showing a "B" and its the wrong way round (flipped vertically) but this is simple enough to correct. All I need now is to put the data for another 2 characters in and I'm good to go.

Jeff, I know you have done a lot of work on this project but doing it that way would mean building another set of matrices and that was a really time consuming and annoying part, also I would need a hell of a lot more hardware mate and I forgot to mention that this project has to fit in a small place in the car.

Anyway as long as I have it working I don't mind the pain it has been, thats how I do most of my learning. I seem to learn best by failure. When you've spent 100s of hours doing something and it finally works the mistakes you made doing it really do stick in your memory! hehehe

Thanks again for all the help.

BTW here is my code for the display. I am posting it for all to see and comment on. By all means feel free to pick faults with it, I know it's ugly and probably much bigger than it needs to be but I can say that I finally got something that works at last.

Al

Code:
  ADCON1 = 7
  CMCON = 7
 define XTAL = 20
 
 TRISA = %00000000
 TRISB = %00000000
 TRISC = %00000000
 TRISD = %00000000
 TRISE = %00000000
 
 SYMBOL PORT_PIN = PORTB
 
 col var byte
 row var word
 col = 0
 row = 0
 num var word
 rit var bit

MAIN:
PORTB = 0
PORTC = 0
PORTD = 0
row = 0
rit = 0
for num = 0 to 999
'FOR col = 0 to 11

PORT_PIN.0[col] = 1
for row = 0 to 11
LOOKUP2 row,[0,0,0,0,0,0,0,0,0,0,0,0],rit
PORT_PIN.0[row+12] = rit
next row
PORT_PIN.0[col] = 0
col = col + 1
PORT_PIN.0[col] = 1
for row = 0 to 11
LOOKUP2 row,[1,1,1,1,1,1,1,1,1,1,1,1],rit
PORT_PIN.0[row+12] = rit
next row
PORT_PIN.0[col] = 0
col = col + 1
PORT_PIN.0[col] = 1
for row = 0 to 11
LOOKUP2 row,[1,1,1,1,1,1,1,1,1,1,1,1],rit
PORT_PIN.0[row+12] = rit
next row
PORT_PIN.0[col] = 0
col = col + 1
PORT_PIN.0[col] = 1
for row = 0 to 11
LOOKUP2 row,[1,1,0,0,0,1,1,0,0,0,1,1],rit
PORT_PIN.0[row+12] = rit
next row
PORT_PIN.0[col] = 0
col = col + 1
PORT_PIN.0[col] = 1
for row = 0 to 11
LOOKUP2 row,[1,1,0,0,0,1,1,0,0,0,1,1],rit
PORT_PIN.0[row+12] = rit
next row
PORT_PIN.0[col] = 0
col = col + 1
PORT_PIN.0[col] = 1
for row = 0 to 11
LOOKUP2 row,[1,1,0,0,0,1,1,0,0,0,1,1],rit
PORT_PIN.0[row+12] = rit
next row
PORT_PIN.0[col] = 0
col = col + 1
for row = 0 to 11
LOOKUP2 row,[1,1,0,0,1,1,1,0,0,0,1,1],rit
PORT_PIN.0[row+12] = rit
next row
PORT_PIN.0[col] = 0
col = col + 1
PORT_PIN.0[col] = 1
for row = 0 to 11
LOOKUP2 row,[0,1,1,1,1,1,1,0,0,0,1,1],rit
PORT_PIN.0[row+12] = rit
next row
PORT_PIN.0[col] = 0
col = col + 1
PORT_PIN.0[col] = 1
for row = 0 to 11
LOOKUP2 row,[0,0,1,1,0,1,1,1,1,1,1,0],rit
PORT_PIN.0[row+12] = rit
next row
PORT_PIN.0[col] = 0
col = col + 1
PORT_PIN.0[col] = 1
for row = 0 to 11
LOOKUP2 row,[0,0,0,0,0,0,1,1,1,1,0,0],rit
PORT_PIN.0[row+12] = rit
next row
PORT_PIN.0[col] = 0
col = col + 1
PORT_PIN.0[col] = 1
for row = 0 to 11
LOOKUP2 row,[0,0,0,0,0,0,0,0,0,0,0,0],rit
PORT_PIN.0[row+12] = rit
next row
PORT_PIN.0[col] = 0
col = col + 1
PORT_PIN.0[col] = 1
for row = 0 to 11
LOOKUP2 row,[0,0,0,0,0,0,0,0,0,0,0,0],rit
PORT_PIN.0[row+12] = rit
next row
PORT_PIN.0[col] = 0

col = 0
next num



GOTO MAIN

END
 
Not to worry, I was just entertaining myself, sort of like doing crossword puzzle, it's just fun to figure things out.
Jeff
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top