Author Topic: Bus pirate newbie-Controlling a standard HD44780 based LCD via PCF8574T I2C.  (Read 920 times)

0 Members and 1 Guest are viewing this topic.

Offline djsbTopic starter

  • Frequent Contributor
  • **
  • Posts: 940
  • Country: gb
I'm learning how to use my Bus Pirate V4. Thought I'd have a go at controlling a bog standard 16 x 2 HD44780 LCD that uses a PCF8574T i/o expander to convert it to I2C.
I've been watching this video



I've managed to get as far as using the 7 bit address search function on the Bus Pirate and got this result

"Searching I2C address space. Found devices at:0x4E(0x27 W) 0x4F(0x27 R)"

Which is what I expected.

I DO NOT want to use an Arduino as I want to get closer to the hardware which is why I'm using the Bus Pirate.

If for instance I wanted to do the following
1/ Clear the screen.
2/ Turn the backlight on and off
3/ Write some text.
What would I enter at the command prompt?

From the video I understand that there is a [for start then the slave address, then a command code, then a data byte, and then a stop]. This maybe only applies to the chip he is talking about.
Would I be addressing the PCF8574 or the HD44780 when I send commands using the Bus Pirate. Do I just concentrate on studying the Hitachi chip or both?
Has anyone got any examples command lines they can share? Thanks.
« Last Edit: May 06, 2020, 02:43:43 pm by djsb »
David
Hertfordshire, UK
University Electronics Technician, London, PIC16/18, CCS PCM C, Arduino UNO, NANO,ESP32, KiCad V8+, Altium Designer 21.4.1, Alibre Design Expert 28 & FreeCAD beginner. LPKF S103,S62 PCB router Operator, Electronics instructor. Credited KiCad French to English translator
 

Offline modoran

  • Regular Contributor
  • *
  • Posts: 68
  • Country: ro
You need to study:
- i2c protocol itself, this applies to all chips that is i2c compatible, not just pcf8574
- pcf8574 and hd44870 datasheets

You will be talking with pcf8574 using i2c instructing it to change its outputs as needed by the hd44870 display driver

Arduino has LiquidCrystal_I2C library, look into it, this is not an easy task if you want to implement all from scratch.
 

Offline djsbTopic starter

  • Frequent Contributor
  • **
  • Posts: 940
  • Country: gb
Thanks Modoran,
I've downloaded the LiquidCrystal_I2C library and I'll review some PIC assembly language stuff that covers the HD44870. I might buy a PCF8574T i/o expander breakout board (if such a board is available) and try to toggle some pins on that first.




P.S Just ordered 4 PCF8574T i/o expander breakout boards, so I can try out how cascading I2C works and how to use them with the Bus Pirate.
« Last Edit: May 07, 2020, 06:21:43 am by djsb »
David
Hertfordshire, UK
University Electronics Technician, London, PIC16/18, CCS PCM C, Arduino UNO, NANO,ESP32, KiCad V8+, Altium Designer 21.4.1, Alibre Design Expert 28 & FreeCAD beginner. LPKF S103,S62 PCB router Operator, Electronics instructor. Credited KiCad French to English translator
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf