Sends a value of a variable to the SPI-bus.
SPIOUT var , bytes
SPI1OUT var , bytes
The variable whose content must be send to the SPI-bus.
The number of bytes to send. Maximum value is 255.
When SPI is used in HW(hardware) mode, there might be a small delay/pause after each byte that is sent. This is caused by the SPI hardware and the speed of the bus. After a byte is transmitted, SPSR bit 7 is checked. This bit 7 indicates that the SPI is ready for sending a new byte.
SPIOUT will always work on the first SPI interface (SPI0).
SPI1OUT will work on the second SPI interface (SPI1)
Dim A(10) As Byte
Config Spi = Soft , Din =Pinb.0 , Dout =Portb.1 , Ss =Portb.2 , Clock =Portb.3
Spiout A(1), 4 'write 4 bytes a(1), a(2) , a(3) and a(4)