The shipping fee depends on your address
Standard: 9-15 business days,fee is down to $3.99
Express: 4-7 business days,fee is down to $5.99
WE'RE READY TO BUILD A CUSTOM PRODUCT FOR YOU.
If you're looking for a custom product, we can help. Kindly contact us via email support@keszoox.com and send us the details for your need, then we'll let you know how we can deliver the right solution.We make into production usually Within 1 - 3 Bussiness Days.
Expect customization orders.Module can be used to expand the digital I/O of an MCU using the I2C bus.
The PCF8574 module can be used to expand the digital I/O of an MCU using the I2C bus.
A common requirement when working with MCUs is the need to add more digital I/O than the device supports natively. The PCF8574 is one of the more popular methods of adding lines as it uses the I2C bus that requires only 2 lines on the MCU. It provides 8 additional digital I/O lines which are easily expandable up to 64.
The module has an easy to use I2C interface that can be configured to use any one of eight different I2C addresses if you want to use multiple modules in the same system or if you run into an address conflict with another device.
The base I2C address of the modules is 0x20.
There are three address jumps (A0-A2) the determines which I2C address to use. As shipped, these jumpers are all set to the ‘-‘ side which is ground or LOW as shown in the picture. The ‘+’ side is Vcc or HIGH.
This puts the module at the base address of 0x20. The jumpers can be moved in a binary fashion to increase the address, so the address can range from 0x20 to 0x27 as shown in the table below.
If you daisy-chain the modules, you will need to set a different address for each of the modules.
Address (Hex) | A2 | A1 | A0 |
0x20 | LOW | LOW | LOW |
0x21 | LOW | LOW | HIGH |
0x22 | LOW | HIGH | LOW |
0x23 | LOW | HIGH | HIGH |
0x24 | HIGH | LOW | LOW |
0x25 | HIGH | LOW | HIGH |
0x26 | HIGH | HIGH | LOW |
0x27 | HIGH | HIGH | HIGH |
You may run into devices with the PCF8574A part installed. If that happens, don’t panic. These just use a different starting I2C address of 0x38. This part is offered by the mfr so that if both A and non-A parts are used together in a system, the number of modules can be increased up to a maximum of 16 providing at total of 128 digital lines. The ‘T‘ marking on the devices just denote that it is a surface mount device.
If there is ever a doubt about the I2C address of this or any device, just hook it up to the I2C bus and apply power and ground and then run the I2C scanner software.
The I/O is defined as quasi-bidirectional. A quasi-bidirectional I/O is either an input or output port without using a direction control register. When set as inputs, the pins act as normal inputs do. When set as outputs, the PCF8574 device drives the outputs LOW with up to 25mA sink capability but when driving the outputs HIGH, they are just pulled up high with a weak internal pull-up. That enables an external device to overpower the pin and drive it LOW.
The device powers up with the 8 data lines all set as inputs.
When using the pins as inputs, the pins are set to HIGH by the MCU, which turns on a weak 100 uA internal pull-up to Vcc. They will read as HIGH if there is no input or if the pin is being driven HIGH by an external signal but can be driven LOW by an external signal that can easily override the weak pull-up.
If used as outputs, they can be driven LOW by the MCU by writing a LOW to that pin. A strong pull-down is turned on and stays on to keep the pin pulled LOW. If the pin is driven HIGH by the MCU, a strong pull-up is turned on for a short time to quickly pull the pin HIGH and then the weak 100uA pull-up is turned back on to keep the pin HIGH.
If the pins are set to be outputs and are driven LOW, it is important that an external signal does not also try to drive it HIGH or excessive current may flow and damage the part.
Whenever the internal register is read, the value returned depends on the actual voltage or status of the pin.
The I/O ports are entirely independent of each other, but they are controlled by the same read or write data byte.
The interrupt open drain output pin is active LOW. It is normally pulled HIGH using a pull-up resistor and is driven low by the PCF8574 when any of the inputs change state. This signals the MCU to poll the part to see what is going on. If connecting this pin, enable the internal pull-up resistor on the MCU or add an external pull-up of 10K or so.
If using interrupts with multiple modules, since they are open drain they can be tied together if a single interrupt back to the MCU is desired.
The connections to the module are straight forward.
1 x 4 Header (Male & Female)
1 x 9 Header
These modules are useful for expanding digital I/O.
One thing to keep in mind is that since the device has strong drive (25mA) when sinking current, but low drive (300uA) when sourcing current, it is best to drive LEDs and similar devices that require higher current by tying their anode to Vcc and pulling their cathode LOW with the PCF8574. A current limiting resistor is generally required.
The example program below sets up all 8 lines as inputs and writes a HIGH to them to enable the weak internal pullups of the PCF8574, so these pins will read HIGH unless something drives them low.
Pushbuttons with one side grounded can be connected to these inputs. The MCU which then scans the PCF8574 inputs and prints out any button found to be pressed.
The example here uses the xreef/pcf8574 library that can be downloaded from GitHub: https://github.com/xreef/PCF8574_library
/* This example for the PCF8574 takes pushbutton inputs on pins 0-7 and sends the number of the button pressed to the Serial Monitor window. Pins are normally HIGH and pulled LOW when button is pressed. Uses the xreef/PCF8574.h library */ #include "Arduino.h" #include "PCF8574.h" PCF8574 pcf8574(0x20); // Set (I2C address) //=============================================================================== // Initialization //=============================================================================== void setup() { Serial.begin(9600); for(int i=0;i<8;i++) { pcf8574.pinMode(i, INPUT); // Set all pins as inputs pcf8574.digitalWrite(i,HIGH); // Enable weak pull-ups to pull pins HIGH } pcf8574.begin(); delay(500); // Give the pcf8574 a little time to initialize } //=============================================================================== // Main //=============================================================================== void loop() { // just loop scanning the keys if (pcf8574.digitalRead(P0)==LOW) {Serial.println("KEY 0");} if (pcf8574.digitalRead(P1)==LOW) {Serial.println("KEY 1");} if (pcf8574.digitalRead(P2)==LOW) {Serial.println("KEY 2");} if (pcf8574.digitalRead(P3)==LOW) {Serial.println("KEY 3");} if (pcf8574.digitalRead(P4)==LOW) {Serial.println("KEY 4");} if (pcf8574.digitalRead(P5)==LOW) {Serial.println("KEY 5");} if (pcf8574.digitalRead(P6)==LOW) {Serial.println("KEY 6");} if (pcf8574.digitalRead(P7)==LOW) {Serial.println("KEY 7");} delay(250); }
Notes:
Operational Ratings | ||
Vcc | Maximum range | 2.5 – 6V |
IOL | Low level output current | 25mA (typ) |
IOH | High level output current | 300uA (max) |
Dimensions | L x W (PCB) | 48 x 17mm (1.9 x 0.67″) |
Country of Origin | China | |
Datasheets | NXP | PCF8574 / PCF8574A |
WE'RE READY TO BUILD A CUSTOM PRODUCT FOR YOU.
All orders are dispatched from our warehouse. The shipments are fully tracked—from our door to yours. Please allow 3-5 business days for your order to be processed in addition to the shipping times below.
Standard: 9-15 business days. Express: 4-7 business days.
Please note that shipping providers are extremely busy during this time, and some orders might experience a delay on top of usual delivery times. If your order is late, please allow 5-10 days more than indicated in standard shipping times before contacting our customer service. Thank you for your understanding.
All orders are 100% tracked. You’ll receive an email with a tracking number and a link to track your parcel once your order leaves our warehouse. Please allow 24-48 hours for the tracking link to start showing shipping information.
Receive our latest updates about our products & promotions.
Thanks for subscribing!
This email has been registered!