thunderdog
Newbie level 5
- Joined
- Nov 10, 2009
- Messages
- 8
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Location
- california
- Activity points
- 1,368
Hi, I am using the MAX7219 to control a LED display. However, I can't seem to get it to light any of the digits. To start, I would like to go into test mode to light all digits. The wiring seems to be correct. Also, the MAX7219 just seems to stay in shutdown mode (all digits high, segments low). I am probing all the pins to verify. I am bit-banging the instruction for test mode. Here is the function used:
static void MAX7219_SendByte (unsigned char dataout)
{
char i;
for (i=8; i>0; i--) {
unsigned char mask = 1 << (i - 1); // calculate bitmask
PTFD_PTFD2 = 0 ; // bring CLK low
if (dataout & mask) // output one data bit
PTFD_PTFD5 = 1; // "1"
else // or
PTFD_PTFD5 = 0; // "0"
PTFD_PTFD2 = 1 ; // bring CLK high
PTFD_PTFD2 = 0 ; // bring CLK low
}
}
Single stepping through the code, I'm measuring the inputs to the relevant pins on the MAX7219 and they seem to be getting the correct inputs (CLK, Data and Load).
I am just sending 2 bytes as follows:
// Load low
SendByte (0x0F);
SendByte (0x01);
// Load (CS) high, then low
I expect to see all digits lit at this point.
Any suggestions welcome.
static void MAX7219_SendByte (unsigned char dataout)
{
char i;
for (i=8; i>0; i--) {
unsigned char mask = 1 << (i - 1); // calculate bitmask
PTFD_PTFD2 = 0 ; // bring CLK low
if (dataout & mask) // output one data bit
PTFD_PTFD5 = 1; // "1"
else // or
PTFD_PTFD5 = 0; // "0"
PTFD_PTFD2 = 1 ; // bring CLK high
PTFD_PTFD2 = 0 ; // bring CLK low
}
}
Single stepping through the code, I'm measuring the inputs to the relevant pins on the MAX7219 and they seem to be getting the correct inputs (CLK, Data and Load).
I am just sending 2 bytes as follows:
// Load low
SendByte (0x0F);
SendByte (0x01);
// Load (CS) high, then low
I expect to see all digits lit at this point.
Any suggestions welcome.