InData = Spi(OutData, Bits)
|Bits||Number of bits (1 to 32)|
This command sends and receives data simultaneously. In contrast, the
ShiftOut and ShiftIn commands only support either sending data
(ShiftOut) or receiving data (ShiftIn), but not both. The
can be used on any I/O port.
The Set Spi command must be used prior to the
Spi command to ensure
the I/O ports are defined prior to sending or receiving data.
Const Device = CB280 Dim Dtin as Byte Set Spi 9,8,7,0 Dtin = Spi(Dtout,32)
For a more complete example, see the file C:\Program Files (x86)\ComfileTools\CublocStudio\CM100A in CUBLOC Studio's installation folder.
The SPI clock frequency is 15kHz.