Use I2C/TWI LCD1602 Module with the propeller.
jtilghman
Posts: 67
I have the I2C/TWI LCD1602 Module from DFRobots. http://www.dfrobot.com/wiki/index.php?title=I2C/TWI_LCD1602_Module_(SKU:_DFR0063)
Sample code and the libraries are also at that link.
Its an 16x2 LCD with a I2C backpack on it. It works with the Arduino and it has libraries and they work in the arduino IDE.
I would like to make this with the propeller, but I think I am out of my depth here.
I am trying to learn SPIN and that's fun, but I am trying recode the libs for the LCD and trying to understand the I2C for the LCD. :depressed:
It's seems to be a little much.
If any one has some insight into making this work or would like to point me in the right direction, that would be great.
I thought I could just throw the correct codes down the I2C and that it might work.
Just a little help to get the LCD addressed and flash the backlight would be a great start.
Thanks,
John
Sample code and the libraries are also at that link.
Its an 16x2 LCD with a I2C backpack on it. It works with the Arduino and it has libraries and they work in the arduino IDE.
I would like to make this with the propeller, but I think I am out of my depth here.
I am trying to learn SPIN and that's fun, but I am trying recode the libs for the LCD and trying to understand the I2C for the LCD. :depressed:
It's seems to be a little much.
If any one has some insight into making this work or would like to point me in the right direction, that would be great.
I thought I could just throw the correct codes down the I2C and that it might work.
Just a little help to get the LCD addressed and flash the backlight would be a great start.
Thanks,
John
Comments
There are also several other versions out there, such as the very good one by Mike green: http://obex.parallax.com/objects/672/
What you really need to interface to that module is a datasheet. When doing I2C it's very important to have the register map: the series of addresses and functionality that define the operation of the module. After a quick inspection of the product page I couldn't find one. If you provide a link to the datasheet I could help more. If you can't find the data sheet, you'll have to go through the sample code provided and make your own register table. For example, using completely random values:
If you post your code we can provide more specific help.
One gotcha to be careful of is the I2C address: some drivers expect the address to be in the lower 7 bits, others expect it in the upper 7 bits. Some also expect you to provide the R/W lower bit.
Thanks for the reply. I have asked DFRobots for a datasheet or any more information that might be usable.
I also have access to the .h and the .cpp files for the arduino driver.
They can be seen here: https://dl.dropbox.com/u/12935294/I2CLCD/LiquidCrystal_I2C.h and https://dl.dropbox.com/u/12935294/I2CLCD/LiquidCrystal_I2C.cpp
In looking at the .h file, this part would make me think these are the device mappings you spoke about:
And maybe this is how its written down the I2C:
Anyway if this helps, let me know. I will keep digging to see what I can find.
As for code, my code isn't much more than some I2C objects and such but I can post it if you want to see.
I know I shouldn't be embarrassed about what my code looks like.
Thanks,
John
This is very likely the problem -- I ran into this while porting some I2C stuff from an Arduino project.
I think I am making some head way. I have taken code that JonnyMac wrote and have 'adapted' it. Its not complete and doesn't work. But its a start.
The problem I think is that I don't understand completey whats going on. I have looked at the I2C specs and it says: send address, then data, but in the spin code it wants: id, address, value.
The C++ code I have from the arduino lib seems to only send address, data. I still have not figured out if its 7 or 8 bit but the arduino libs talk about 4 bit address. Also this device is a HD44780U with an I2C backpack on it.
Don't know if any of this helps.
Just trying to learn as I go and get something working..
Thanks,
JT