Anyone using AS1115 I2C 7-seg/matrix driver?

Hi all,

Has anyone successfully used AS1115 driver with arduino?

I am trying to upgrade my SAA1064-based 7-seg LED clock with few more digits and have it run off 3.3 V, and AS 1115 seems like a perfect solution, but I can't get the display segments to show anything. It is just 7 7-seg common-cathode digits connected directly to the driver chip, which is run off Arduino Mega 2560 through I2C.

I am using GitHub - sarahemm/arduino-as1115: Arduino library to control the austriamicrosystems AS1115 LED driver. library. The example counter code is showing output in the serial window, but the display remains off.

I2C scanner does show the device at address 0x00, but starts hanging at "Scanning..." if I add:

#include <AS1115.h>
...
AS1115 disp = AS1115(0x00);
...
disp.begin().

The I2C Scanner keeps hanging until I comment out the disp.begin(), and power-cycle the AS1115...

Z.

Hi Zoran,

I have not used as1115 but I have used saa1064 & max7219.

Can you post a schematic, a well-focussed close-up picture and that test code?

Do you have a resistor (~10K) on the Iset pin?.

Have you tried 4K7 pull-up resistors on the SCL & SDA lines?

Paul

Just a 7-seg common-cathode display, connected directly to the AS1115. Yes, there is 13k Rset resistor, and 3k3 pull-up on both SCL and SDA.

First thing: I wrote quick library-less test code, and my display WORKS :slight_smile: Here is my test code if anyone needs it:

#include <Wire.h>

byte digit, counter;

void setup() {
  Wire.begin();
  Serial.begin(9600);

  // AS1115 is in shutdown on power-up. Wake up & reset feature register.
  Serial.println("Initializing AS1115...");
  I2CWrite(0x00, 0x0C, 0x01);

  // Default global intensity is minimal. Set to 50 %.
  Serial.println("Setting global intensity...");
  I2CWrite(0x00, 0x0A, 0x80);

  // Set scan limit to display all digits.
  Serial.println("Setting scan limits...");
  I2CWrite(0x00, 0x0B, 0x07);

  // Set all digits to "no decode".
  Serial.println("Setting decoding...");
  I2CWrite(0x00, 0x09, 0x00);

  Serial.println("Writing to display...");
  for(digit=0; digit<=7; digit++) {
    I2CWrite(0x00, digit+1, 0xFF);   // turn all segments ON
  }

  Serial.println("Done.");

  delay(3000);
  // Set all digits to font decode.
  Serial.println("Setting decoding...");
  I2CWrite(0x00, 0x09, 0xFF);
}

void I2CWrite(byte deviceAddr, byte cmd, byte data) {
  Wire.beginTransmission(deviceAddr);
  Wire.write(cmd);
  Wire.write(data);
  Wire.endTransmission();
}

void loop() {
  Serial.print("Displaying ");
  for (counter=0; counter<=0x10; counter++) {
    for (digit=0; digit<=7; digit++) {
      I2CWrite(0x00, digit+1, counter);
      Serial.print(counter, HEX);
    }
    Serial.println("");
    delay(500);
  }
}

Now, there seem to be an issue with the example that is coming with the AS1115 library. I can't see at the moment where is the problem coming from, but the library example at first does not work (it works, giving output in the Serial Monitor, but nothing on the display). However, if you load my library-less code above (and with that display works just fine), and THEN load the example that comes with the library, the example works. Funny, heh?

Does the example code still work if you power-off between running your code and the example code?

Sounds like the example code is missing a step when it initialises tthe '1115 that your code is doing.

For me it also demonstrates that sometimes libraries add very little value! With some carefully chosen constant names, would your code be any less readable or more complex than if it used that library? Sometimes all libraries do is perpetuate the myth that you have to have a library to use each bit of new hardware.

Zoran - did you figure this out? I'm designing around an AS1117 and am hoping to use the AS1115 library. Reviewing the datasheets it looks like it should work, but I don't want to be debugging an issue I think is related to using the AS1115 library with an AS1117 when in reality it's an issue even driving an AS1115 :o Thanks!

Sorry, I did not look up this thread for a while... Yes, I am successfully using the AS1115, but I do it with no library :slight_smile: ; for my needs, there is no need, it just makes my setup routine a bit longer, as it has to do several steps. A well-written library would certainly make the code more readable, but as always, commenting inline greatly helps reading through cryptic init steps. I am using 3 displays, each with its own AS1115, and it works great.

Let me see if I can post here two examples, one using one AS1115 at default address, and the other, using 3 AS1115 on the same I2C bus.

AS1115 are a great option since they happily run on anything between 2.7 - 5.5 V, so you can use them directly on all Arduinos - Tiny, Mega, XMega, ARM..., as opposed to SAA1064, which do not run under 5 V.

Thanks for the update @Zigmund.

Did you manage to find as1115 in dip package? Where from?

Does it really default to i2c address 0x00? I didn't think that was a valid address. Or is 0x00 a "broadcast" address, which would work ok with only one device on the bus?

AS1115 not even offered in a DIP package
http://ams.com/eng/content/download/18430/343782
You'll have to mount it on a DIP adapter.

CrossRoads:
You'll have to mount it on a DIP adapter.

Could you make a few $ selling those ready-soldered, Bob? I'd buy a few and be your UK distributor for them...