pcf8574 lcd module pricelist
This PCF8574 based module is a versatile I/O port expansion module. It is basically a I2C based port enpansion module which can convert any 8 bit data from I2C serial to 8-bit parallel. LCD if used with this module will require only 2 GPIO lines that will save a lot of hardware resources.
This LCD I2C interface adapter can be added to a 16 x 2 or 20 x 4 character LCD display with a standard parallel interface to make it I2C compatible. It can also be repurposed for other I2C to parallel tasks.
By default, the industry standard HD44780 compatible 16 x 2 and 20 x 4 character LCD displays require 4 or 8 parallel data lines to drive them along with a couple of pins for chip select and chip enable. This consumes a lot of pins on the MCU. This adapter board reduces the data pin requirements to only 2 pins which can also be shared with other I2C devices.
The backlight can be controlled ON/OFF, but the intensity is not directly controllable though the I2C interface. Some modules have a jumper on the board that supplies Vcc power to the backlight. That jumper can be removed and a voltage applied to the header pin nearest the ‘LED’ markings on the board to provide power to the backlight separately. Note: Some modules do not have this header / jumper installed, instead the solder pads have a trace connecting them. It is possible to cut the trace between the pads and add header pins if desired.
The PCF8574 is a generic I2C to 8-bit I/O device and the module can be repurposed for other uses besides driving LCD modules. Max I2C clock frequency is 100kHz which makes it most suited to lower speed applications.
VCC = Connect to 5V. This can come from the MCU or be a separate power supply. Some LCD may operate at 3.3V and this module can also operate at 3.3V
The pin-out of the header which is soldered to the LCD follows for reference, but in general you don’t need to worry about it as the I2C interface board and software library takes care of this interface unless you are adapting the module for another use. These pins are listed starting at the I2C header end of the board.
To use the adapter with an LCD, you will need to insert the 16-pin header into the 16 solder pad holes on the back of the LCD and solder them in place on the front side. The pins are long and can be cut off before or after soldering.
Soldering the module on is easy to do, but if you already have other pins in those holes, they will need to be removed first before this board can be added. The picture below shows the adapter mounted to the back of an LCD2004 4 x 20 character LCD.
This is the same module used on our I2C compatible LCD displays we sell and is well supported using the LiquidCrystal_I2C.h and similar libraries. For using the board with software, you can check out one of the LCDs below that already have this module installed.
The PCF8574 itself is a general purpose 8-bit I/O expander for the I2C bus. The reverse engineered schematics are provided here mainly for those who may want to adapt the module to other applications. The I2C bus on this module is limited to a 100kHz clock frequency.
I have to say that after some time working properly the LCD started to display strange characters. Before that the right characters were blinking while the LED backlight was always ON.
Ithink I have to order new I2C modules since I have another 16x02 LCD working good with the traditional 4 data wires connection. This is the module I"m gonna buy: I2C module
but for getting product into the USA, the backpacks are available for $1 USD shipped, and LCD+Backpack already soldered starts at $2 USD shipped from many low cost vendors. The low cost vendors are from china and may take a while to get.
I looked at a few libraries (Arduino ones) to get inspiration. In LCD_I2C_PCF8574.c I have added a lot of background and links to where you can get hold of other source, documentation and data on the PIC18F2685, I2C, the LCD and IO expander should you be so inclined. I also added a link to the library I ripped for the character generation. Thanks Mario. This file also contains details on how you may want to customise to your implementation, these are tagged with "TODO adapt" so you can use the MPLABX task list to grab them.
I took all my details/nomenclature etc. from an Hitachi hard copy LCD manual (yes hard copy, real paper an"all!) I obtained in the early 1980"s when we were still printing on flattened trees.
Alphanumerical LCDs need lot of pins (6 pins at least) for interfacing and in some cases, this is an expensive requirement. In such cases, hardware designs become complex and every pin is precious for their secondary roles. We can avoid this by using software-based I2C or SPI LCD drivers.
We send the address and command of the PCF8574 module first and then we send the port states. Note that the port states are sent just like the first LCD example.
This is a RoHS compliant I2C Serial LCD Daughter board that can be connected to a standard 16×2 or 20×4 Character Display Module that supports 4-bit mode. All Character Modules sold on our site support 4-bit mode, and nearly all commercially available 16×2 and 20×4 line character modules support it too.
This board has a PCF8574 I2C chip that converts I2C serial data to parallel data for the LCD display. There are many examples on the internet for using this board with Arduino. Do a search for “Arduino LCD PCF8574“. The I2C address is 0x3F by default, but this can be changed via 3 solder jumpers provided on the board. This allows up to 3 LCD displays to be controlled via a single I2C bus (giving each one it’s own address)
Adding a display to Raspberry PI Pico allows getting real time information from connected devices without using a computer from USB port. I2C LCD displays (with PCF8574 backpack) are one of best solution to keep wiring simple
I2C LCD displays are common LCD displays, usually composed of 16 columns x 2 rows blocks, but also different configurations can be found. Differently from simple LCD displays, they include a small panel soldered in its backside, including chips able to reduce their connection wires. The I2C LCD display usually has a PCF8574 chip, which is a device able to convert I2C serial communication into parallel connections.
To connect an I2C LCD Display with your Raspberry PI Pico, you just need to wire the Vcc and GND PINs from display to VSYS and a GND PINs of RPI Pico, then SDA and SCL PINs from the I2C Display to a couple of SDA and SCL PINs from Raspberry PI Pico, belonging to the same I2C bus, as shown in the picture on the following wiring diagram chapter.
A working solution uses the dhylands-python_lcd module including a generic API to interface to LCD displays. But this class implements commands to be sent to the LCD without caring about how to send them. The reason is that there are many different backpacks and every solution can be implemented in many different ways. The ones created with a PCF8574 use I2C as communication protocol, in this case, you need a sort of driver able to send commands via I2C. This function is implemented with a second module from T-622 user, also available from T-622 GitHub page.
Before going into the usage explanation, you have to be sure that your LCD’s I2C address is correct. This is a unique address shared between I2C devices to make them able to talk on the same shared wire. This is usually a hexadecimal value and all devices connected to your RPI Pico can be scanned by copy-paste of the following code in your Thonny shell (you can copy all lines together):
As I2C LCD with PCF8574 backpack use PCF8574 chip for I2C communication, you will probably get its default address (0x27). But if your project includes more PCF8574-based chips, then you will need to identify the LCD one between those that will be shown. In case of missing devices, please check your cabling.
Starting to use your LCD device, you can run a generic test with the T-622 test script, which I have pre-configured for 16×2 LCDs using I2C0 channel (ports GP0 and GP1 according to my wiring diagram). This modified script can be get from my download area (use the following link: i2c_lcd_test). Save this file in your Raspberry PI Pico root folder or in your computer and open it with Thonny IDE.
If you will see nothing, please check your cabling. Another common issue with I2C LCD display is getting a clean screen which is only powering on and off. This means that your connection is correct and everything is working, you have only to adjust your LCD contrast by rotating the screw positioned in your LCD backside, which controls a potentiometer managing contrast:
The LCD API used has a flexible feature allowing users to display also complex icons inside a single cell. Some special characters are already available and depend on your LCD ROM (Read Only Memory, space not visible to the user). You can use these chars with “lcd.putchar(chr())” function.
The first 8 characters (from 0 to 7) character-generator RAM. This means that you can define and design any icon you want to display by identifying pixels to be put on/off for each char block, made of 8 rows and 5 columns of pixels. Each row A good description of how to define a generic icon is explained in https://github.com/dhylands/python_lcd.
You can use the generated code with “lcd.custom_char()” command. An example usage is built in my pico_i2c_lcd script. Download and open it in your Thonny IDE.
Any parallelly interfaced character LCD you get these days will have a Hitachi HD44780 chip or a different one compatible with the HD44780. These usually have 14 pins (16 if have backlight)D0-D7is the bi-directional data busR/W determines if we read from or write to the LCDRSstands for "register select". RS=0 means that the instruction register is selected. RS=1 means that the data register is selected. In other words, according to the status of RS pin, the data on the data bus is treated either as a command or character data.E pin enables or disables the LCD module. When Enable is low the LCD is disabled and the status of RS,R/W and the data bus will be ignored. When Enable pin is high the LCD is enabled and the status of the other control pins and data bus will be processed by the LCD. When writing to the display, data is transferred only on the high to low transition of this signal.
The data sheet warns that under certain conditions, the lcd may fail to initialize properly when power is first applied. This is particulary likely if the Vdd supply does not rise to its correct operating voltage quickly enough. It is recommended that after power is applied a command sequence of 3 bytes of values $30 is sent to the module. This will guarantee that the module is in 8 bit mode and properly initialised.
The HDD44780 lcd control chip was designed to be compatible with 4-bit processor. Once the display is put in 4 bit mode, using the Function Set command, it is a simple matter of sending two nibbles instead of one byte, for each subsequent command or character. When using 4 bit mode only data lines D4 to D7 are used. Note that the Function set command for 4-bit interface, 2 lines, 5*7 Pixels is 0x28. So first use the Function set command $20 (4-bit interface, 1 line, 5*7 Pixels); from now on, all commands and data must be sent in two halves, the upper four bits first.