User manual

492
mikoC PRO for dsPIC
MikroElektronika
SPI Library
The SPI module is available with all dsPIC30/33 and PIC24 MCUs. mikroC PRO for dsPIC30/33 and PIC24 provides a
library for initializing the Slave mode and initializing and comfortable work with the Master mode. The dsPIC30/33 and
PIC24 can easily communicate with other devices via SPI: A/D converters, D/A converters, MAX7219, LTC1290, etc.
Important :
SPI library routines require you to specify the module you want to use. To select the desired SPI module, simply change
the letter x in the routine prototype for a number from 1 to 3.
Number of SPI modules per MCU differs from chip to chip. Please, read the appropriate datasheet before utilizing this
library.
Switching between the SPI modules in the SPI library is done by the SPI_Set_Active function (both SPI modules have
to be previously initialized).
Library Routines
- SPIx_Init
- SPIx_Init_Advanced
- SPIx_Read
- SPIx_Write
- SPI_Set_Active