Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

8x8 LED Matrix driver problem

Status
Not open for further replies.

swapan

Full Member level 4
Joined
Feb 20, 2009
Messages
199
Helped
27
Reputation
54
Reaction score
24
Trophy points
1,298
Location
Kolkata
Activity points
2,806
Hi

After going through some tutorial on driving 8x8 LED matrix by MAX7219, I am trying to undertake simple practical tests. I have bought 4 cascaded 8x8 LED matrix assembled with MAX7219. The arrangement of the setup is as per attached schematic. As a simple test I want to activate only one column of the matrix. Please see the code also. On powering up, the circuit shows weird behavior. Sometimes all the columns are on, sometimes a portion is on, sometimes the entire matrix is off. This is the first time I am working on MAX7219 and SPI module. Please help me to sort out the problem.

Code:
sbit Chip_Select at RC4_bit;
sbit Chip_Select_Direction at TRISC4_bit;


void max7219_init1() {
  Chip_Select = 0;       // SELECT MAX
  SPI1_write(0x09);      // BCD mode for digit decoding
  SPI1_write(0x00);
  Chip_Select = 1;       // DESELECT MAX

  Chip_Select = 0;       // SELECT MAX
  SPI1_write(0x0A);
  SPI1_write(0x0F);      // Segment luminosity intensity
  Chip_Select = 1;       // DESELECT MAX

  Chip_Select = 0;       // SELECT MAX
  SPI1_write(0x0B);
  SPI1_write(0x07);      // Display refresh
  Chip_Select = 1;       // DESELECT MAX

  Chip_Select = 0;       // SELECT MAX
  SPI1_write(0x0C);
  SPI1_write(0x01);      // Turn on the display
  Chip_Select = 1;       // DESELECT MAX

  Chip_Select = 0;       // SELECT MAX
  SPI1_write(0x00);
  SPI1_write(0xFF);      // No test
  Chip_Select = 1;       // DESELECT MAX
}

void main() {

  Chip_Select_Direction = 0;    // Set RC0 pin as output

  SPI1_init();                  // Initialize SPI1 module

  max7219_init1();              // initialize  max7219

    Chip_Select = 0;     // select max7219
    SPI1_write(1);       // send i to max7219 (digit place)
    SPI1_write(0xFF);
    Chip_Select = 1;     // deselect max7219

    while(1);

}
View attachment untitled.pdf
 

use a test routine for:
send 0x0f and 0x01 --find whether all digits segments are ON.
Then send 0x0f and 0x00 -normal --LEDs ON/OFF.
 

Sorry,I could not get you. Please elaborate a little bit. I am not using 7 segment display.
 

your schematic does not show any display connected.

What is the display arrangement ?
 

Actually I did not attach the display arrangement. But in the text I have mentioned that 8x8 LED matrix assembled with MAX7219 has been used. However I am attaching one such module.


8x8-LED-Matrix-Module.jpg
 

still you can test the display with the code to be sent posted earlier.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top