A simple SAA1064 trial with 4 digits.
Circuit setup exactly as per reference design in SAA1064 data sheet.
Circuit tried with a 8052 MCU and works well.
Enter UNO.
Wiring done to just the 4 terminals : Vcc / Gnd / SDA / SCL
Tried running the code below ( Exact one as in TronixLab tutorial )
Result : Dead display ; Even the LED flash gets very slow ( about 10sec On / Off ) instead of 1sec on / 1 sec off ( checked by commenting the display code inside loop )
SO what could be wrong ??
/*
John Boxall July 2011 | CC by-sa-nc
*/
#include "Wire.h" // enable I2C bus
byte saa1064 = 0x70 >> 1; // define the I2C bus address for our SAA1064 (pin 1 to GND) ****
int digits[16] = {63, 6, 91, 79, 102, 109, 125, 7, 127, 111, 119, 124, 57, 94, 121, 113};
byte LED = 13;
bool ledState;
void setup()
{
Wire.begin(); // start up I2C bus
delay(500);
initDisplay();
pinMode(LED, OUTPUT);
}
void initDisplay()
{
Wire.beginTransmission(saa1064);
Wire.write(B00000000);
Wire.write(B01000111);
Wire.endTransmission();
}
void displayDigits()
{
for (int z = 0; z < 16; z++)
{
Wire.beginTransmission(saa1064);
Wire.write(1);
Wire.write(digits[z]); // digit 1 (RHS)
Wire.write(digits[z]); // digit 2
Wire.write(digits[z]); // digit 3
Wire.write(digits[z]); // digit 4 (LHS)
Wire.endTransmission();
delay(500);
}
for (int z = 0; z < 16; z++)
{
Wire.beginTransmission(saa1064);
Wire.write(1);
Wire.write(digits[z] + 128); // digit 1 (RHS)
Wire.write(digits[z] + 128); // digit 2
Wire.write(digits[z] + 128); // digit 3
Wire.write(digits[z] + 128); // digit 4 (LHS)
Wire.endTransmission();
delay(500);
}
}
void clearDisplay()
{
Wire.beginTransmission(saa1064);
Wire.write(1);
Wire.write(0); // digit 1 (RHS)
Wire.write(0); // digit 2
Wire.write(0); // digit 3
Wire.write(0); // digit 4 (LHS)
Wire.endTransmission();
}
void loop()
{
displayDigits();
clearDisplay();
delay(1000);
if (ledState ) ledState = LOW;
else ledState = HIGH;
digitalWrite ( LED, ledState);
}