User`s manual
Parameter lth_htl determines transmit edge for data. It can have the following val-
ues:
In order to keep this working, you shouldn't override the settings made by the pro-
cedures spi_init or spi_init_ordinary as it uses some of the PIC MCU resources.
Pins RC3, RC4, RC5 are configured as needed (don't change TRISC settings for
these pins - procedure will set them automatically).
The following routines are provided for comfortable use of master mode :
sub procedure SPI_write(dim Data as byte)
Write byte b to SSPBUF, and immediately starts the transmission.
sub function SPI_read(dim Buffer as byte)
Provide clock by sending data (byte b) and read the received data at the end of the
period.
mikroBASIC
- Basic Compiler for Microchip PIC microcontrollers
158
mikroBASIC
MikroElektronika: Development tools - Books - Compilers
making it simple...
page
Note
Read and
Write
Value Meaning
LOW_2_HIGH Data transmit on low to high edge
HIGH_2_LOW Data transmit on high to low edge