Jump to content
43oh

LCD Display using Bus Pirate and I2C


Recommended Posts

Hi,

 

I've been playing around with the I2C mode of a Bus Pirate trying to control an LCD (pretty sure it's an HD44780) in I2C mode.  My LCD has a PCF8574 backpack on it, and its address is 0x7E.   I'm running into something weird at the end of initalization.

 

I'm using minicom to communicate over USB to the Bus Pirate (running on a Linux OS).  I put my Bus Pirate into I2C mode, and turn on the power and internal pullup resistors - and I've used all 3 speeds (5, 50 and 100 kHz) to replicate the behaviour.  This is the startup sequence I am using (note, the bar at the beginning there is intentional as it is how the bus pirate knows it needs to begin I2C transmission:

[0x7E 0x30:3 0x38 0x08 0x01 0x06 0x0C

I'm staring at a blank screen, so for my own entertainment I sent the following through:

"HEH"

Instead of printing 'HEH' on the LCD, I get a capital letter 'O' instead.   If I send 'heh' then I get the letter 'o' - I'm pretty sure the Bus Pirate is working properly so that leaves the LCD.  It's possible my PCF8574 backpack is acting screwey - but if that was the case then why can I communicate at all?  For reference I'm following the initalization instructions here.  They're identical to what's on the HD44780 datasheet.  Although it might be that I'm using a non HD44780 LCD.

Link to post
Share on other sites

Isn't the PCF8574 an I2C to 8-bit interface? The HD44780 display has a few control lines in addition to data, so you are probably running in 4-bit mode, with 4 of the pins for data plus RS, RW and EN. Each character will take two complete transactions. And the EN pin is how you clock in each byte. If you have the EN pin connected to your PCF8574 you will need four I2C instructions to print one character. If you clock the display separately from the PCF8574 then it only takes two I2C writes, but they need to be interspersed with clocking of the display's EN pin.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...