Hi!
I am trying to get MAX6921 to drive my display.
http://datasheets.maximintegrated.com/en/ds/MAX6921-MAX6931.pdfThe segments is hooked up to OUT0-OUT6. Digits is connected to OUT7-OUT14.
From datasheet:
The MAX6921/MAX6931 are normally written using the following sequence:
1) Take CLK low.
2) Clock 20 bits of data in order D19 first to D0 last into DIN, observing the data setup and hold times.
3) Load the 20 output latches with a falling edge on LOAD.
LOAD can be high or low during a transmission. If LOAD is high, then the data shifted into the shift register at DIN appear at the OUT0 to OUT19 outputs.
I have tried to use shiftout and a self made "shiftout" funtion.
The output seems a bit random to me (digits lights up but not in the way I want

)
Here is one of my code examples:
byte dummy=0; //Just to fill out the upper 4 bits
byte digit=1; // Try to lit one digit
digitalWrite(clockPin, LOW);
digitalWrite(loadPin, LOW);
shiftOut(dataPin, clockPin, MSBFIRST, dummy);
shiftOut(dataPin, clockPin, MSBFIRST, digit);
shiftOut(dataPin, clockPin, MSBFIRST, segFont[2]); // segFont is a byte
digitalWrite(loadPin, HIGH);
Example 2:
void send_word(long data)
{
digitalWrite(clockPin, LOW);
digitalWrite(loadPin, LOW);
for(byte i=0; i<20; i++)
{
if (data & (1 << i))
{
digitalWrite(dataPin, HIGH);
}
else
{
digitalWrite(dataPin, LOW);
}
digitalWrite(clockPin, HIGH);
digitalWrite(clockPin, LOW);
}
digitalWrite(loadPin, HIGH);
}
I really would like to have some working Arduino code. I have looked at the code from Adafruits "Ice Tube Clock" but do not understand it.
/Olof