Go Down

Topic: How to use this PCF8574 board from "emall-4u" (Read 3593 times) previous topic - next topic

bperrybap


So i traced all the pins. Seems the thread starter has the right combination for my setup aswell. Now what?

Edit: I2C-detec finds an adress att 0x20 aswell...


So you are saying you have traced all the connections from PCF8574 pins to the LCD?
Can you list each of the pin numbers on the PCF8574 that connect to the LCD and then
which LCD pins they connect to?

What about the backlight? How is it wired up?
Is there a transistor? If a transistor what type, NPN or PNP and how is
is wired up to the LCD?
What does the backlight jumper do?

If it is the same as TomKi's board, then
use the newer constructor that TomKi provided that includes the backlight bit and the backlight polarity.
Then initialize it using:

Code: [Select]
lcd.begin (20,4);  // initialize the lcd
You shouldn't use lcd.setBacklightPin() that is a legacy api function.
The constructor now contains all the needed information.

Then it should work.
If the board supports backlight control you can try turning on/off the backlight using
lcd.backlight() and lcd.noBacklight()

That should do it.
If not, then there might be a i2c communication issue.
Do you have pullups on the i2c signals?

--- bill

puttelino



So i traced all the pins. Seems the thread starter has the right combination for my setup aswell. Now what?

Edit: I2C-detec finds an adress att 0x20 aswell...


So you are saying you have traced all the connections from PCF8574 pins to the LCD?
Can you list each of the pin numbers on the PCF8574 that connect to the LCD and then
which LCD pins they connect to?

What about the backlight? How is it wired up?
Is there a transistor? If a transistor what type, NPN or PNP and how is
is wired up to the LCD?
What does the backlight jumper do?

If it is the same as TomKi's board, then
use the newer constructor that TomKi provided that includes the backlight bit and the backlight polarity.
Then initialize it using:

Code: [Select]
lcd.begin (20,4);  // initialize the lcd
You shouldn't use lcd.setBacklightPin() that is a legacy api function.
The constructor now contains all the needed information.

Then it should work.
If the board supports backlight control you can try turning on/off the backlight using
lcd.backlight() and lcd.noBacklight()

That should do it.
If not, then there might be a i2c communication issue.
Do you have pullups on the i2c signals?

--- bill



I traced the pins to *(Pin on the chip)

BACKLIGHT_PIN     3 (7)*
En_pin   2  (6)
Rw_pin  1  (5)
Rs_pin   0  (4) 
D4_pin   4  (9)
D5_pin   5  (10)
D6_pin   6  (11)
D7_pin   7  (12)

This code makes the backligt turn on and off still get blobs though...

Code: [Select]
#include <Wire.h>
#include <LCD.h>
#include <LiquidCrystal_I2C.h>

#define I2C_ADDR    0x20  // Define I2C Address where the PCF8574A is
#define BACKLIGHT_PIN     3
#define En_pin  2
#define Rw_pin  1
#define Rs_pin  0
#define D4_pin  4
#define D5_pin  5
#define D6_pin  6
#define D7_pin  7

int n = 1;

LiquidCrystal_I2C lcd(I2C_ADDR,En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin);

void setup()
{

  lcd.begin (20,4);
  // Switch on the backlight
  lcd.setBacklightPin(BACKLIGHT_PIN,POSITIVE);
  lcd.setBacklight(HIGH);
  lcd.home ();                   // go home

  lcd.print("SainSmart I2C test"); 
  lcd.setCursor ( 0, 1 );        // go to the next line
  lcd.print("F Malpartida library");
 
 

 
}

void loop()
{
 
    delay(1000);
    lcd.setBacklight(HIGH);
      delay(1000);
    lcd.setBacklight(HIGH);
}


Removing the baklight jumper kills the baklight. Seems the connect to VCC.

I have been using Malpartidas lib all along (v1.2.1). I have pullups (4k6)

bperrybap

puttelino,
start a new thread.
This has become a thread hijack.
The original thread was a simple "Hey, here is how to use this i2c lcd backpack".
It has now drifted into working through some sort of software/wiring/hardware issues.
I recommend that you start a new thread
and post photos of your board and show the current code you are running
so we can then proceed helping you bring up your board.


--- bill

Go Up