Component: IO Expander (PCF8574) (Comms: System)

From Flowcode Help
Jump to navigationJump to search


Author Matrix TSL
Version 1.0 (Release)
Category Comms: System


Image IO Expander (PCF8574) component

Provides 8 digital input/output pins arranged into an 8-bit port using a I2C bus connection. Up to eight expanders can be connected to the same I2C peripheral by means of three address pins. Supports the PCF8574 and PCF8574A devices allowing up to 16 expanders to be connected to the same I2C bus ( 8 x PCF8574 + 8 x PCF8574A ).

Examples

No additional examples


Downloadable macro reference

ReadPort

Reads a value to one of the ports with a mask.

Configures the masked bits to be inputs before reading the input value.

Parameters

This macro has no parameters


Return value

BYTE


WritePort

Writes a value to one of the ports with a mask.

Configures the masked bits to be outputs before writing the output value.

Parameters

BYTE Value
Value to write. Range 0-255


Return value

This call does not return a value


Initialise

No additional information


Parameters

This macro has no parameters


Return value

This call does not return a value


Simulation macro reference

This component does not contain any simulation macros


Property reference

Device Type

This property is of type Fixed list of ints and can be referenced with the variable name DeviceType.

No additional information


External Address

This property is of type Fixed list of ints and can be referenced with the variable name ExtAddress.

Selects the value of the three address pins for the MCP23S17.

Channel

This property is of type Fixed list of ints and can be referenced with the variable name cal_i2c1::CHANNEL.

Channel selection

Stop Delay

This property is of type True or false and can be referenced with the variable name cal_i2c1::StopDel.

On older microcontroller devices there is a potential for the I2C hardware channel to lock up if there is not

a 10ms delay between an I2C stop event and the next I2C start event.


Most modern microcontrollers will not have a problem so this property can be disabled to speed up the

I2C communications.

Baud Select

This property is of type Fixed list of ints and can be referenced with the variable name cal_i2c1::BAUD_LIST.

Baud rate option selector

Baud Rate

This property is of type Signed integer and can be referenced with the variable name cal_i2c1::BAUD.

Baud rate to be used

SDA

This property is of type Single digital pin and can be referenced with the variable name cal_i2c1::SDA.

Pin used for SDA (data signal)

SCL

This property is of type Single digital pin and can be referenced with the variable name cal_i2c1::SCL.

Pin used for SCL (clock signal)

Label

This property is of type Line of text and can be referenced with the variable name label.

No additional information


Scope Traces

This property is of type True or false and can be referenced with the variable name cal_i2c1::ScopeTraces.

Selects if the scope traces are automatically generated or not

Console Data

This property is of type True or false and can be referenced with the variable name cal_i2c1::ConsoleData.

Selects if the console data is automatically generated or not

Injector

This property is of type Fixed list of ints and can be referenced with the variable name cal_i2c1::Injector.

No additional information