HD44780 (20x4) and I2C PCF8574 - Netduino Plus 2 (and Netduino Plus 1) - Netduino Forums
   
Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

HD44780 (20x4) and I2C PCF8574


  • Please log in to reply
12 replies to this topic

#1 alesbedac

alesbedac

    Advanced Member

  • Members
  • PipPipPip
  • 63 posts

Posted 24 November 2013 - 12:01 PM

Hi,

 

i am sorry, on this forum is more posts with this problem, but i didnt get an answer long time from this posts, thats why i create new one. I tried more examples more wiring and my : HD44780 (20x4) wich is connected thrue the I2C (PCF8574) to the Netduino Plus 2 Is not still working.

 

Parts descriptions : 

I2C : http://www.ebay.com/...=item1c394468f9

 

HD44780 :  http://www.ebay.com/...=item2578300d40

 

I Have wired it so : 

              I2C pin         ND2+ pin

            SCL             SC

            SDA             SD

            GND             GND

            VCC             3.3V

Is it correct ?

 

In one example was working backlight..so the address and output is ok I think..

I have 2x LCD (each has own I2C).

 

Is there anybody who can help me. I spend lot of time on this problem without any sollution.

 

 

 

 

 

 

 

 

 

 

 



#2 Stanislav Husár

Stanislav Husár

    Advanced Member

  • Members
  • PipPipPip
  • 99 posts

Posted 24 November 2013 - 01:34 PM

Hi,

 

1) Are you using correct I2C address of PCF8574 ?

2)Did you connect each of three address pins on PCF8574?



#3 alesbedac

alesbedac

    Advanced Member

  • Members
  • PipPipPip
  • 63 posts

Posted 24 November 2013 - 03:03 PM

Hi,

 

1) Are you using correct I2C address of PCF8574 ?

2)Did you connect each of three address pins on PCF8574?

Hi,

 

1) Yes because backlight is working. A1-A3 (are without connection), so my address is 0x027
2)  I have created example program to send byte to [color=rgb(40,40,40);font-family:helvetica, arial, sans-serif;]PCF8574 (for testing if the PCF is not dead)...its working too...[/color]

 



#4 Stanislav Husár

Stanislav Husár

    Advanced Member

  • Members
  • PipPipPip
  • 99 posts

Posted 24 November 2013 - 03:46 PM

Hi,

 

What did you connect to PCF8574 during testing? As far, as I know, no error when you send a byte to PCF8574 is not a proof. Try connecting LEDs to outputs of PCF8574 and blinking them. If not working, try putting pull-up resistor on SDA and SCL lines, and/or connecting address lines to GND or VCC, don´t leave them floating.



#5 alesbedac

alesbedac

    Advanced Member

  • Members
  • PipPipPip
  • 63 posts

Posted 25 November 2013 - 09:58 AM

Hi,

 

What did you connect to PCF8574 during testing? As far, as I know, no error when you send a byte to PCF8574 is not a proof. Try connecting LEDs to outputs of PCF8574 and blinking them. If not working, try putting pull-up resistor on SDA and SCL lines, and/or connecting address lines to GND or VCC, don´t leave them floating.

I Have sended bytes to PCF8574 and with  the Volmetr i checked the Ouput state with following steps (example) : send(0)

sleep(2000)

send(1)

sleep(2000)

 

it was changing during program flow...

 

 



#6 Stanislav Husár

Stanislav Husár

    Advanced Member

  • Members
  • PipPipPip
  • 99 posts

Posted 25 November 2013 - 11:29 AM

Hi,

 

Interesting. Are you sure your display is working correctly? Are you sure that you are sending correct commands to display?

 

Could you connect to display using another interface? SPI, UART,...



#7 alesbedac

alesbedac

    Advanced Member

  • Members
  • PipPipPip
  • 63 posts

Posted 25 November 2013 - 02:23 PM

Hi,

 

Interesting. Are you sure your display is working correctly? Are you sure that you are sending correct commands to display?

 

Could you connect to display using another interface? SPI, UART,...

Thats right,

 

i am not sure if : - that is display OK

- i am sending correct data

- is it correct wired



#8 Stanislav Husár

Stanislav Husár

    Advanced Member

  • Members
  • PipPipPip
  • 99 posts

Posted 25 November 2013 - 04:34 PM

Could you post here your code and wiring?

 

 

Edit: Sorry, I have forgot you have already posted your wiring....looks correct. Anyway, if you could post display datasheet, it may help.



#9 GonzaloG

GonzaloG

    New Member

  • Members
  • Pip
  • 8 posts

Posted 26 November 2013 - 11:03 PM

Have you wired 2k2 pull up resistors between SCL, SDA and 3V3?

