Home \ Help \ Search \ Login RSS

Welcome, Guest. Please Login

[size=16][highlight][color=#ff0000][b]This forum is now [u]READ-ONLY[/u]! Please visit [url]http://forum.wiring.co/[/url] for the new forum.[/b][/color][/highlight][/size]

Wiring ForumProgramming Questions & HelpPrograms › Revising the Matrix Lib to work with the MAX72221

Page Index Toggle Pages: 1
Revising the Matrix Lib to work with the MAX72221 (Read 3130 times)
12/07/06 at 23:57:08

roy_pardi   Offline
YaBB Newbies
Boston USA

Posts: 49

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?


// 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
IP Logged
Page Index Toggle Pages: 1