I2C LCD not working with Digispark Attiny85

Hello,
I am trying to get my Digispark Attiny85 working with a I2C LCD. This is my code I am using for testing:

#include <Wire.h> 
#include <LiquidCrystal_I2C.h> 
LiquidCrystal_I2C lcd(0x27, 16, 2);

void setup() 
{
  lcd.init(); 
  lcd.backlight();
  lcd.clear(); 
  lcd.setCursor(0, 0);
  lcd.print("Test"); 
}

void loop() 
{ 
} 

But only the backlight turns on which isn't really bright either as you can see on the photo:

I already tried changing the contrast on the I2C but nothing changed. For connection I used this diagram:

this librarys does not support ATTyny85

Which library do you mean and which library should I use instead?

both of them

Okay, I now looked specifically for libraries that work with the Attiny85 and this is my new test code now:

#include <TinyWireM.h>
#include <LiquidCrystal_attiny.h> 

LiquidCrystal_I2C lcd(0x27, 16, 2);

void setup() {
 lcd.init();
 lcd.backlight();
 lcd.clear();
 lcd.setCursor(0, 0);
 lcd.print("Test");
}

void loop() {
}

and what are your results with that code?

Have you confirmed that the display works with anything else?

Do you need pullups?

Oh sorry, it still isn't working with the sketch. I tried the same sketch (using other libraries) on my arduino uno and it works/ the lcd shows text.

so what about the pullups?

@awneil I didn't know about pullups so I had to research it. After putting the resistors on there it still didn't work. After a while we figured out that it was because the Digispark is somehow not giving enough power for the lcd, because if I connect SDA/SCL to the Digispark and GND/VCC to Arduino which is also connected it works. So it has something to do with the power from the Digispark but I don't know what it could be or why it hasn't enough for the LCD. As you can see in the photo the lcd works when taking power from the arduino and the power from the Digispark is enough to lighten up this diode but not more

Digispark ATtiny85 manufacturer's page: http://digistump.com/products/1
I found the schematic here.

The USB has a wire labelled "5V", but that is not the same as the other "5V" wires. That is a mistake in the schematic. The diode between "5V" and "5V" is in reverse. That is another mistake in the schematic.

Maybe your Digispark is made according to the schematic with the diode in reverse :rofl:

There are two main cores for the ATtiny85 in Arduino-compatible mode: the small "attiny" and the full featured "ATTinyCore".
Yet, the Digispark uses the Micronucleus.
According to this tutorial you can use the TinyWireM library.

In that tutorial they say: "CAUTION We are not at this point supporting upgrading the firmware, so if you decide to, you do so entirely at your own risk".
When I translate that, then I read: "Hey, we used old software and are too lazy to keep it updated, and now users are mad at us because we don't care".

Conclusion: Buy an Arduino board, or a common Arduino-compatible board that has support. My advice is to throw this board away :wastebasket:

2 Likes

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.