3.5. PIC16 C SPI Serial Bus
• SPI system connections
• SPI function set
• SPI test system
The serial peripheral interface master controller uses hardware slave selection to identify a peripheral device with which it wishes to exchange data (refer to Section 1.4 for full details of the signaling protocol). The available set of SPI driver functions are shown in Table 3.7
Operation | Description | Example |
---|---|---|
SPI SETUP | Initializes SPI serial port | setup_spi(spi_master); |
SPI READ | Receives data byte from SPI port | inbyte=spi_read(); |
SPI WRITE | Sends data byte via SPI port | spi_write(outbyte); |
SPI TRANSFER | Sends and receives via SPI | inbyte=spi_xfer(outbyte); |
SPI RECEIVED | Checks if SPI data received | done=spi_data_is_in(); |
The test system has a slave transmitter ...
Get Programming 8-bit PIC Microcontrollers in C now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.