SAA1064 Refuses to work - Solved #3

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);
}

Well, if you are wondering why the LED is blinking so slowly, the reason is that in diplayDigits(), there are 2 loops, each with 16 iterations. Each of the total of 32 iterations has a 500 mS delay. Ie 16 seconds in total. Add another second for the delay in the loop and you have 17 seconds.

I tired to get the I2C address with Nick Gammon's scanner. Got 0x3B as a result. So the I2C interface is not dead..

And yet the display refuses to oblige - the only improvement is now I have the Decimal Points on displays 2,3,4 showing up in the second part of the function displayDigits() If I can call that as an improvement that is !!

I have pored over the code ( simple as it is ) and changed the Control word for different combinations with no result.

Even added two 4.7K resistors to SCL and SDA lines...

And finally connected back to the 8052 KIT and yes the display works great. This is one situation where something working causes heart burn. :slight_smile:

Any more ideas to try out ?

Problem solved and the display is working great with the code that I posted !!

And so what was the issue ? The UNO board. Or so it looks for now, as I tried two different UNO boards ( originals from Italy ) and both behaved same.

Out of sheer frustration, I tired a bare bone Atmega328P and the display came live the first shot.

I know it does not sound logical but that's it - atleast I can now get on with my project using a bare bone PCB. Such a relief.

( Will be glad to hear from someone on possible reasons for this ...)