== GPIO232-16 | by pleXus (2018) ==

More information about this device here (as of 2018): http://diy-homeworks.de/?p=953


List of commands:

<nn>   = one HEX byte (lower case letters !!)
<nnnn> = two HEX bytes (one HEX word)
! for infos on decimal input, hit *?
-------------------------------
l<nn>    - set low byte  (port 0)
h<nn>    - set high byte (port 2)
w<nnnn>  - set word
a<nn>    - port AND byte -> port
o<nn>    - port OR  byte -> port
x<nn>    - port XOR byte -> port
A<nnnn>  - port AND word -> port
O<nnnn>  - port OR  word -> port
X<nnnn>  - port XOR word -> port
c        - clear low byte
C        - clear high byte
F        - clear word (flush)
s<n>     - set bit, bit number as one hex digit (0..f)
z<n>     - clear bit (zero)
i        - invert low byte
I        - invert high byte
N        - invert word (negate)
r        - read low byte; returns 2 HEX digits "hh"
R        - read high byte
D        - read word (dump); returns 4 HEX digits "hhhh" (MSB left)
S        - read ADC value (pin 1.4 & 1.5), result depends on *X4
P<nnnn>  - set pulse generator period, 0000 disables pulse generator
L<nnnn>  - set pulse width (length)  !! Pulse Generator on Pin 3.7 !!
M        - PIO monitor on/off (edge triggered)
[SPACE]  - show register status
?        - this help page
#        - convert decimal number to hex
.        - cancel transmission, acknowledged by '#'
[ESC]    - cancels all automatic readouts (kinda buggy)
b<nn><...> - send low byte burst, <nn> is number of bytes in burst
             <...> = 2byte hex values, no separator: b<nn><d0><d1>...<dn>
