Digital Output Specifications


Last Update: May 26, 2017 @ 10:17 : Preliminary information subject to change.

The default Digital Output state is active Low == FALSE, H == TRUE. Some IOC boards have Control Outputs which have a High == TRUE default state. These digital outputs are intended for peripherals  such as SPI devices that require a Low Chip Select (CS) signal.

Note that outputs are low current signals. Don’t expect to draw 10mA from all outputs at once or you risk burning out the ARM cpu. For example, modern LED brightness is rated at 20mA and can be very, perhaps unnecessarily, bright. Direct LED drive current for most status LEDs needs to be around 1-2mA only. Check the LED forward voltage and select a suitable current limiting resistor. Higher current devices must be supported by external circuits. For example, the output drives the base of transistor (or an IC)  that switches a higher current to the external device.

Decaf Boot State

Digital Outputs are Low, Control Outputs are High. Unassigned GPIO pins are high impedance. Output states are not stored when the Decaf board is powered down or disconnects from USB, such as when the host app sends a device Reboot command. Your app should monitor the USB Device connect / disconnect state, and store digital output states if this is an issue.

Connecting an LED to a Digital Output

How it works:

R1 limits the current for the LED. D1 forward voltage (Vf, see the device spec sheet) often varies with the LED colour, and brightness is quoted for 20mA. In practice, most SMD, 3mm and 5mm LEDs will only need 1 -2 mA. When the output is turned on, the LED will illuminate.

Connecting a Solid State Relay to a Digital Output

  

How it works:

The SSR provides optically isolated control for higher AC or DC voltages, completely protecting the hosting system. Note the logic GND and external grounds are isolated.  Phidgets 3051/2/3/4 SSR modules are fully compatible with the Decaf boards.  There is an excellent discussion of SSR device choices and operation at http://www.phidgets.com/docs/Solid_State_Relay_Primer

Using Optocouplers

How it works:

An optocoupler device allows external circuits to be electrically isolated from the Decaf board and the host PC. This is esspecially important where higher voltages are present, and to avoid ground loops. The current limiting Ri value is chosen from the optocoupler specifications sheet. The optocoupler device may accept 3v3 logic levels directly. When the Decaf output is set H, the internal LED triggers the output transistor. Note the example above inverts the signal, connecting RL to the external ground.

Connecting an SPI Device Chip Select to a Control Output

How it works:

Control outputs are active L, as are most SPI device CS (Chip Select) pins. At power up, a Control Output is H, so the host app has to instruct the SPI device to be selected. This is necessary for example when multiple SPI devices are sharing the same SPI bus with the MISO, MOSI and CLK signals.

 

Related I/O Pages

Analog Inputs    Digital Inputs