Wiring Forum
http://wiring.org.co/cgi-bin/yabb/YaBB.pl
Programming Questions & Help >> Programs >> Revising the Matrix Lib to work with the MAX72221
http://wiring.org.co/cgi-bin/yabb/YaBB.pl?num=1165535829

Message started by roy_pardi on 12/07/06 at 23:57:08

Title: Revising the Matrix Lib to work with the MAX72221
Post by roy_pardi on 12/07/06 at 23:57:08
Hi,

I'm looking into revising the Matrix Lib to work with the MAX72221 chip (because I have a circuit to enable me to use higher voltages with the 72221).

The difference between the chips seems slight but the 72221 seems to use a different sequence when loading data From the datasheet:

"Serial-Clock Input. 10MHz maximum rate. On CLK’s rising edge, data is shifted into the internal shift register. On CLK’s falling edge, data is clocked out of DOUT. On the MAX7221, the CLK input is active only while CSis low."

Looking at the Matrix Lib routine (below) it looks like I need to setLoad(LOW) first (i.e. load polarity is reversed between these two chips. Is that (remotely...) correct?

--Roy

// function that puts a byte of data into a max7219 register
void max7219_put(byte reg, byte data)
{
 max7219_setLoad(HIGH); // begin
 max7219_putByte(reg);  // specify register
 max7219_putByte(data); // put data
 max7219_setLoad(LOW);  // latch in data
 max7219_setLoad(HIGH); // end
}

Wiring Forum » Powered by YaBB 2.5 AE!
YaBB Forum Software © 2000-2010. All Rights Reserved.