
Software Commands
Bit Pattern
Name
0001BBB0
INPUT
0001BBB1
OUTPUT
0010BBB0
LOW
0010BBB1
HIGH
0011BBB0
BITREAD
0100BBB0
REVERSE
0100BBB1
TOGGLE
0101BBB0
PULSOUT
Argument
None
None
None
None
None
None
None
PLEN
Returns
0
0
0
0
0 or 1
0
0
0
Description
Sets pin to input
Sets pin to output
Sets pin to output and set state low
Sets pin to output and set state high
Reads input pin
Sets input to output and vice versa
Toggles output pin
Pulses out (duration is a 16-bit word
specifying 2uS units)
Measures low pulse in 2uS units
(PLEN is 16-bits)
Same as PULSIN0 but measures a high
pulse
Shift data in using pin as data and the
next pin as clock; MBITS specifies a
mode and bit length.
Shift data out using pin as data and the
next pin as clock; MBITS specifies a
mode and bit length
Counts transitions on pin for specified
period (16-bit word in 4uS units).
Returns 16-bit count
PWM on pin with specified duty cycle
(byte) and period (1ms per unit; 16-
bits)
Measure RC charge in 2uS units (16-
bits)
Measure RC discharge in 2uS units
(16-bits)
Read RAM (address from 0-$5F)
Writes RAM (address from 0-$5F)
Gets quasi-random byte
Turns off pull up resistors on BANK A
Turns on pull up resistors on BANK A
Makes single tone. Frequency is 16-bits
(Hertz), Period is 16-bits (milliseconds)
Like FREQOUT, but makes two tones
0110BBB0
PULSIN0
None
0,PLEN
0110BBB1
PULSIN1
None
0,PLEN
0111BBB0
SHIFTIN
MBITS
0,BYT
0111BBB1
SHIFTOUT
MBITS, BYT
0
1000BBB0
COUNT
PER
0,CT
1001BBB0
PWM
DUTY, PER
0
1010BBB0
RCTIME0
None
0,PLEN
1010BBB1
RCTIME1
None
0,PLEN
10110000
10110010
10110011
11000000
11000001
1101BBB0
READ
WRITE
GETRAND
PULLOFF
PULLON
FREQOUT
ADDR
ADDR, BYT
None
None
None
FREQ,
PERIOD
FREQ, FREQ,
PERIOD
None
None
0,BYT
0
0,BYT
0
0
0
1101BBB1
FREQOUT2
0
10110110
1011100X
CHECK
BANKSEL
$41
0
Communications/version check
Select BANK A (X=0) or BANK B
(X=1)
Notes and Key:
BBB = Bit number (0-7) corresponding to B0 to B7
PLEN = 16-bit word specifying pulse length in 2uS units
MBITS = 8-bit value. Top 4 bits specify mode (see reference); bottom 4 bits indicate bit length (1-8)
BYT = Byte value
PER = 16-bit period in 4uS units
DUTY = Byte indicating duty cycle in 1/255 units
ADDR = RAM address (byte) from 0 to $5F
FREQ = Frequency (16-bits) in Hertz
PERIOD = Duration (16-bits) in milliseconds