EasyManua.ls Logo

LabJack U12 - 5.14 - SPI

LabJack U12
61 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
of RAM buffer (first 4 bytes of RAM transmit buffer are never used). Any additional bytes must be written/read with the RAM. Baud
rate with no delay is about 160 kpbs.
Command
Byte #
Description
0
Data Byte 3
1
Data Byte 2
2
Data Byte 1
3
Data Byte 0
4
Bit 7: ms Delay
Bit 6: Hundred ยตs Delay
Bits 5-4: XX
Bit 3: SPI Mode D
Bit 2: SPI Mode C
Bit 1: SPI Mode B
Bit 0: SPI Mode A
5
011XXX10 (SPI)
6
Number of bytes to write/read (1-18)
7
Bit 7: Control CS
Bit 6: State of Active CS
Bits 5-3: XXX
Bits 2-0: D line to use as CS (0-7)
Response
Byte #
Description
0
Data Byte 3
1
Data Byte 2
2
Data Byte 1
3
Data Byte 0
4
Bits 7-4: XXXX
Bit 3: CSStateTris Error Flag
Bit 2: SCKTris Error Flag
Bit 1: MISOTris Error Flag
Bit 0: MOSITris Error Flag
5
011XXX10 (Echo of byte 5)
6
Echo of byte 6 from Command
7
Echo of byte 7 from Command
LabJackPython Example
>>> import u12
>>> d = u12.U12()
open called
Writing: [0x0, 0x0, 0x0, 0x0, 0x0, 0x57, 0x0, 0x0]
Received: [0x57, 0x0, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0]
>>> d.rawSPI([1,2,3,4], NumberOfBytesToWriteRead = 4)
Writing: [0x4, 0x3, 0x2, 0x1, 0x1, 0x62, 0x4, 0x0]
Received: [0x4, 0x3, 0x2, 0x1, 0x1, 0x62, 0x4, 0x0]
{
'DataByte3': 4, 'DataByte2': 3, 'DataByte1': 2, 'DataByte0': 1,
'ErrorFlags':
<BitField object: [ CSStateTris Error Flag = 0 (0),
SCKTris Error Flag = 0 (0),
MISOTris Error Flag = 0 (0),
MOSITris Error Flag = 1 (1) ] >
}
5.15 - SHT1X
Sends and receives data from a SHT1X T/RH sensor from Sensirion.
Baud rate without delay is about 2 kpbs.
DATA is IO0, SCK is IO1
Enable is not handled by this function.
58

Other manuals for LabJack U12