Quantcast
Channel: MSP low-power microcontrollers
Viewing all articles
Browse latest Browse all 62309

Forum Post: RE: CCS/MSP432P401R: MSP432 spi communication, clk doesn't work when receiving data

$
0
0
Hello, Because you are the master, you will need to provide the clock so the slave can send its data. For example, the following function transmits a dummy 0xFF and then it reads the RX buffer int spi_Read(unsigned char *pBuff, int len) { int i = 0; ASSERT_CS(); for (i = 0; i < len; i ++) { while (!(UCB0IFG&UCTXIFG)); UCB0TXBUF = 0xFF; while (!(UCB0IFG&UCRXIFG)); pBuff[i] = UCB0RXBUF; } DEASSERT_CS(); return len; } Hopefully this helps. David

Viewing all articles
Browse latest Browse all 62309

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>