8 years, 11 months ago.

Having I2C comm issues

Hi,

I am having communication issues. I can not seem to communicate with this display using the I2C command set.

I am using a Switch Science LPC824. I have Pin4 = Data = LCDPin2 and Pin5 = clock = LCDPin3 connected along with 3.3V and ground back to the LPC824.

Below is my simple test code. I do not see any indication of communications. Is there an initialization function I need to call first? I do not see any listed in your header library.

Do I need a pull-up on the I2C lines?

I am hoping you can help out.

Thanks Jamie

//////////////////////

  1. include "mbed.h"
  2. include "DigoleSerialDisp.h"

Serial usb(USBTX, USBRX); define USB connection pins

DigoleSerialDisp lcd(dp4, dp5, 0x27);DigoleSerialDisp(PinName sda, PinName scl, uint8_t address=0x27); igoleSerialDisp lcd(p9, p10);UART DigoleSerialDisp(PinName TX, PinName RX);

int main() { wait(5000); wait for LCD to power up

usb.baud(115200); define USB connection speed lcd.setLCDColRow(220,176); lcd.clearScreen(); lcd.baud(9600);

while(1) { lcd.setPrintPos(0,0); lcd.print("Hello World"); blink backlight

/ Turn on back light */ lcd.backLightOn(); wait(1000);

/ Turn off back light */ lcd.backLightOff(); wait(1000); } }

Question relating to:

Driver for the Digole Serial universal LCD display adapter LCD

1 Answer

8 years, 11 months ago.

Please use the << code>> << /code>> tags (no spaces, see "Editing tips") for your code blocks. I am not familiar with mbed and I2C, but usually a pull-up is required in both SDA and SCL pins, have you added them or are there already in the hardware?

Thanks. I had the wrong syntax for posting code snippets in HTML. Sorry. Code snippets still do not work.

AFIK the pull-ups are built into the controller board and direct connections are possible.

<< code>>

  1. include "mbed.h"
  2. include "DigoleSerialDisp.h"

Serial usb(USBTX, USBRX); define USB connection pins

DigoleSerialDisp lcd(dp4, dp5, 0x4e);DigoleSerialDisp(PinName sda, PinName scl, uint8_t address=0x27); igoleSerialDisp lcd(p9, p10);UART DigoleSerialDisp(PinName TX, PinName RX);

int main() { wait(5000); wait for LCD to power up

usb.baud(115200); define USB connection speed lcd.setLCDColRow(220,176); lcd.clearScreen(); lcd.baud(9600);

while(1) { lcd.setPrintPos(0,0); lcd.print("Hello World"); blink backlight

/ Turn on back light */ lcd.backLightOn(); wait(1000);

/ Turn off back light */ lcd.backLightOff(); wait(1000); } } << /code>>

posted by James Novak 14 May 2015

Put <<code>> and <</code>> on seperate lines without spaces in them.

posted by Erik - 14 May 2015