B<nn><...> - send high byte burst;   bursted data is not cached
W<nn><...> - send word burst, <nn> is number of words (4byte hex value)
-------------------------------
~a<nn>   - set value for DAC 1 (pin 4.0)
~b<nn>   - set value for DAC 2 (pin 5.0, buffered on 5.2 (see *?)
~P<nn>   - set DAC polarity; 0=negative (sink), 1=positive (source)
           each digit for one DAC: <ab>, (<10> -> (DAC1+, DAC2-))
~r<nnnn> - read ADC value repeatedly every <nnnn> msec
~M       - monitor ADCs (pin 1.4 & 1.5) (50ms Interval)
-------------------------------
*D<nnnn> - set pin direction (1=in, 0=out; default 0xffff)
*O<nnnn> - set output type (0=totem-pole, 1=open drain; default 0000)
*P<nnnn> - enable strong pull-up (~5k, can drive LEDs),
           0=off, 1=on, default 0000, ignored if output is totem-pole
*L<nnnn> - LED mode (can also be used as input to read simple switches)
           overrides all other port settings! 0=on, 1=off, default 0000
*T<nnnn> - trigger readout on rising edge @ specific pin,
           0=trigger off, 1=trigger readout
*t<nnnn> - trigger readout on falling edge @ specific pin
*r<nnnn> - read low byte repeatedly every <nnnn> msec,
           0000 disables repetitive readout
*R<nnnn> - read high byte repeatedly
*W<nnnn> - read word repeatedly
*B<x>    - boolean byte function for:
           x==0 -> low byte (default) / x!=0 -> high byte
*E<nnnn> - enable external triggering (pin 3.6)
           <nnnn> means: <*eda> -> e(egde), d(digital), a(adc)
           trigger edge,    e: 0=off, 1=rising, 2=falling, 3=both
           digital readout, d: 0=none, 1=low, 2=high, 3=word
           analog readout,  a: 0=none, 1=adc1, 2=adc2, 3=adc1:adc2
*?       - paged help page & some extra information
*V       - get FW version; answer: "!<version>"
*p       - ping; answer: "!PONG"
*Y42     - reset device
*Y99     - restore factory settings (*X<x> settings), requires reset
*C       - read config, format:
           !<Version>,<DReg><DCache>,<P>,<L>,<*D>,<*O>,<*P>,<*L>,
           <*T>,<*t>,<~a>,<~b>,<~P>,<*B>,<*X0>,<*X1>,<*X2>,<*X3>,<*X4>,
           <*X5>,<*X6>,<*X7>,<*X8>,<*X9>\r\n
           <DReg> = port data register (output latch, not pin state)
           <DCache> = port data cache (last value written)
------------------------------
 system config commands:   (will be stored nonvolatile)
*X0<x>   - console echo; x==0 -> off; x!=0 -> on
*X1<x>   - append line break or separator after read
           x: 0=off 1=\n 2=\r 3=\r\n 4=' ' 5=, 6=; 7=/ 8=Tab
*X2<x>   - set BAUD rate: x: 0=2400, 1=4800, 2=9600, 3=19200, 4=38400,
                             5=57600 (default), 6=115200, 7=230400
*X3<x>   - case of hex letters; x: 0=lower case, 1=upper case
*X4<x>   - set channel for ADC readout; x: 0=Ch1, 1=Ch2, 2=Ch1 & Ch2
           output on dual-channel: <nnnn>:<mmmm> (n=ch1, m=ch2)
*X5<x>   - edge triggered readout; x: 0=word, 1=low byte, 2=high byte
*X6<x>   - pulse generator main clock frequency; x: 0=1MHz (default), 1=1kHz
*X7<x>   - timestamp format; x: 0=no timestamp, 1='HHMMSS-', 2='MMDD.HHMMSS-'
           NOTE: lowers performance, always starts at 01.01.1970/00:00:00
*X8<x>   - default readout base: x: 0=HEX (default), 1=DEC
*X9<x>   - enable opamp; x: 0=disabled (default), 1=enabled (pin 5.2)

 +--------------------------------------------------------------------------+
 | Decimal Input: Enter decimal number then hit the command character.      |
 |    e.g.: '1234w' is the same as 'w04d2'; e.g.: '200~a' to set DAC 1      |
 |    dec input available for: l,h,w,a,o,x,A,O,X,s,z,P,L,~a,~b              |
 +--------------------------+-----------------------------------------------+
 | p0.0 - p0.7  low byte    | IO ports Iout max: 4mA source, 8mA sink       |
 | p2.0 - p2.7 high byte    | Pull-Up resistors ~5.6k                       |
 |                          | LED mode uses pull-up /pull-down resistors to |
 | p1.4 ADC 1 (12bit)       | drive LEDs directly (to GND or VDD).          |
 | p1.5 ADC 2 (12bit)       | Current DAC Output 2.4uA/bit                  |
 |                          | ADC resolution:    500mV/bit                  |
 | p3.6 external trigger in | Buffered output only works with load resistor |
 | p3.7 pulse generator     | from p5.0 to GND. OpAmp has to be enabled.    |
 |                          | Out: ~10mV/bit with 4.2k load res.            |
 | p4.0 DAC 1 (8bit)        | Iout max: ~5mA                                |
 | p5.0 DAC 2 (8bit)        | Pulse generator frequency range @ 1MHz clock: |
 | p5.2 buffered DAC 2 out  | 15.3Hz @ Pffff to 500kHz @ P0001 (L0000)      |
 |                          | Shortest pulse width: 1us @ L0000             |
 | p1.1 RS232 TX            | Frequency range @ 1kHz: 15mHz .. 500Hz        |
 | p1.0 RS232 RX            | shortest pulse: 1ms                           |
 +--------------------------+-----------------------------------------------+
.

Example how to set the COM port and control the device



mode COM4 BAUD=57600 PARITY=N DATA=8 STOP=1 xon=off

set LED mode
echo *Lffff > COM4

set word value
echo wffff > COM4


DAC ramp (as shown in the online docu)
echo 0~a10~a20~a30~a40~a50~a60~a70~a80~a90~a100~a110~a120~a130~a140~a150~a160~a170~a180~a190~a200~a0~a > COM4


-------------------------------------------------------
comments? questions? : plexus@opal-city.de
complaints? : /dev/null




