User Tools

Site Tools




InData = Spi(OutData, Bits)

InData Input data
OutData Input data
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 Spi command 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.

Go CUBLOC home

cubloc/spi/index.txt · Last modified: 2022/12/28 08:45 by COMFILE Technology