Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
12 years, 6 months ago.
Newhaven LCD on I2C bus
I am trying to drive an LCD using I2C on pins 20 and 18 of J2 on a Freescale Freedom FRDM-KL25Z. The LCD is a Newhaven (NHD-0216K3Z-NS(RGB)-FBW-V3). I am most troubled trying to get some small amount of code to simply establish basic communication from the dev board to the LCD. If there is anyone that could give me the most simple "hello world" example to work with I would be highly grateful. I have spent quite a bit of time running through libraries and other examples in the cookbook and handbook section, and I am not really gaining any sort of grasp.
1 Answer
12 years, 6 months ago.
I looked at the documentation of the KL25Z and it seems that the mbed pinout overview shown here has an error. The picture does NOT match the KL25Z datasheet and schematic.
PTE1 (J2 pin 20) is shown as SDA, but is in fact SCL.
PTE0 (J2 pin 18) is shown as SCL, but is in fact SDA.
Note that pinout in FRDM-KL25Z User's Manual (Rev 1.0) does have the correct I2C pinfunction desciption, but uses the wrong Portpin number:
PTE0 (J2 pin 20) is shown as SCL, should be: PTE1 (J2 pin 20) shown as SCL.
PTE1 (J2 pin 18) is shown as SDA, should be: PTE0 (J2 pin 18) shown as SDA.
The pdf/excel pinout table is also wrong wrt to the J2 pin number.
So, try swapping the Pin20/Pin18 wires to the display in case you followed the above incorrect pinout.