Overview
For applications that require additional digital I/O pins, ClearCore may be linked with up to 8 ClearCore I/O Expansion Board (CCIO-8) modules. The ClearCore software package provides a
CcioBoardManager that interfaces with and controls the CCIO-8 link. Each CCIO-8 module has 8 CcioPin connectors that may be individually configured as a digital input or output, providing up to 64
additional digital I/O connectors.
The CcioBoardManager uses SPI to communicate to the CCIO-8 modules. The CCIO-8 modules are chained together and attached to either the COM-0 or COM-1 connectors. When a COM port is opened in CCIO
mode, ClearCore automatically detects how many CCIO-8 modules are in the chain. The CcioBoardManager will then periodically refresh the input and output CcioPin connectors as part of the ClearCore
system's background processing.
Wiring and Initialization
- Connect 24V power to the PWR terminal block on each CCIO-8 module (next to CCIO-8 pin 3). 24V power may be supplied three ways: from a source independent of the ClearCore, by connecting to any
of the main ClearCore board's I/O connectors, or by connecting to an I/O connector of a CCIO-8 earlier in the chain.
- Check that the Power OK LED (next to CCIO-8 pin 4) on each CCIO-8 module is on.
- Connect either the COM-0 or COM-1 port from the ClearCore to the COM_IN port on the CCIO-8 module with an RJ45 cable.
- If multiple CCIO-8 modules are needed, create a chain by connecting the COM_OUT port of CCIO-8 module (N - 1) to the COM_IN port of CCIO-8 module N. Repeat until all of the
modules (up to 8) are linked together.
- Check that the LED in each connected COM_IN and COM_OUT port is on.
- The LED in the COM_OUT port on the final CCIO-8 module in the chain should be off.
- Put the ClearCore COM connector in CCIO mode using SerialDriver's SerialDriver::Mode() function then open the port. Calling PortOpen() in CCIO mode will call
the CcioDiscover() function automatically in the background.
@ CCIO
Definition Connector.h:160
virtual ConnectorModes Mode() override
Get the connector's operational mode.
Definition SerialDriver.h:80
SerialDriver ConnectorCOM1
COM-1 connector instance.
- Verify that the number of discovered CCIO-8 modules matches the number of modules that were wired.
}
volatile const uint8_t & CcioCount()
Accessor for the number of CCIO-8 boards connected to the ClearCore.
Definition CcioBoardManager.h:246
CcioBoardManager & CcioMgr
CCIO-8 manager.
- The CCIO-8 modules in a link are represented by the letters A-H. The CCIO-8 module that is connected directly to the COM port is addressed using ClearCorePins CLEARCORE_PIN_CCIOA0 through
CLEARCORE_PIN_CCIOA7. The next CCIO-8 module in the chain uses ClearCorePins CLEARCORE_PIN_CCIOB0 through CLEARCORE_PIN_CCIOB7, and so on.
Configuring CCIO-8 Pins
- Each pin on the CCIO-8 modules can be independently configured as either a digital output or digital input.
if (ccioA0 != nullptr) {
ccioA0->State(1);
}
bool value = false;
if (ccioB1 != nullptr) {
value = ccioB1->State();
}
@ CLEARCORE_PIN_CCIOB1
CCIO-8 board 2, connector 1.
Definition SysConnectors.h:98
@ CLEARCORE_PIN_CCIOA0
CCIO-8 board 1, connector 0.
Definition SysConnectors.h:89
CcioPin * PinByIndex(ClearCorePins connectorIndex)
Accessor for the individual CCIO-8 pin connectors.
virtual ConnectorModes Mode() override
Get the connector's operational mode.
Definition CcioPin.h:71
@ INPUT_DIGITAL
Definition Connector.h:90
@ OUTPUT_DIGITAL
Definition Connector.h:98
Operation
- The CcioBoardManager periodically refreshes the CcioPin values as part of its background processing. The refresh rate varies depending on the length of the CCIO-8 chain.
- CcioBoardManager refresh cycle processing operations:
- Ensure that the previous SPI transfer is complete.
- Toggle the SPI Slave Select line to activate the outputs that were sent in the previous refresh cycle and latch a snapshot of the inputs.
- Check the integrity of the previous input data transfer.
- Perform input pin filtering.
- Prepare the current output data to transfer.
- Initiate a background SPI data transfer.
- The CcioBoardManager monitors the status of the CCIO-8 communications to ensure that the link is maintained.