Knowledge Base

Here is the I/O map in SPLat equate format for the DC216

There’s some really good technical information about using digital pins as outputs.

;-- digital inputs --
iIn0 iEQU 0
iIn1 iEQU 1
iIn2 iEQU 2
iIn3 iEQU 3
iIn4 iEQU 4
iIn5 iEQU 5
iIn6 iEQU 6
iIn7 iEQU 7
iBtnUp iEQU 8
iBtnDn iEQU 9
iBtnLeft iEQU 10
iBtnRight iEQU 11

;-- digital outputs --
oOut0 oEQU 0
oOut1 oEQU 1
oOut2 oEQU 2
oOut3 oEQU 3
oOut4 oEQU 4
oOut5 oEQU 5
oOut6 oEQU 6
oOut7 oEQU 7
oLedOn oEQU 8
oLedGreen oEQU 9

;-- analogue inputs --
aiIn0 EQU 0
aiIn1 EQU 1

;-- analogue outputs --
aoOut0 EQU 0

;-- serial --
COMTTL EQU 251
COM485 EQU 252
COMUSB EQU 253

The 8 digital I/O terminals are all active low, inactive o/c (open circuit).  You do not need to specifically configure them as inputs or outputs, they are simply always inputs and always outputs.  Be aware that to use a pin as an input, be sure not to use an output instruction to turn it on, otherwise it will switch low and can’t be used as an input.

As a side note, separation of the LED into on/off and green/red pins allows for some cute effects.  For example:

On      oLedOn
Blink oLedGreen

These two instruction will cause the LED to automatically start blinking between red & green.

Quadrature Counter

A high speed quadrature counter is supported on inputs 3 and 4.  The quadrature signals should switch between open-circuit and ground.

Terminals 3 & 4 are always available as bi-difectional inputs & outputs, the quadrature counter is always running in the background.

It can theoretically cope with a signal of over 10MHz, but wiring and circuit board loads may limit the maximum attainable frequency.

For more information see the generic OBQC documentation.