Go Down

Topic: LCD backpack and 16x2 I2C not responding  (Read 166 times) previous topic - next topic

ElHefe

Mar 22, 2016, 07:03 am Last Edit: Mar 22, 2016, 07:16 am by ElHefe
I have a DX LCD1602 Adapter Board w/I2C Interface backpack and standard green Hitachi 16x2 LCD. The back-light fires up and i get the black squares but that is it. To make sure I am outputting data, i am printing "hello world" to the serial monitor as well and it is ok.

I2C backpack: http://www.dx.com/p/lcd1602-adapter-board-w-iic-i2c-interface-black-works-with-official-arduino-boards-216865#reviews

Wiring:

CLK is A4
DAT is A5

The data from DX website shows Device address: 0x27 but i2c_scanner (http://playground.arduino.cc/Main/I2cScanner) scanner shows address is 0x3F.

Any further troubleshooting techniques i can use to find our why she is not responding? I must have an addressing problem. The back light (always on) is supposed to toggle on and off.

Code:

Code: [Select]
#include <Adafruit_LiquidCrystal.h>

/*
  Demonstration sketch for Adafruit i2c/SPI LCD backpack
  using MCP23008 I2C expander
  ( http://www.ladyada.net/products/i2cspilcdbackpack/index.html )

  This sketch prints "Hello World!" to the LCD
  and shows the time.

  The circuit:
   5V to Arduino 5V pin
   GND to Arduino GND pin
   CLK to Analog #5
   DAT to Analog #4
*/

// include the library code:
#include "Wire.h"
#include <Adafruit_LiquidCrystal.h>

// Connect via i2c, default address #0 (A0-A2 not jumpered)
Adafruit_LiquidCrystal lcd(0);


void setup() {
    lcd.setBacklight(LOW);

  lcd.begin(16, 2);
  lcd.print("hello, world!");
  Serial.begin(9600);
}

void loop() {
  // set the cursor to column 0, line 1
  // (note: line 1 is the second row, since counting begins with 0):
  lcd.setCursor(0, 1);
  // print the number of seconds since reset:
  lcd.print(millis() / 1000);
  Serial.print ("hello, world!");

  lcd.setBacklight(HIGH);
  delay(500);
  lcd.setBacklight(LOW);
  delay(500);
}

Paul__B

#1
Mar 22, 2016, 11:47 am Last Edit: Mar 22, 2016, 11:47 am by Paul__B
I'm going to let this one go through to the keeper but you could try reading as many other discussions here which refer to "1602" as you can.

floresta

#2
Mar 22, 2016, 01:51 pm Last Edit: Mar 22, 2016, 01:54 pm by floresta
Here's a clue.

You are trying to use code written for an I2C adapter that uses an MCP23008 I2C expander chip.

You are using an I2C adapter that actually has a PCF8574A expander chip which is an entirely different device.

The address discrepancy between 0x27 and 0x3F is due to the fact that your adapter can also use a PCF8574 expander chip (no 'A' suffix) which is the same except for it's address range.  Stick with the address determined by the scanner.

Don

ElHefe

Thanks floresta, I got it working I think but i had to run to work. Just as i was loading the code, the backlight flashed twice! Yeah! I had to delete my LCD lib and reload "Improved LCD Lib" from one of the previous posts and change the hex address to 3F as indicated by the scanner. Thanks for the part number on the expander. That explained a few things.

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy