PCF8574 and TWI with Fleury code

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Using a HD44780-1602 LCD with TWI adapter-board, both from China via EBAY (example: http://www.ebay.com/itm/IIC-I2C-...).

No specs, but said 'Arduino compatible' - which seems to mean PCF8574 I2C I/O Expander based.

Can't find an 'Arduino' schematic so figured I'd have to send it bit-patterns to determine how the PCF8574's outputs are mapped to the 1602 pins.

Got it to talk to AVR via Fleury bit-bang code - can see on scope: Start / SLA-W is ACK'ed / W-data-byte ACK'ed / STOP, so all looked good.... definitely getting the ACK's from PCF8574 as I disconnected and Fleury code did detect the NACK.

Probed the 1602's pins (ms-nyble, r/w, E) and don't see the W-data on them.... tried alternating 1's then 0's in W-data.... all ACK'ed, but never appear on 1602 pins - pins just static.

Started looking at PCF8574 spec - very confusing on one issue - thought maybe somebody here might know.

Spec says:
The data byte is followed by an acknowledge sent from this device. If other data bytes are sent from the master, following the acknowledge, they are ignored by this device. Data are output only if complete bytes are received and acknowledged. The output data will be valid at time, tpv, after the low-to-high transition of SCL and during the clock cycle for the acknowledge.

But they follow this statement with timing diagrams that show a 2nd data byte recieved before the 1st data byte is sent to its output port....

These seem contradictory.... anybody understand this?

Sorry about the long-winded question.... but wanted to give full details.

Attachment(s): 

Mark
Elgin, IL (near Chicago)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ideally, you find the module data sheet.

Otherwise just read the source code for the library.

It is relatively simple to interface an 8-bit PCF8574 to the 6 or 7 bits required for a HD44780 type controller. However there are several ways to do it. So you need to know how it is wired.

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The expander pin to LCD pin mapping reads in the picture of PCB, just click your link.

And it seems the TI manufactured part is somewhat different to NXP manufactured part.

Be sure to check which part you have. It would also be worth to read the Arduino code how it works, before writing your own.