Command:
Byte
0
Checksum8
1
0xF8
2
NumCh 3
3
0x11
4
Checksum16 (LSB)
5
Checksum16 (MSB)
6
NumChannels
7
SamplesPerPacket (1-25)
8
Reserved
9
ScanConfig
Bit 7: Reserved
Bit 6: Reserved
Bit 3: Internal stream clock frequency.
b0: 4 MHz
b1: 48 MHz
Bit 2: Divide Clock by 256
Bits 0-1: Resolution
b00: 12.8-bit effective
b01: 11.9-bit effective
b10: 11.3-bit effective
b11: 10.5-bit effective
10-11
Scan Interval (1-65535)
12
PChannel
13
NChannel
Repeat 12-13 for each channel
Response:
Byte
0 Checksum8
1 0xF8
2 0x01
3 0x11
4 Checksum16 (LSB)
5 Checksum16 (MSB)
6 Errorcode
7 0x00
NumChannels
: This is the number of channels you will sample per scan (1-25).
SamplesPerPacket
: Specifies how many samples will be pulled out of the U3 FIFO buffer and returned per data read
packet. For faster stream speeds, 25 samples per packet are required for data transfer efficiency. A small number of
samples per packet would be desirable for low-latency data retrieval. Note that this parameter is not necessarily the same
as the number of channels per scan. Even if only 1 channel is being scanned, SamplesPerPacket will usually be set to 25, so
there are usually multiple scans per packet.
ScanConfig
: Has bits to specify the stream bas clock and effective resolution.
ScanInterval
: (1-65535) This value divided by the clock frequency defined in the ScanConfig parameter, gives the interval
(in seconds) between scans.
PChannel/NChannel
: For each channel, these two parameters specify the positive and negative voltage measurement
point. PChannel is 0-7 for FIO0-FIO7, 8-15 for EIO0-EIO15, 30 for temp sensor, 31 for Vreg, or 193.-224 for
digital/timer/counter channels. NChannel is 0-7 for FIO0-FIO7, 8-15 for EIO0-EIO15, 30 for Vref, or 31/199 for single-ended.
5.2.11 - StreamStart
Once the stream settings are configured, this function is called to start the stream. Requires U3 hardware version 1.21.
Command:
Byte
0
0xA8
1
0xA8
Response:
Byte
0
Checksum8
1
0xA9
2
Errorcode
3
0x00
5.2.12 - StreamData
After starting the stream, the data will be sent as available in the following format. Reads oldest data from buffer. Requires U3
hardware version 1.21.
Response:
Byte
0
Checksum8
1
0xF9
2
4 + SamplesPerPacket
3
0xC0
4
Checksum16 (LSB)
5
Checksum16 (MSB)
6-9
TimeStamp
10
PacketCounter
11
Errorcode
12-13
Sample0
62 (max)
Backlog
63 (max)
0x00
SamplesPerPacket
: From StreamConfig function.
TimeStamp
: Not currently implemented during normal operation, but after auto-recovery bytes 6-7 reports the number of
packets missed (1-65535).
PacketCounter
: An 8-bit (0-255) counter that is incremented by one for each packet of data. Useful to make sure packets
are in order and no packets are missing.
Sample#
: Stream data is placed in a FIFO (first in first out) buffer, so Sample0 is the oldest data read from the buffer. The
analog input reading is returned justified as a 16-bit value. Differential readings are signed, while single-ended readings are
unsigned.
Backlog
: When streaming, the processor acquires data at precise intervals, and transfers it to a FIFO buffer until it can be
sent to the host. This value represents how much data is left in the buffer after this read. The value ranges from 0-255, where
256 would equal 100% full.
Stream mode on the U3 uses a feature called auto-recovery. If the stream buffer gets too full, the U3 will go into auto-recovery
53