This is an old revision of the document!
A combination of phase and polarity produces 4 standard modes for the clock in SPI:
Mode | CPOL/CKPL | CPHA/CKPH |
---|---|---|
0 | 0 | 0 |
1 | 0 | 1 |
2 | 1 | 0 |
3 | 1 | 1 |
It is important that the right phase and polarity are selected so that the slave and master both capture the bit at the correct clock transition.
Example using UCB0 module for MSp430Fr5969
P1SEL1 |= BIT6; // P1.6-> UCB0SIMO P1SEL1 |= BIT7 ; //P1.7-> UCB0SOMI P2SEL1 |= BIT2 ; //P2.2-> UCB0CLK * Set up the CS pin as output. * Set up the Clock speed and mode that match the salve speed and mode. (refer to the slave’s datasheet)
example using UCA0 module for MSP430FR5994
Config pins for UART operation P2.0 → UCA0TXD , P2.1→ UCA0RXD
P2SEL0 &= ~(BIT0 | BIT1);
P2SEL1 |= (BIT0 | BIT1);
* Set the baud rate.
==== Baud Rate Configuration ====
===== I2C (Inter-Integrated Circuit) =====