MAX7219 Confusion
![xanatos](https://forums.parallax.com/uploads/userpics/416/n3HKAG8I3I8DH.jpg)
I'm using the MAX7219 with a pair of 4x8 matrix LEDs (see attached datasheet).
I have the MAX7219's "digits" lines connected to the cathodes of the matrix, and the "segments" lines connected to the anodes.
Here are the relevant code sections that I am starting with, taken from Chris Savage's "Binary Digital Clock" project:
There's a lot of other stuff in there so I'm just showing the useful sections.
I've tried changing the values for the registers for NoDecode from FF to 00 (I want individual segment control, not a character map output).
The display remains BLANK no matter what I put into the initialization routine.
I'm uploading a few pictures of my wiring and the datasheet for the MAX7219. This looks like it should be simple enough - I just want to be able to light individual cells (these will indicate alarm conditions on any of my 100+ inputs) - but I am obviously doing something horribly wrong! :-) I'm thinking that once I have the setup data set correctly, I should then just be able to send my data to the 7219 in the form of the "digit" to select, and the "segments" for that digit that should be illuminated (which normally should be none... except when I'm trying to get it to light up by stuffing random test data in - but even that's not working!)
Please - help! :-)
Thanks,
Dave
I have the MAX7219's "digits" lines connected to the cathodes of the matrix, and the "segments" lines connected to the anodes.
Here are the relevant code sections that I am starting with, taken from Chris Savage's "Binary Digital Clock" project:
SClock PIN 0 ' shift clock (74HC595.11, DS1302.7, MCP3202.7, MAX7219.13) SDataIO PIN 1 ' serial data (74HC595.14; DS1302.6 via 1k, MCP3202.6 [DO] via 1k, MCP3202.5 [DI], MAX7219.1) M7219 PIN 5 ' MAX7219.12 CS for driving alarm panel LEDs Decode CON $09 ' BCD Decode Register Brite CON $0A ' Intensity Register Scan CON $0B ' Scan Limit Register ShutDn CON $0C ' Shutdown Register (1 = On) Test CON $0F ' Display Test Mode DecPnt CON %10000000 ' Decimal Point Blank CON %1111 ' Blank A Digit index VAR Byte ' Loop Counter d7219 VAR Byte ' Alarm Display idxOdd VAR index.BIT0 ' Is Index Odd? (1 = Yes) FOR index = 0 TO 7 ' Initialize MAX7219 LOOKUP index, [Scan, 7, Brite, 6, Decode, $00, ShutDn, 1], d7219 SHIFTOUT SDataIO, SClock, MSBFIRST, [d7219] 'IF (idxOdd = 0) THEN No_Load PULSOUT M7219, 5 ' Latch The Data No_Load: NEXT ' -----[ Program Code ]---------------------------------------------------- Main: index = 1 ' This is incremented by another process d7219 = secs.LOWNIB ' Seconds (Ones Digit) d7219 = d7219 | DecPnt ' Enable Decimal Point GOSUB AlarmPanelData index = index + 1 ' Select Digit 1 IF index > 7 THEN index = 0 ' -----[ Subroutines ]--------------------------------------------------------------------------------------------------------- AlarmPanelData: SHIFTOUT SDataIO, SClock, MSBFIRST, [index, d7219] PULSOUT M7219, 5 ' Latch Data RETURN
There's a lot of other stuff in there so I'm just showing the useful sections.
I've tried changing the values for the registers for NoDecode from FF to 00 (I want individual segment control, not a character map output).
The display remains BLANK no matter what I put into the initialization routine.
I'm uploading a few pictures of my wiring and the datasheet for the MAX7219. This looks like it should be simple enough - I just want to be able to light individual cells (these will indicate alarm conditions on any of my 100+ inputs) - but I am obviously doing something horribly wrong! :-) I'm thinking that once I have the setup data set correctly, I should then just be able to send my data to the 7219 in the form of the "digit" to select, and the "segments" for that digit that should be illuminated (which normally should be none... except when I'm trying to get it to light up by stuffing random test data in - but even that's not working!)
Please - help! :-)
Thanks,
Dave
Comments
Try Jon's code for None-Decode Mode,
THANKS GUYS!
Dave