I2C on EHS6T:USB Terminal | Telit Cinterion IoT Developer Community
July 12, 2015 - 12:08pm, 8059 views
I am having problems using the I2C bus to communicate to a 3V I2C LCD display (Address: 7C). This is what I have done:-
Set: AT^SCFG="Gpio/mode/SPI","std"
Response: ^SCFG: "Gpio/mode/SPI","std"
Set: at^sspi=
Response: CONNECT
Set: <a7C>
Response: {a+}
Set: <a7C0038>
Response: {a-0002}
I am using 4k7ohm resistors fitted between the bus lines and a regulated 3.3V supply.
I have the I2C display working with a freescale FRDM-KL25Z using Mbed compiler and standard library functions/programs so I know the LCD works.
Even if I disconnect everything from the terminals connector and type <a7C> i get {a+} even if I type any random two Hex numbers like <a22> it returns {a+}. This seems a little strange.
Any help/advice most welcome.
Hello,
I've got your point now - better late then later.
As I have written before the interface I2cBusConnection does exist both in the documentation and libraries for the software revision that you have. If it does not please check if you have the proper libraries connected to the project.
You are asking about this line:
i2cConnection cc = (I2cBusConnection) Connector.open("i2c:0;baudrate=100");
I didn't notice that there is "i2cConnection" and "I2cBusConnection" - I think that this is a typo. There's no "i2cConnection" and you should use "I2cBusConnection" here. "i2cConnection" would have to be a super type for "I2cBusConnection" but it's not and the name does not start with the capital letter as it should for the class name.
Regards,
Bartłomiej
Hi,
Thank you for the quick reply.
I have created the code based in what you told me and the gemalto's doc, but I am experiencing the following exepcetion when I try to write some bytes for a specific device in the I2C Bus:
java.io.IOException: could not write to I2C bus, out of memory
- com.cinterion.io.j2me.i2c.Protocol.writeI2cBytes(), bci=0
- com.cinterion.io.j2me.i2c.Protocol.writeBytes(), bci=5
- com.sun.midp.io.BaseOutputStream.write(), bci=43
- com.sun.midp.io.BaseOutputStream.write(), bci=9
Do you have any idea why I am getting this exception ?
Best regards,
Hello,
I have found in your previous post that "Gpio/mode/SPI" is set to "rsv". please set it to "std". i2c/SPI lines are shared with other interfaces and that could be the reason why the connection is not working.
If you are using the terminal version there may be other settings needed. You can find more in the terminal's hardware description.
If this will not help, please write more details what hardware you are using and some log what you try to send and code fragment.
If you have problem with communication over Java you could also try to verify with AT commands.
Regards,
Bartłomiej