Arduino and I2C LCD
August 18, 2008
(cross posting with arduino forum.. no answers there :(( )
hello! I have a picaxe LCD which support I2C and serial communication. You can see it here, datasheet here
Now i'm trying to use my Arduino Diecimila to display something, using i2c, but the LCD is not working.
Some stuff i've observed:
- the LCD works correctly with a picaxe board, always with i2c.
- with arduino, the board works ok in "clock" mode (a mode that doesn't communicate with the board but just show the current time).
- putting some debug println in the code, i can see that the program blocks in the Wire.endTransmission(); instruction.
The code i'm using is:
// C6 63 46
byte addr = 0x63;
Wire.begin(); // join i2c bus (address optional for master)
Wire.endTransmission(); // stop transmitting
I have some doubt about the address i should write to. The LCD has an address of 0xC6 (as in the datasheet), but it is in 8 bits, while, if i have understood correctly, the arduino wants a 7 bit address.
I tryed the same with 0x63 (discarding the low bit) and 0x46 (discarding the high bit).
The original Picaxe code for reference is:
init: pause 500
main: writei2c 0,(254,128,255)
It includes a "i2cslave" command that setups the device, is it something i should translate in arduino? it looks like it's not necessary but who knows..
Any help is greatly appreciated