Table of Contents
CP-IO13-4C - IO Board Accessory for the ComfilePi 26 pin header
The CP-IO13-4C is an IO board accessory for the ComfilePi consisting of 7 bipolar digital inputs, 6 digital outputs, corresponding indicator LEDs, 2 RS-232C ports, all exposed through screw terminals. It can be mounted to the rear panel of the CPi-C070WR4C panel PCs.
C#/VB.Net Control Example
The following is an example project illustrating how to program the CP-IO13-4C in C# or VB.Net using the Mono Framework.
This example application uses the following .NET libraries to control the digital inputs, outputs, and serial ports.
Python Example
The pigpio library also has a Python interface.
The following is an example illustrating digital inputs and outputs:
import pigpio pi = pigpio.pi() pi.set_mode(6, pigpio.INPUT) pi.set_mode(19, pigpio.OUTPUT) while True: if pi.read(6): pi.write(19, 1) else: pi.write(19, 0) pi.stop()
Pin Map
The CP-IO13-4C pins are connected to the ComfilePi CPi-C's GPIO header as shown below.
Inputs: GPIO 6, 7, 10, 11, 16, 17, 18
Outputs: GPIO 19, 20, 21, 22, 23, 24
Specifications and IO Circuitry
- Input Voltage: 5VDC (powered by ComfilePi's 5V pin)
- Current Rating: 100mA or more
- Humidity: 35 ~ 85% RH
- Temperature: -10 ~ 60 ℃
- Size: 128mm X 78mm
Inputs
- Bipolar relative to COM x 7
- Voltage Range: 12 ~ 24V
- Absolute Min/Max Voltage Range: 3.3 ~ 28V
- Response Time: 5ms
- Input OFF Level: <1.8VDC
- Input ON Level: >2.5VDC
- Indicator LED OFF Level: <4.5V
- Indicator LED ON Level: >5.0V
Outputs
- DC Output Sink (NPN) x 6
- Maximum Output Voltage: 30VDC
- Response Time: 10ms
- Current: 150mA
Setting the Initial IO State
It may be necessary to modify the ComfilePi's initial GPIO output state to prevent the ComfilePi from turning the outputs ON when the ComfilePi boots.
Modify the ComfilePi's /boot/config.txt file with the following configuration to set the initial IO state. See GPIO control in config.txt for more information.
gpio=6-7=ip gpio=10-11=ip gpio=16-18=ip gpio=19-24=op,pd,dl
To intitialize /dev/serial2 and /dev/serial3 add the following to the /boot/config.txt file.
dtoverlay=uart3,txd3_pin=4,rxd5_pin=1 dtoverlay=uart4,txd4_pin=8,rxd9_pin=1
