I need build a project using a 16x2 display interfacing with pcf8574. I´m using a LPC1769
I find a lot of documentation about how do this but only over Arduino.
Has someones any idea about how i can do on the LPC?
I've not used the PCF8574, but I have done it with a 74HCT595 on several different LPC devices (needs 6 pins in total). The 74HCT595 is quite a bit cheaper than a PCF8574! Connect the HCT595 outputs to D0-D7 on the display and write to it using the SPI port (it just needs SCK and MOSI)
Then use four other GPIO lines to do RW, R0 and E connecting RW to the OE pin of the 74HCT595, and E to STCP. Set RW and R0 before writing the data to the HCT595 then pulse E when the SPI write is completed.
This implements an 8-bit output-only port, but you also need to read back the busy pin, but you only need read D7, so connect that to the fourth GPIO line.
Trap for the unwary: LCDs and OLEDs like a 5V supply, and don't like the logic levels from a 3.3V processor. Hence using an HCT595 on a 5V supplies, the HCT (rather than the HC) accepts 3.3V logic levels happily.
R0, RW and E will also need a 3.3V to 5V level shifter (two sections of a 74HCT04 per pin)
Hello Christian Nicolaide,
I recommend you check the application note AN469, especially section 4.3 "Device Programming". Here you will find an explanation on how to make the write sequence to the PCF8574.
It would be a good idea to use the I2C drivers and the example projects provided in the LPCOpen for the LPC1769 as a starting point for your final application.
Link to download the LPCOpen.
Retrieving data ...