Jump to content
meanpc

i2c LCD

Recommended Posts

Have an arduino lib that I have started converting for Launchpad, but thought I maybe expending effort as it had been done already.

Seems not, so will spend a bit more time and do the conversion.

Share this post


Link to post
Share on other sites

Have an arduino lib that I have started converting for Launchpad, but thought I maybe expending effort as it had been done already.

Seems not, so will spend a bit more time and do the conversion.

 Have you had any luck? I am a new to MPS430 and micro controllers in general. I am trying to get a YwRobot 16X2 to work with my launch pad. I get the same error mentioned in a earlier post "conflicting return type specified for 'virtual void LiquidCrystal_I2C::write(uint8_t)'" I understand this because the libary is for and older Arduino IDE.  any help would be nice Thanks

Share this post


Link to post
Share on other sites

Yosh,

Am using a I2C to LCD port convertor (uses a PCF8574 chip) that is soldered to the 16 pins on a 1602 LCD. 

Am sure others have used this setup as one can buy the two components.

http://www.aliexpress.com/item/5pcs-lot-1602-2004-LCD-Adapter-Plate-IIC-I2C-Interface-Free-Shipping-Dropshipping/1122976396.html

and

http://www.aliexpress.com/item/IIC-I2C-1602-Serial-Blue-Backlight-LCD-Display-For-Arduino-2560-UNO-AVR-A004-Free-Shipping/690912591.html

 

All I need is a Energia library to drive this system.

Grant

 

Most of those screens and attached controllers are designed for Arduino, with 5V.

 

The LaunchPads operate at 3.3V. 

 

You need to insert a logic level converter to ensure signals are high enough for the screen and low enough for the MCU

Share this post


Link to post
Share on other sites

Roger,
Fixed my problem by adding a Wire,write() 
 
e.g. 
 .......
   Wire.beginTransmission(address);
   Wire.write(1);  ///////////////////////////////////// sketch works ok when this line added
   error = Wire.endTransmission();

.........

 

Have a look at my other post for details

http://forum.43oh.com/topic/5473-i2c-scanner-for-2553-5529/

 

And as Rio suggested I used two 2N7000 fets and a few resistor for the 3v3 to 5V interface.

Grant

Share this post


Link to post
Share on other sites

Hi abecedarian,

 

can you upload your source code of library??

 

I have the same error:

 

C:\Users\...\Energia\libraries\LiquidCrystal_I2C_Prueba/LiquidCrystal_I2C.h:80:16: error: conflicting return type specified for 'virtual void LiquidCrystal_I2C::write(uint8_t)'
C:\energia-0101E0012\hardware\msp430\cores\msp430/Print.h:55:20: error:   overriding 'virtual size_t Print::write(uint8_t)'

 

Thanks!!

Share this post


Link to post
Share on other sites

I recently bought a 20x4 LCD with I2C backpack and got it working. I've posted a working library (taken from DFRobot.com) and an example. While I've only used it with the 20x4 LCD it should also work with a 16x2. It has been tested on the MSP430F5529, MSP432P401R, and CC3200. These LCDs need 5V to work and you will need bi-directional logic level conversion. I've posted two circuits that work - one using two BS170 MOSFETs and another with a converter module I bought from Addicore. You can find it here on github.

 

EDIT: I recently tried this library with a 16 x 2 LCD and it works with that also. You will need to change the variables that hold screen size where indicated in the example.

Share this post


Link to post
Share on other sites

I succeed  interfacing a 16x2 LCD with a 430G2553 trough a PCF8574A port expansor as I2C/parallel  converter using the DFRobot.com library posted by Fmilburn, after solving the Energia 18 known issue with the 2553 I2C pin association described here

To do this, it iwas necessary to copy the files twi.c and twi_sw.c  in the folder hardware/msp430/cores/msp430 in the Energia installation and, in addition to that, to edit the .cpp file in the library to add the line "Wire.setModule(0);" just before "Wire.begin(0);".

Two additional comments that could be usefull for those that could want to use the same configuration:

1) Pay attention to the chip used in the I2C backpack: Most of the code examples use the address 0x20, that is the default for the to PCF8574 (unless you had been playing with the A0, A1 and A2 pins) but today it is pretty usual to find the version PCF8574A where the default address is 0x38.

2) Most LCDs work with 5V, but the PCF8574 works fine with any voltage in the range 2.5 - 6 V. So, you have two alternatives to wire the LCD to the 2553 without using the space-consuming level converters:

- Connect the backpack to 3.3 V using an additional wire to feed the LCD with 5V, or

- Connect the LCD and the backpack to 5V, but removing the pull up resistors from the SCA and SCL lines on the backpack board and placing them on the pins 14 and 15 of the G2553 (to 3.3V, obviously).

BTW, you should also consider this last solution if you plan to connect more than one display (or other devices) to the I2C bus, to avoid the parallel of the individual pull up resistors.

JLV

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×