NumSPIWords: This is the number of SPI bytes divided by 2. If the number of SPI bytes is odd, round up and add an extra
zero to the packet.
SPIOptions: If AutoCS is true, the CS line is automatically driven low during the SPI communication and brought back high
when done. If DisableDirConfig is true, this function does not set the direction of the lines, whereas if it is false the lines are
configured as CS=output, CLK=output, MISO=input, and MOSI=output. SPIMode specifies the standard SPI mode as
discussed below.
SPIClockFactor: Sets the frequency of the SPI clock according the following approximate formula: Frequency =
1000000/(8+10*(256-SPIClockFactor), where passing a value of 0 corresponds to a factor of 256, and thus a maximum
frequency of about 125 kHz.
CS/CLK/MISO/MOSI -PinNum: Assigns which digital I/O line is used for each SPI line. Value passed is 0-22 corresponding
to the normal digital I/O numbers as specified in Section 2.9.
NumSPIBytesToTransfer: Specifies how many SPI bytes will be transferred (1-240).
The initial state of SCK is set properly (CPOL), by this function, before CS (chip select) is brought low (final state is also set
properly before CS is brought high again). If CS is being handled manually, outside of this function, care must be taken to make
sure SCK is initially set to CPOL before asserting CS.
All standard SPI modes supported (A, B, C, and D).
Mode A: CPHA=1, CPOL=1
Mode B: CPHA=1, CPOL=0
Mode C: CPHA=0, CPOL=1
Mode D: CPHA=0, CPOL=0
If Clock Phase (CPHA) is 1, data is valid on the edge going to CPOL. If CPHA is 0, data is valid on the edge going away from
CPOL. Clock Polarity (CPOL) determines the idle state of SCK.
Up to 240 bytes can be written/read. Communication is full duplex so 1 byte is read at the same time each byte is written.
5.3.17 - AsynchConfig
Control command configures the UE9 UART for asynchronous communication.
The UE9 has a UART available that supports asynchronous serial communication. Currently, the UART connects to the
PIN2/PIN20 (TX0/RX0) pins on the DB37 connector. On a future UE9 hardware revision, it is expected that the UART will appear
on FIO/EIO lines after any timers and counters.
Communication is in the common 8/n/1 format. Similar to RS232, except that the logic is normal CMOS/TTL. Connection to an
RS232 device will require a converter chip such as the MAX233, which inverts the logic and shifts the voltage levels.
This serial link is not an alternative to the USB connection. Rather, the host application will write/read data to/from the UE9 over
USB, and the UE9 communicates with some other device using the serial protocol. Using this serial protocol is considered an
advanced topic. A good knowledge of the protocol is recommended, and a logic analyzer or oscilloscope might be needed for
troubleshooting.