User Tools

Site Tools

한국어

cubloc:set_spi:index

Set Spi

Set Spi clk, mosi, miso, mode

clk port for clock output
mosi port for data (Master output, Slave Input)
miso port for data (Master input, Slave output)
mode communication mode
bit 3: 0 = MSB start, 1 = LSB start
bit 2: 0 = wait at clock LOW, 1 = wait at clock HIGH
bit 1: Output sampe point; 0 = before rising edge, 1 = after rising edge
bit 0: Input sample point; 0 = before rising edge, 1 = after rising edge

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) 

Go CUBLOC home

cubloc/set_spi/index.txt · Last modified: 2016/04/14 11:07 (external edit)