Hello community,
Is there any TI MCU that supports 3 wire SPI (CS, SCK, MOSI/MISO).
Regards,
Mohamed
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hello community,
Is there any TI MCU that supports 3 wire SPI (CS, SCK, MOSI/MISO).
Regards,
Mohamed
Hi Mohamed,
Most MSP430s support 3 wire SPI(that support SPI). There are code examples for how to implement this in resource explorer on almost every MSP430 with SPI. You can enter the "SPI" in the filter to see all these, for example:
https://dev.ti.com/tirex/explore/node?node=ABhQTf-A.S8hbdibM-AHpw__IOGqZri__LATEST&search=spi
BR,
Leo
If you're referring to SPI that shares MISO and MOSI on a single wire, I'm not aware of any MSP430 that supports this. You would have to manipulate the PSEL settings dynamically.
Hello Bruce,
This is exactly what I am referring to. Is there any examples of this dynamic manipulation ?
Best Regards,
Mohamed
I haven't seen any examples, and I haven't tried it myself. I only know about it from reading data sheets. The notion would be:
1) Set the MOSI GPIO as an input (PxDIR).
2) Just before you send a byte where the master owns the bus, set the PxSEL bit for the MOSI pin to let the USCI control it. When the byte is sent (UCBUSY=0 or RXIFG=1), clear the PxSEL bit for MOSI.
3) You can probably leave the MISO pin connected to the USCI all the time, since it's an input.
Managing (2) would be done referring to the (slave) data sheet waveforms.
It seems probable that there will be brief moments of bus contention at the switch-over times; just try to keep them short. I've seen current-limiting resistors used (MOSI) to reduce their significance.
Let us know how it turns out.
**Attention** This is a public forum