SCL and SDA pins on Netduino Plus 2 are open drain, so you need pull up resistors.



#10 alesbedac

alesbedac

    Advanced Member

  • Members
  • PipPipPip
  • 63 posts

Posted 28 November 2013 - 10:29 AM

Could you post here your code and wiring?

 

 

Edit: Sorry, I have forgot you have already posted your wiring....looks correct. Anyway, if you could post display datasheet, it may help.

HI,

 

its not a problem, datasheet is : http://www.systronix..._brief_data.pdf

 

Thanks for a help



#11 alesbedac

alesbedac

    Advanced Member

  • Members
  • PipPipPip
  • 63 posts

Posted 30 November 2013 - 10:16 AM

HI,

 

i desolder I2C shiled from LCD and i tried the LCD alone - but its not working. Have you any 8bit or better 4bit working examples to test my LCDs ? Is possible that i have both LCD DEAD...so i have now order new

LCD from store it will arrive in 2-3 days..so i will see.

 

But i hope i will be able to run this LCD with I2C expander....

Perhaps i am doing something wrong, i used exmaples from forum, but is not working, has anybody workign example for LCD 20x4..

 

thanks



#12 GonzaloG

GonzaloG

    New Member

  • Members
  • Pip
  • 8 posts

Posted 03 December 2013 - 12:33 AM

This is my working example of how to read date and time from a DS1307 using I2C.

Don't forget to wire your 2k2 pull-up resistors from both SDA and SCL lines to 3v3 power line.

Hope you find this code inspiring and solve your LCD issue.

http://datasheets.ma...n/ds/DS1307.pdf

using System;using System.Net;using System.Net.Sockets;using System.Threading;using Microsoft.SPOT;using Microsoft.SPOT.Hardware;using SecretLabs.NETMF.Hardware;using SecretLabs.NETMF.Hardware.NetduinoPlus;namespace i2c_ds1307{    public class Program    {        public static void Main()        {            // Device address 1101000 = 0x68            // Bus speed = 100 kbps (standard mode)            I2CDevice.Configuration ds1307_cfg = new I2CDevice.Configuration(0x68, 100);            I2CDevice ds1307 = new I2CDevice(ds1307_cfg);            byte[] address = { 0 }; // i2c_write set register pointer to 0 to read from first position in ds1307 memory map            byte[] data = new byte[7]; // i2c_read buffer to receive 7 bytes            I2CDevice.I2CTransaction[] ds1307_actions;            ds1307_actions = new I2CDevice.I2CTransaction[]                {                    I2CDevice.CreateWriteTransaction(address),                    I2CDevice.CreateReadTransaction(data)                };            while (true)            {                int bytecount = ds1307.Execute(ds1307_actions, 10);                byte[] extracted = new byte[15];                byte[] extract_info =                 {                     0, 0x70, 4, //  0 SEC x 10                    0, 0x0F, 0, //  1 SEC                    1, 0x70, 4, //  2 MIN x 10                    1, 0x0F, 0, //  3 MIN                    2, 0x40, 6, //  4 12/24h                    2, 0x20, 5, //  5 AM/PM                    2, 0x30, 4, //  6 HOUR x 10                    2, 0x0F, 0, //  7 HOUR                    3, 0x07, 0, //  8 DAY                    4, 0x30, 4, //  9 DATE x 10                    4, 0x0F, 0, // 10 DATE                    5, 0x01, 4, // 11 MONTH x 10                    5, 0x0F, 0, // 12 MONTH                    6, 0xF0, 4, // 13 YEAR x 10                    6, 0x0F, 0, // 14 YEAR                };                for (int i = 0; i < extracted.Length; i++) extracted[i] = (byte)((data[extract_info[i * 3]] & extract_info[i * 3 + 1]) >> extract_info[i * 3 + 2]);                int[] composed = new int[6];                byte[] compose_info =                 {                    13, 14,                    11, 12,                    9, 10,                    6, 7,                    2, 3,                    0, 1                };                for (int i = 0; i < composed.Length; i++) composed[i] = (byte)(extracted[compose_info[i * 2]] * 10 + extracted[compose_info[i * 2 +1]]);                                DateTime time = new DateTime(2000+composed[0], composed[1], composed[2], composed[3], composed[4], composed[5]);                Debug.Print(time.ToString());                                Thread.Sleep(2000);                 }        }    }}


#13 alesbedac

alesbedac

    Advanced Member

  • Members
  • PipPipPip
  • 63 posts

Posted 06 December 2013 - 06:02 AM

Problem solved :

 

wasnt connected CONTRAST PIN

 

Thanks all for helps...






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.