Pages: [1]   Go Down
Author Topic: Interfacing Arduino LED Matrix 8*32  (Read 2170 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello I have bought 4 8*8 LED Matrix.


And I saw this circuit and I have built it (eventually have all the components).
Do anybody here know how to program the LED Matrix?
Is there any available library for LED Matrix and those shift registers?

Thank you.
 smiley
Logged

Offline Offline
Edison Member
*
Karma: 116
Posts: 2205
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Fairly easy. If follows this generic process:

1) Blank the display - you can ignore this if your OE pin is hardwared;
2) Present the data on the latch;
3) Pulse the hc595's clock line just once - this is the tricky part, as you need to test if the end of the last column has been reached. If so, you need to present the data bit.

The scan starts on the left most column.

3) is really the key to allow this type of display to be updated quickly.
Logged

Southern California
Offline Offline
God Member
*****
Karma: 5
Posts: 539
I like blinky lights
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello I have bought 4 8*8 LED Matrix.

And I saw this circuit and I have built it (eventually have all the components).
Do anybody here know how to program the LED Matrix?
Is there any available library for LED Matrix and those shift registers?

Thank you.
 smiley

Hi,

For clarification -- do you want help to program the 8*32 matrix that you built exactly like the schematic you attached (including the At90s2313), or do you want to build an 8*32 matrix similar to the schematic but controlled by an Arduino?

For the former, it looks like you'd use the SPI bus to communicate between the Arduino's ATMega and your circuit's At90s2313, but you'd have to look at the At90s2313's programming to see how you communicate with it.

For the latter, the easiest way I know to do what you want is to replace the 74hc259 with another 74hc595 (outputs driving the ULN2003, inputs on the same bus as the rest of the 74hc595s) and use the ShiftMatrixPWM library.

Good luck!
Logged

http://en.wiktionary.org/wiki/magagna <-- My last name.  Pretty apt.

Offline Offline
Edison Member
*
Karma: 116
Posts: 2205
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am going to try it differently:

Code:
#define DIGS_MAX 8 //max number of matrix

//display buffer
//organization:
//row0: display-1(Q0..Q7), ..., display-8(Q0..Q7);
//...
//row7: display-1(Q0..Q7), ..., display-8(Q0..Q7);

unsigned char dispBuffer[8*DIGS_MAX); //display buffer

void display(void) {
  static unsigned char row=0; current row
  unsigned char *ptr=&dipBuffer[8*row+DIGS_MAX-1]; //pointer to display buffer, to speed up execution
  shift_out(*ptr--); //send the right most byte
  shift_out(*ptr--); //send the 2nd right most byte
  ...
  shift_out(*ptr  ); //send the left most byte
  
  row_on(row++); //turn on the current row
  latch_display(); //latch the data onto hc595

  //update row
  if (row==DIGS_MAX) row = 0; //wrap around row
}

So each time you call display, it goes out one row. If you put this function in a timer isr, it will automatically update the display. All you do is to load up dispBuffer[] with an image.
Logged

Pages: [1]   Go Up
Jump to: