Can some one tell me how to setup an ATiny85v to run a 20x4 LCD with an LCM1602 IIC V1 backpack?
I've downloaded and tried about 6 different Libraries. None seem to work.
SDA = Attiny85 pin 5 with pull up
SCL = Attiny85 pin 7 with pull up
VCC = pin 8
GND = pin4
One of the problems is I don't know the I2c address and I cant seem to run the scanner on the tiny. When I setup the display on a Nano or a DueMilenove the address is 0x27. the backpack is running a PCF8574T.
Do I have to set any fuses or anything special first?
I've been googling and reading this forum all day and nothing seems to work for me. Any suggestions?
Where did you get that board?
There are some Chinese ebay boards using the PCF8574T with the pins swapped and so you can’t use the original library for it.
I have one of this Chinese board and my address is 0x20.
Here is the library for the Chinese version.
Remember, you must remove from the libraries folder the older one and insert this new one.
Post results
ok the chinese library worked for my …milenove, but the char display acts as a 16x2 and not a 20x4 even is i try to print to the other char positions the 16x2 positions only print…
//YWROBOT
//Compatible with the Arduino IDE 1.0
//Library version:1.1
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,20,4); // set the LCD address to 0x27 for a 16 chars and 2 line display
void setup()
{
lcd.init(); // initialize the lcd
lcd.init();
// Print a message to the LCD.
lcd.backlight();
lcd.setCursor(3,0);
lcd.print("Hello, world!");
lcd.setCursor(2,1);
lcd.print("Ywrobot Arduino!");
lcd.setCursor(0,2);
lcd.print("Arduino LCM IIC 2004");
lcd.setCursor(2,3);
lcd.print("Power By Ec-yuan!");
}
void loop()
{
}
Thats very wierd since I have a chinese board like your and a LCD 20x4 and I'm sure it displays all the characters correctly.
When I get home I will try your code with mine to double check that.
Looking to your code I just have one thing to ask
Why are you initializing the lcd two times?
Did you use external pullup resistors? The internal are too weak on the ATtiny. Some I2C LCD adapter modules do not have them at all and require external.
kowalski:
Did you use external pullup resistors? The internal are too weak on the ATtiny. Some I2C LCD adapter modules do not have them at all and require external.
First of all I need to explain that Cosa is an object-oriented platform for Arduino with over 100+ classes. It is an Arduino core but supports all AVR processor based boards plus ATtiny and Mighty. It is also stand-alone and does not depend on any Arduino code more than the IDE build process.
The simplest example sketch is the LCD hello world that I use for footprint benchmarking.
You can basically develop on Mega, Uno, etc, and simply select ATtiny85 and compile-and-burn with more libraries than in any other Arduino package. SPI, TWI, 1-Wire etc are all support. LCD support is an abstract class that is implemented for HD44780, PCD8544, ST7565. The HD44780 driver also has an adapter layer for 4-bit parallel, Shift Register 3-wire (Pin or SPI), Shift Register 4-wire and a whole range of different I2C adapters. You can see how the configuration works in the CosaLCDsize sketch above.
Guys, I got my new 20x4 LCD working on the attiny85 (see attachment). I first had to burn the bootloader to the chip and use the 1Mhz core, Then used the example code from this Library (changed my address after using the i2c_scanner and my row count):
Hi, this is exactly what i am trying to do even as we speak. I looked in the library folder and couldn't see any examples of code to make this work. Would you have a circuit diagram and some example code, i'm guessing this would also work on a 16x2 display. Totally newbie here so any information would be greatly received, thanks.
There is also the possibility to use parallel in 4 bit mode but you need a chip with 20 pins in order to have some free pins to do stuff with (attiny x61).