(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:
#include <Wire.h>
// C6 63 46
byte addr = 0x63;
void setup()
{
Serial.begin(9600);
Serial.println("Init");
delay(500);
Wire.begin(); // join i2c bus (address optional for master)
delay(500);
}
void loop()
{
Serial.println(addr, HEX);
Wire.beginTransmission(addr);
Serial.println("A");
Wire.send(0);
Wire.send(254);
Wire.send(128);
Wire.send(255);
Serial.println("B");
Wire.endTransmission();
Serial.println("C");
delay(20);
Wire.beginTransmission(addr);
Wire.send(0);
Wire.send("Hello");
Wire.send(255);
Wire.endTransmission(); // stop transmitting
delay(50000);
}
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
i2cslave $C6,i2cslow,i2cbyte
main: writei2c 0,(254,128,255)
pause 10
writei2c 0,("Hello!123",255)
end
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