Small guide that explaining aspects of code that you need to change.
T250MS
- 250 ms timeout. calculates by (0.25 * SMCLK) / (8 * PSCL)*
T100MS
- 250 ms timeout. calculates by (0.1 * SMCLK) / (8 * PSCL)*
Where SMCLK is the frequency of the main oscillator, PSCL is a prescaler that divides frequency for SPI.
CSDIR
- register of CS pin port directions**
CSOUT
- register of CS pin port output state**
CSPIN
- CS pin bit**
*defined in diskio.c
**important only for ports within the MSP430 family
void spi_init(void)
function that initializes SPI and ports.
SPI requirements:
void spi_select(void)
Function that enabling CS (active state - LOW).
void spi_deselect(void)
Function that disabling CS (active state - LOW).
BYTE spi_send(BYTE byte)
Function that sending one byte via SPI.
BYTE spi_receive(void)
Function that receiving one byte via SPI.
Also checkout pff.h
and setup correct integer types.