control an 16x2 LCD with an attiny 84 and PCF8574T

Hello everybody,

I wan´t control an 16x2 LCD with an attiny 84 and PCF8574T.

I have tried many of CrystalLCD-libaries and wire libaries (tinyWireM, tinyWireS), but it don't works.

The only helpful page:

http://lechacal.com/wiki/index.php/Use_a_LCD_i2c_with_attiny84

But i can't find the TinyWireM from "scenelight" to finish the instruction.

I hope somebody can help me or tell me the right way!?

BR
Roman

Which ATTINY core have you loaded into the Arduino IDE to program the ATTINY84 ?
Are you using a ready built I2C backpack for your display or have made you own with this PCF8574T port extender ? If it is your own, have you a schematic ?
Look here for lots of Arduino ATTINY support including wire/I2C: https://github.com/SpenceKonde

It should work with TinyWireM. I may have done this in the past, I can't remember. What happens if you use the usual TinyWireM library?

TinyWireS is not appropriate. You need the tiny to be the master, not the slave.

6v6gt:
Which ATTINY core have you loaded into the Arduino IDE to program the ATTINY84 ?
Are you using a ready built I2C backpack for your display or have made you own with this PCF8574T port extender ? If it is your own, have you a schematic ?
Look here for lots of Arduino ATTINY support including wire/I2C: SpenceKonde (Spence Konde (aka Dr. Azzy)) · GitHub

I use the Attiny Core from SpenceKonde:
GitHub - SpenceKonde/ATTinyCore: Arduino core for ATtiny 1634, 828, x313, x4, x41, x5, x61, x7 and x8 => The Attiny works

And now i have imported the TinyWireM and the LiquidCrystal_I2C_Tiny libary from SpenceKonde and it doesn`t work.

I use only the PCF8574T. The LCD works with Arduino and the PCF8574T, but not with the Attiny 84.

After i open an examplesketch from the LiquidCrystal_I2C_Tiny to test the function => i have a compile-error. When i errase the <SoftI2CMaster.h> -libary (<LiquidCrystal_I2C_Tiny.h> -libary was included), it compiles, but the LCD doens't work.



What about I2C pull up resistors ? Say 4.7K each.

The LCD works with Arduino and the PCF8574T, but not with the Attiny 84.

Have you tried attaching 4K7 pull-ups to sda & scl? The Uno uses its internal pull-ups. Don't know if the tiny does that...
Edit: sorry, 6v6gt !

Reiter:
I use the Attiny Core from SpenceKonde:
https://github.com/SpenceKonde/ATTinyCore => The Attiny works

And now i have imported the TinyWireM and the LiquidCrystal_I2C_Tiny libary from SpenceKonde and it doesn`t work.

I use only the PCF8574T. The LCD works with Arduino and the PCF8574T, but not with the Attiny 84.

After i open an examplesketch from the LiquidCrystal_I2C_Tiny to test the function => i have a compile-error. When i errase the <SoftI2CMaster.h> -libary (<LiquidCrystal_I2C_Tiny.h> -libary was included), it compiles, but the LCD doens't work.

Please do not post screen shots of code. Use the proper code tags when posting.

You need to post the code and a diagram of the circuit.

PaulRB:
. . .
Edit: sorry, 6v6gt !

Great minds think alike. Just some are a little quicker at typing than others!

6v6gt:
What about I2C pull up resistors ? Say 4.7K each.

I puted two 2k2 resistors between the SDA-Pin(PCF8574T-Pin15) and 5V AND two 2k2 resistors between the SCL-Pin(PCF8574T-Pin14) and 5V. => It doesn't work!!

I have imported the libary correct, but i noticed that the font of the LiquidCrystal_I2C Tiny library(#include <LiquidCrystal_I2C Tiny.h>)is not orange.


You have been asked to stop doing that. If you don't want our help, please let us know.

The 2K2 resistors: your description is confusing. Two on sda and two on scl? In series of parallel?

This is how I use an I2C LCD display on an ATTINY84 :

// SCL  pin D4  (physical pin 9 on attiny84)
// SDA  pin D6  (physical pin 7 on attiny84)

#    include <TinyWireM.h>                 // adafruit
#    include <LiquidCrystal_I2C_Tiny.h>    // Dr Azzy
     LiquidCrystal_I2C lcd(0x27, 16, 2);
#    include "SoftwareSerial.h"
     SoftwareSerial swSerial( 3 , 2 );   // (RX, TX)     (clockwise pin mappings)

// in setup() . . . 

    TinyWireM.begin() ;
    delay(1000) ;
    lcd.begin();

If you have no success, try an I2C scanner to verify the address you are using.
I guess you are aware that there is a compiler option to invert the pin mappings between the attiny84 and the arduino digital pins and you have chosen the correct one for your configuration.

6v6gt:
This is how I use an I2C LCD display on an ATTINY84 :

// SCL  pin D4  (physical pin 9 on attiny84)

// SDA  pin D6  (physical pin 7 on attiny84)

#    include <TinyWireM.h>                // adafruit
#    include <LiquidCrystal_I2C_Tiny.h>    // Dr Azzy
    LiquidCrystal_I2C lcd(0x27, 16, 2);
#    include "SoftwareSerial.h"
    SoftwareSerial swSerial( 3 , 2 );  // (RX, TX)    (clockwise pin mappings)

// in setup() . . .

TinyWireM.begin() ;
    delay(1000) ;
    lcd.begin();




If you have no success, try an I2C scanner to verify the address you are using.
I guess you are aware that there is a compiler option to invert the pin mappings between the attiny84 and the arduino digital pins and you have chosen the correct one for your configuration.

I know the address from the PCF8574T => 0x20, it works with an Arduino or do you mean an other address?

I think you have an other libary likeSoftware Serial.

Reiter:
I know the address from the PCF8574T => 0x20, it works with an Arduino or do you mean an other address?

I think you have an other libary likeSoftware Serial.

Well, it could help to localize the problem if you try an I2C scanner. If the display can't be detected, you have to solve that problem first before looking in detail at the rest of your application or circuit.
Yes, I have used softwareSerial but that is irrelevant to troubleshooting your problem. It does not conflict in any way with I2C.
Have you altered the setting of the contrast potentiometer since trying all this on the Uno? The setting is very sensitive to voltage changes.