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

I2C LCD not working


  • Please log in to reply
8 replies to this topic

#1 pavgud

pavgud

    New Member

  • Members
  • Pip
  • 4 posts

Posted 07 May 2011 - 10:51 AM

I have problem making this I2C LCD (http://www.dfrobot.c...&product_id=135) to work with netduino. I attached two photos to show the wiring. I use the following code:
            I2CDevice lcd = new I2CDevice(new I2CDevice.Configuration(0x27, 400));

            int bytesTransferred = 0;
            string hellow = "hellow";

            System.Text.UTF8Encoding encoder = new System.Text.UTF8Encoding();
            byte[] bytesToSend = encoder.GetBytes(hellow);


                I2CDevice.I2CTransaction[] writeCommandAction = new I2CDevice.I2CTransaction[]      {I2CDevice.CreateWriteTransaction(bytesToSend) };
                bytesTransferred = lcd.Execute(writeCommandAction, 1000);

                Debug.Print("TRANSF> " + bytesTransferred.ToString());
                Debug.Print("TOSEND> " + bytesToSend.Length.ToString());

            }

I tried this code (http://code.tinyclr....lcd1602-module/) as well but without success.

When I connect USB to netduino, display light powers on and the first line can be seen (Powered.jpg). Beyond that nothing happens.

Attached Files



#2 Nevyn

Nevyn

    Advanced Member

  • Members
  • PipPipPip
  • 1072 posts
  • LocationNorth Yorkshire, UK

Posted 07 May 2011 - 11:24 AM

When I connect USB to netduino, display light powers on and the first line can be seen (Powered.jpg). Beyond that nothing happens.


Does the device need you to put pull-up resistors on the I2C bus?

Regards,
Mark

To be or not to be = 0xFF

 

Blogging about Netduino, .NET, STM8S and STM32 and generally waffling on about life

Follow @nevynuk on Twitter


#3 anthrolume

anthrolume

    Member

  • Members
  • PipPip
  • 15 posts

Posted 07 May 2011 - 03:56 PM

I think Nevyn is right. Try a setup like this. This example is using 820-ohm pullups, but you could try 2.2K too.

-Bryan

Posted Image

#4 nrc

nrc

    Member

  • Members
  • PipPip
  • 11 posts

Posted 07 May 2011 - 08:07 PM

Yes, pull up resistors needed. try 2k2 You can see my LCD I2C project http://forums.netdui...d-adm1602k-i2c/

#5 aalmada

aalmada

    Advanced Member

  • Members
  • PipPipPip
  • 44 posts
  • LocationPortugal

Posted 07 May 2011 - 10:58 PM

A novice question... I noticed you are all connecting the pull-up resistors to 5V. Pins 4 and 5 are only 3.3V. Isn't it an issue? aalmada

#6 Nevyn

Nevyn

    Advanced Member

  • Members
  • PipPipPip
  • 1072 posts
  • LocationNorth Yorkshire, UK

Posted 08 May 2011 - 05:32 AM

When I connect USB to netduino, display light powers on and the first line can be seen (Powered.jpg). Beyond that nothing happens.


And my memory triggered by reading this forum post - try adjusting the contrast - I remember that was my problem a few months ago when I was playing with and LCD.

Regards
Mark

To be or not to be = 0xFF

 

Blogging about Netduino, .NET, STM8S and STM32 and generally waffling on about life

Follow @nevynuk on Twitter


#7 pavgud

pavgud

    New Member

  • Members
  • Pip
  • 4 posts

Posted 14 May 2011 - 04:49 PM

Hi guys, I just bought my first breadboard ever. Some resistors and LEDs as well :) LCD lives thanx to you. I use 4k7 resistors and wiring like anthrolume recommended. Thnx all.

#8 anthrolume

anthrolume

    Member

  • Members
  • PipPip
  • 15 posts

Posted 16 May 2011 - 05:18 AM

I just bought my first breadboard ever. Some resistors and LEDs as well :)

LCD lives thanx to you. I use 4k7 resistors and wiring like anthrolume recommended.


Great news! Way to go pavgud!

-Bryan
(anthrolume)

#9 pher

pher

    New Member

  • Members
  • Pip
  • 2 posts

Posted 03 July 2013 - 08:03 AM

Can you make screenshots and share your example solution please? I try the same, but it doesn't work :(






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.