en:pfw:spi_msp430_noforth_eusci-a1_spi_msp_v100.f
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| en:pfw:spi_msp430_noforth_eusci-a1_spi_msp_v100.f [2023-09-04 16:21] – gelöscht - Externe Bearbeitung (Unbekanntes Datum) 127.0.0.1 | en:pfw:spi_msp430_noforth_eusci-a1_spi_msp_v100.f [2023-09-04 16:21] (current) – ↷ Seite von pfw:spi_msp430_noforth_eusci-a1_spi_msp_v100.f nach en:pfw:spi_msp430_noforth_eusci-a1_spi_msp_v100.f verschoben uho | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | {{pfw: | ||
| + | < | ||
| + | (* USCI-A SPI on P2 of MSP430FR59x9 | ||
| + | IN | ||
| + | P1 200 202 204 206 20A 20C | ||
| + | P2 201 203 205 207 20B 20D | ||
| + | P3 220 222 224 226 22A 22C | ||
| + | P4 221 223 225 227 22B 22D | ||
| + | PJ 320 322 324 326 32A 32C | ||
| + | UCxyCTLW | ||
| + | UCA0 5C0 | ||
| + | UCA1 5E0 | ||
| + | UCB0 640 | ||
| + | P2 is used for interfacing the SPI with eUSCI-A1 | ||
| + | P2.3 - CS \ SPI enable low x1=Select | ||
| + | P2.4 - CLOCKPULSE | ||
| + | P2.5 - MOSI \ Data bitstream out x1=Mosi | ||
| + | P2.6 - MISO \ Data bitstream in | ||
| + | More SPI info on page 794ff of SLAU367O.PDF | ||
| + | Configuration of the pins on page 94ff of SLAS704G.PDF | ||
| + | *) | ||
| + | ( eUSCI-A1 SPI interface ) | ||
| + | |||
| + | hex | ||
| + | : SPI-ON | ||
| + | 01 5E0 **bis \ UCA1CTLW | ||
| + | 08 205 *bis \ P2DIR P2.3 is CS output | ||
| + | 70 20B *bic \ P2SEL0 | ||
| + | 70 20D *bis \ P2SEL1 | ||
| + | A981 5E0 ! \ UCA1CTLW | ||
| + | 08 5E6 ! \ UCA1BRW | ||
| + | 01 5E0 **bic \ UCA1CTLW | ||
| + | 08 203 *bis ; \ PJOUT CS high | ||
| + | |||
| + | code SPI-I/ | ||
| + | tos 5EE & .b mov \ UCA1TXBUF | ||
| + | begin, | ||
| + | cs? until, | ||
| + | begin, | ||
| + | cs? until, | ||
| + | 5EC & tos .b mov next \ UCA1RXBUF | ||
| + | next | ||
| + | end-code | ||
| + | |||
| + | : SPI-OUT | ||
| + | : SPI-IN | ||
| + | : SPI} ( -- ) 8 203 *bis ; \ P2OUT SPI off CS=high | ||
| + | : {SPI ( -- ) 8 203 *bic ; \ P2OUT SPI on, CS=low | ||
| + | |||
| + | spi-on | ||
| + | shield spi\ freeze | ||
| + | </ | ||