Skip to content

johntalton/pcf8574

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PCF8574 ⚙️

npm Version GitHub package.json version CI GitHub Downloads Per Month GitHub last commit

GPIO-like 8bit device with simplistic interface and interrupt support.

Behavior

Unlike most GPIO, this chip considers the pin / port to be both input and output at the same time. This is achieved by tri-stating the pin, floating it, when set to LOW (0 / ground).

When set HIGH, the pin is driven to Vcc.

In both states, driven or not, the pins state can be read. With the LOW (floated) being of most interest.

Interrupt

When a pin is driven externally, not by setting it HIGH, the INT will be grounded (open drain). This style interrupt allows for a flexible, chainable, efficient interrupt implementations.

In this chips specific case, the interrupt will be be toggled based on the difference from last read state. That is, if the state changes from A to B, and back to A (ex: HIGH, LOW, HIGH)), then the interrupt will be self-cleared. Thus, late reads of the state may not reflect changes if not timely enough.

Other clear state are achieved by writing or reading to the chip. Both achieve clear the interrupt.

LED stuff

Apparently this chip has some benefit for driving LEDs. Much todo is given in the Datasheet about that. Make sure your using resistor where everyone on the internet sais you should be. 🥳