LiquidTWI: High-performance LCD library for I2C Backpack Module
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
-
- Posts: 8
- Joined: Thu May 05, 2011 2:35 pm
Re: LiquidTWI: High-performance LCD library for I2C Backpack Module
Anybody get this to work with Arduino 1.0RC2? I guess its still the Wprogram.h to Arduino.h issue
-
- Posts: 12151
- Joined: Thu Apr 06, 2006 4:21 pm
Re: LiquidTWI: High-performance LCD library for I2C Backpack Module
theres a few changes that we have to do to make it compatible with 1.0 - please be patient while we go thru our 25 libraries to adapt them all
-
- Posts: 2
- Joined: Tue Dec 06, 2011 4:05 pm
Re: LiquidTWI: High-performance LCD library for I2C Backpack Module
Hi...
I built the i2c-spi-LCD-backpack tester on a scrap piece of protoboard following the schematic. Only things I didn't use were the SPI circuit, and the backlight dimming circuit. Other than that.. all connections verify.
Installed the LiquidCrystal library from GitHub, as well as your LiquidTWI library.
I had similar issues with the parallel connection and the LiquidCrystal library.. can't remember how I fixed it though, but it does work in parallel mode.
Other than a wiring issue that I can't see.. could it be the LCD conflicting with the library? I'm able to set the DIP switch and change the address.. but it still displays the weird looking characters.
Thanks in advance............
I built the i2c-spi-LCD-backpack tester on a scrap piece of protoboard following the schematic. Only things I didn't use were the SPI circuit, and the backlight dimming circuit. Other than that.. all connections verify.
Code: Select all
TC1604A-01 LCD:
01: GRND
02: VCC
03: CONTRAST TRIMPOT
04: RS
05: GRND (R/W)
06: E
07: - (DB0)
08: - (DB1)
09: - (DB2)
10: - (DB3)
11: DB4
12: DB5
13: DB6
14: DB7
15: LED VCC
16: LED GRND
MCP23008:
17: RS
16: E
15: DB4
14: DB5
13: DB6
12: DB7
11: LIGHT
Installed the LiquidCrystal library from GitHub, as well as your LiquidTWI library.
I had similar issues with the parallel connection and the LiquidCrystal library.. can't remember how I fixed it though, but it does work in parallel mode.
Other than a wiring issue that I can't see.. could it be the LCD conflicting with the library? I'm able to set the DIP switch and change the address.. but it still displays the weird looking characters.
Thanks in advance............
-
- Posts: 2
- Joined: Tue Dec 06, 2011 4:05 pm
Re: LiquidTWI: High-performance LCD library for I2C Backpack Module
Well.. thinking it's just my LCD having a conflict with the library. It uses the SPLC780D1 driver, but is "HD44780 compatible". Seeing as some have the exact same garbled text issues.. with a factory made version of the i2cspilcdbackpack.. I'm guessing it's more likely a conflict in controllers. Heck.. even using LiquidCrystal with the normal parallel connections has "issues".. rows 3 and 4 start at column 5.. unless specified to start at column "-4".
Will be getting a proper HD44780 LCD instead...
http://www.adafruit.com/products/198
Will be getting a proper HD44780 LCD instead...
http://www.adafruit.com/products/198
-
- Posts: 2
- Joined: Wed Dec 07, 2011 4:15 pm
Re: LiquidTWI: High-performance LCD library for I2C Backpack Module
Hi,
I've written an extendable LiquidCrystal compliant library that supports this type of device and thought I would share it with you chaps.
It is a derivate of the original LiquidCrystal Library as sourced in the Arduino SDK. It has been developed to be compatible with the current LiquidCrystal library, its performance is about 3.5 faster and fully extendable if need be. It supports most Hitachi HD44780 based LCDs, or compatible, connected to any project (currently supported) using: 4, 8 wire parallel interface, I2C IO port expander and Shift Regiter.
The LCD library is based on the I2CIO driver library for the PCF8574* I2C IO expander ASIC.
It has been tested with arduino SDK 1.0 (final, RC1, RC2) and 22/23.
By a simply extending the base class it should take more than a few minutes to port the SPI IO expander module too.
If you are interested you can find the project wiki here (https://bitbucket.org/fmalpartida/new-l ... /wiki/Home) and can be downloaded from here (https://bitbucket.org/fmalpartida/new-l ... /downloads).
Hope you find it useful.
I've written an extendable LiquidCrystal compliant library that supports this type of device and thought I would share it with you chaps.
It is a derivate of the original LiquidCrystal Library as sourced in the Arduino SDK. It has been developed to be compatible with the current LiquidCrystal library, its performance is about 3.5 faster and fully extendable if need be. It supports most Hitachi HD44780 based LCDs, or compatible, connected to any project (currently supported) using: 4, 8 wire parallel interface, I2C IO port expander and Shift Regiter.
The LCD library is based on the I2CIO driver library for the PCF8574* I2C IO expander ASIC.
It has been tested with arduino SDK 1.0 (final, RC1, RC2) and 22/23.
By a simply extending the base class it should take more than a few minutes to port the SPI IO expander module too.
If you are interested you can find the project wiki here (https://bitbucket.org/fmalpartida/new-l ... /wiki/Home) and can be downloaded from here (https://bitbucket.org/fmalpartida/new-l ... /downloads).
Hope you find it useful.
-
- Posts: 8
- Joined: Tue Jul 27, 2010 10:55 am
Re: LiquidTWI: High-performance LCD library for I2C Backpack Module
Is kch's patch still required with LiquidTWI ver 1.1?
thanks
arta
thanks
arta
-
- Posts: 8
- Joined: Tue Jul 27, 2010 10:55 am
Re: LiquidTWI: High-performance LCD library for I2C Backpack Module
It appears that kch's patch is still required.
-
- Posts: 38
- Joined: Tue Oct 26, 2010 4:25 pm
Re: LiquidTWI: High-performance LCD library for I2C Backpack Module
I am geting the following error from my Arduino IDE (1.0) using the LiquidTWI.rar Version 1.1 >>
In file included from HelloWorld_i2c.cpp:18:
C:\Users\Test\Documents\Arduino\arduino-1.0-windows\arduino-1.0\libraries\LiquidTWI/LiquidTWI.h:87: error: conflicting return type specified for 'virtual void LiquidTWI::write(uint8_t)'
C:\Users\Test\Documents\Arduino\arduino-1.0-windows\arduino-1.0\hardware\arduino\cores\arduino/Print.h:48: error: overriding 'virtual size_t Print::write(uint8_t)'
I un'rar' this into my libary folder as you can see.
I am sorry if this is too noobie, but what am missing? The HelloWorld_i2c from "LiquidCrystal.h" works fine, just this <LiquidTWI.h> is having kittens.
I tried googling the first error and could not, at this time, find anything on this subject (error 87).
I found a few examples of error 48, but did not understand the explantions of how to fix the error.
Any suggestions?
In file included from HelloWorld_i2c.cpp:18:
C:\Users\Test\Documents\Arduino\arduino-1.0-windows\arduino-1.0\libraries\LiquidTWI/LiquidTWI.h:87: error: conflicting return type specified for 'virtual void LiquidTWI::write(uint8_t)'
C:\Users\Test\Documents\Arduino\arduino-1.0-windows\arduino-1.0\hardware\arduino\cores\arduino/Print.h:48: error: overriding 'virtual size_t Print::write(uint8_t)'
I un'rar' this into my libary folder as you can see.
I am sorry if this is too noobie, but what am missing? The HelloWorld_i2c from "LiquidCrystal.h" works fine, just this <LiquidTWI.h> is having kittens.
I tried googling the first error and could not, at this time, find anything on this subject (error 87).
I found a few examples of error 48, but did not understand the explantions of how to fix the error.
Any suggestions?
-
- Posts: 12151
- Joined: Thu Apr 06, 2006 4:21 pm
Re: LiquidTWI: High-performance LCD library for I2C Backpack Module
Wire changed in 1.0 - use v23 until the author of this code fixes it
-
- Posts: 38
- Joined: Tue Oct 26, 2010 4:25 pm
Re: LiquidTWI: High-performance LCD library for I2C Backpack Module
Thanks for getting back with me so quickly and for the clarification. I was wondering if our friend has made the source code available yet or not? It would be nice to know how to fully use the I2C code.
Is there a tutorial for how to connect the RGB backlight negative LCD 16x2 ID: 399 to the i2c / SPI character LCD backpack ID: 292? I do understand there is the generic ‘how to’, but I am trying to figure out what to do with the RGB led pins. Like if I should use some type of right angle pins to connect to them then use the M/F wires to connect the pin to the arduino or something like that?
Also, I understand there are some thoughts about making a backpack that takes care of the three RGB extra pins. I was wondering how those thoughts are coming along?
If this I2C code gets off the ground, I would really like to see something like the NXP’s PCA9632 4-bit Fm+ I2C-bus low power LED driver or the PCA9633 4-bit Fm+ I2C-bus LED driver used with your MCP23008 to control your RGB LCD (both are I2C). I think off-loading the PWM from the Arduino on to the PCA963x’s PWM to control the LEDs would really be the best way to manage resources on the Arduino. The other positive outcome would be the end to the flickering you experience with using the Arduino’s PWM. Plus, you’re no longer having to deal with the wire dance to get Yellow and all of the other colors you want to use.
There was some questions about pricing of the PCA9633 and keeping something like this under $1 US. If you’re buying in quantities larger than 250 units from Digikey the following shows their price breakdown:
250 units – Unit Price: $.94 USD - Extended Price: $235.00 USD.
500 units – Unit Price: $.84 USD - Extended Price: $420.00 USD.
1000 units – Unit Price: $.66 USD - Extended Price: $660.00 USD.
This is just food for thought. I would draft this myself but I am just stuck with just Orcad Schematic, and no way to draft the PCB.
Is there a tutorial for how to connect the RGB backlight negative LCD 16x2 ID: 399 to the i2c / SPI character LCD backpack ID: 292? I do understand there is the generic ‘how to’, but I am trying to figure out what to do with the RGB led pins. Like if I should use some type of right angle pins to connect to them then use the M/F wires to connect the pin to the arduino or something like that?
Also, I understand there are some thoughts about making a backpack that takes care of the three RGB extra pins. I was wondering how those thoughts are coming along?
If this I2C code gets off the ground, I would really like to see something like the NXP’s PCA9632 4-bit Fm+ I2C-bus low power LED driver or the PCA9633 4-bit Fm+ I2C-bus LED driver used with your MCP23008 to control your RGB LCD (both are I2C). I think off-loading the PWM from the Arduino on to the PCA963x’s PWM to control the LEDs would really be the best way to manage resources on the Arduino. The other positive outcome would be the end to the flickering you experience with using the Arduino’s PWM. Plus, you’re no longer having to deal with the wire dance to get Yellow and all of the other colors you want to use.
There was some questions about pricing of the PCA9633 and keeping something like this under $1 US. If you’re buying in quantities larger than 250 units from Digikey the following shows their price breakdown:
250 units – Unit Price: $.94 USD - Extended Price: $235.00 USD.
500 units – Unit Price: $.84 USD - Extended Price: $420.00 USD.
1000 units – Unit Price: $.66 USD - Extended Price: $660.00 USD.
This is just food for thought. I would draft this myself but I am just stuck with just Orcad Schematic, and no way to draft the PCB.
-
- Posts: 12151
- Joined: Thu Apr 06, 2006 4:21 pm
Re: LiquidTWI: High-performance LCD library for I2C Backpack Module
thanks for your suggestions, we will check them out!
-
- Posts: 38
- Joined: Tue Oct 26, 2010 4:25 pm
Re: LiquidTWI: High-performance LCD library for I2C Backpack Module
Here is my suggestion Part 2: if you do upgrade the I2CBackpack. It's fully I2C and has a lot of expansions built in for those who need something more than just the I2C back pack. This was drafted on Orcad Schematic; sad part is I don't have the PCB part to draft the board. Cool thing about the PCA9555 is if you ever use it for making your keypad, you don't have to use pull up resistors with it (see http://www.nxp.com/documents/data_sheet/PCA9555.pdf or http://ics.nxp.com/support/documents/in ... n10315.pdf Figure 2). Nor do you have to make a 4 by 4 grid for your switches, and when a key is pressed it lets you know on the INT\. Nor more having the Arduino pull all your switches. It can be doing something else, and when a switch is pushed the PCA9555 will let it know something has happened.
Reason for jumpers instead of your nice solder jumpers was I could not find the correct ones in my library.
Reason for jumpers instead of your nice solder jumpers was I could not find the correct ones in my library.
- Attachments
-
- Orcad Schematic I2CBackPackVer2
- I2CBackPackVer2.jpg (298.65 KiB) Viewed 6122 times
Last edited by D9W on Fri Jan 06, 2012 4:16 am, edited 1 time in total.
- 1rj
- Posts: 6
- Joined: Sat Sep 17, 2011 5:39 pm
Re: LiquidTWI: High-performance LCD library for I2C Backpack Module
Hi! I'm having trouble and wonder if anyone can get me back on track. I'm a noob so although the error may be simple to someone - I'm completely stumped. I'm building a controller which monitors temps, PH, LED lighting, and a few relays. The LCD 20x4 was working perfectly displaying all data. I decided to use the I2C backpack module to free up pins on arduino and ran across the Liquid TWI and felt that it would serve better. I soldered the backpack to the LCD, cut and pasted LiquidTWI code and uploaded libraries. I disabled the reg LCD code using "//" at beginning of code lines. verified - all compiled fine. uploaded to arduino. backlight is working and blocks but no data display. reversed the data lines to be sure I hadn't put them in wrong. still same. unhooked everything except the LCD and clock and tried the "Hello World" still no words displayed. I wondered if I had done something wrong while soldering the LCD so reversed all my work - desoldered the backpack. e-soldered the LCD to the 16 pin extender, disabled the TWI and returned LCD code to the original state. no improvement - no data - backlight working and blocks. Took everything apart - started over - tried to run "Hello World" , verified, compiled, reset arduino button, uploaded, still only backlight and blocks. I'm baffled./ I don't know if I've burned something out with the soldering/desoldering/soldering or if I'm just missing something since I'm new at this. Thanks in advance for your help.
-
- Posts: 38
- Joined: Tue Oct 26, 2010 4:25 pm
Re: LiquidTWI: High-performance LCD library for I2C Backpack Module
Just a quick question here if you still have everything together (backpack connected to your LCD):
Did you tweak the 10K potentiometer (It's right of the word DAT on the Backpack) to check for the display?
See the picture below with the red arrow for the location of the potentiometer.
Turn it slowly to the left (until it comes to a stop) then SLOWLY right (DON’T FORCE turning it! -and if it stops turning try going back.) and watch the display while you have “Hello world” running (from the i2c/SPI LCD Backpack Tutorial >>http://www.ladyada.net/products/i2cspilcdbackpack/ ) and see if that helps. You have to use those small screw drivers, like for reading glasses, to work it. Warning it's not easy- meaning you can go by where it needs to be real easy- so turn it slowly. I made the same mistake the first time- of not going slow and wondered why it didn't work. I wish that potentiometer was a little bigger.
You did say that you got the Character LCDs "Hello world" using the examples in the regular tutorial and got that to work, right? >> http://www.ladyada.net/learn/lcd/charlcd.htm.
I would like to make a suggestion here: Do baby steps next time. Meaning Start out with the Character LCDs tutorial (http://www.ladyada.net/learn/lcd/charlcd.html) and make sure the LCD display works with your Arduino (or whatever microcontroller you are working with) before trying out the I2C back pack. (If I understand things right you did follow this part).
THEN try out the i2c/SPI LCD Backpack Tutorial >> http://www.ladyada.net/products/i2cspilcdbackpack/ without LiquidTWI. If you get that working then switch over to the LiquidTWI. And make sure you check that potentiometer is in the right setting before you decide things are not working.
Regarding Baby steps- I don’t know where it is located on this forum- but our Lady of adafruit talks about breaking down your code in small steps and making sure those small parts work before you made 1000 pages of code and get frustrated about things not working. I would say that is important for wiring your circuits too. Also if things get real hairy (Meaning your getting real frustrated), set the project down for 24 hours and come back to it later.
Sleep on the problem and look at the project with fresh eyes the next day or better yet, on the week end! I can’t tell you how many times a clear head and some sleep has helped me find the error of my own ways. NOW if that does not work, ask a friend to look at your code or your wiring. You can’t always see your own mistakes; you see it as it should be. (This thought comes from a person with really bad dyslexia.)
You can even up load a picture of your project, whatever wiring diagram you have of said head ache, and the code from that project that’s helping you lose the hair on your head here so others here can take a look at it. You never know someone might see what’s wrong and give you a leg up with your project.
As Harry Potter said “Every great wizard in history has started out as nothing more then what we are *now*. If they can do it, why not us?”
Electrical Engineering is a lot like being a wizard, except we are trying to keep the blue smoke inside of the circuit.
Did you tweak the 10K potentiometer (It's right of the word DAT on the Backpack) to check for the display?
See the picture below with the red arrow for the location of the potentiometer.
Turn it slowly to the left (until it comes to a stop) then SLOWLY right (DON’T FORCE turning it! -and if it stops turning try going back.) and watch the display while you have “Hello world” running (from the i2c/SPI LCD Backpack Tutorial >>http://www.ladyada.net/products/i2cspilcdbackpack/ ) and see if that helps. You have to use those small screw drivers, like for reading glasses, to work it. Warning it's not easy- meaning you can go by where it needs to be real easy- so turn it slowly. I made the same mistake the first time- of not going slow and wondered why it didn't work. I wish that potentiometer was a little bigger.
You did say that you got the Character LCDs "Hello world" using the examples in the regular tutorial and got that to work, right? >> http://www.ladyada.net/learn/lcd/charlcd.htm.
I would like to make a suggestion here: Do baby steps next time. Meaning Start out with the Character LCDs tutorial (http://www.ladyada.net/learn/lcd/charlcd.html) and make sure the LCD display works with your Arduino (or whatever microcontroller you are working with) before trying out the I2C back pack. (If I understand things right you did follow this part).
THEN try out the i2c/SPI LCD Backpack Tutorial >> http://www.ladyada.net/products/i2cspilcdbackpack/ without LiquidTWI. If you get that working then switch over to the LiquidTWI. And make sure you check that potentiometer is in the right setting before you decide things are not working.
Regarding Baby steps- I don’t know where it is located on this forum- but our Lady of adafruit talks about breaking down your code in small steps and making sure those small parts work before you made 1000 pages of code and get frustrated about things not working. I would say that is important for wiring your circuits too. Also if things get real hairy (Meaning your getting real frustrated), set the project down for 24 hours and come back to it later.
Sleep on the problem and look at the project with fresh eyes the next day or better yet, on the week end! I can’t tell you how many times a clear head and some sleep has helped me find the error of my own ways. NOW if that does not work, ask a friend to look at your code or your wiring. You can’t always see your own mistakes; you see it as it should be. (This thought comes from a person with really bad dyslexia.)
You can even up load a picture of your project, whatever wiring diagram you have of said head ache, and the code from that project that’s helping you lose the hair on your head here so others here can take a look at it. You never know someone might see what’s wrong and give you a leg up with your project.
As Harry Potter said “Every great wizard in history has started out as nothing more then what we are *now*. If they can do it, why not us?”
Electrical Engineering is a lot like being a wizard, except we are trying to keep the blue smoke inside of the circuit.
- Attachments
-
- 10K potentiometer on I2C backpack
- 10K potentiometer.jpg (49.91 KiB) Viewed 9756 times
- 1rj
- Posts: 6
- Joined: Sat Sep 17, 2011 5:39 pm
Re: LiquidTWI: High-performance LCD library for I2C Backpack Module
Thank you so much for your lengthy reply - yes, I did exactly as you suggested, breaking everything down to small units to check to see if they were working. I desoldered the backpack and went back to my original wiring for the LCD, re-soldering to a 16 pin mount, unhooking everything except the LCD and tried the "hello world" without the I2C to try to isolate the problem - whether it was related to the I2C or the LCD. I double checked the pins and code to match. Did recheck the potentiometer, which seemed to be working because I could make the blocks appear and disappear. So the problem was the same whether it was hooked up to the LCD without the backpack or with the I2C and backpack. The backpack is serial, by the way, not SPI. I didn't make the modification to SPI. Last night I started over again, desoldering all then re-soldering for the I2c so I didn't have to worry about a wire disconnect while trying to isolate this problem. Before I read your reply this am - I went to adafruit tutorials and started over again beginning with the LCD, breadboard and arduino uno. I hooked it up to the computer, got the blocks as before, uploaded the "hello world" code and again the same response. Checked the wiring and the code. verified and uploaded one more time and now the arduino uno is not responding at all. No lights, No flashes, nothing but an upload error saying the port is incorrect. I changed ports, changed usb cord and still no response. Maybe the problem was in the uno and not everything else. I don't know if it's dead or I can do something to revive it. It's not that old. I started working on the project in October. Now I'm a little scared that I'll invest all this time, money and energy into my project, which I've been very excited about, and the micro-controller will die after a few months of operation. Your input is so appreciated. Thank you.
Please be positive and constructive with your questions and comments.