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.
hi
i am using msp430f2618 controller and i want to interface this controller through SPI communication with one more controller called tiny tiger.. here TINYTIGER should act as master and msp430should act as s slave..i searched the sample code for msp430f2618 to act as a slave. but all code in 3 wire mode. so if any body having sample code for SPI communication with 4 wire or else please guide me on this issue??
The counting in '3 wire mode' is different then one might think.
the CS line between master and each of its slaves doesn't count. The difference between 3-wire and 4-wire mode is the use of an additional helper input (STE) that shuts the slave silent when pulled. This can be connected with the CS signal from the master, so the bus is immediately free. You can do its job in software, if you want (and if the SPI cock isn't too high). However, the CS signal still needs to be checked by software to do its main purpose.
So 3-wire mode actually is 3+n wire mode (n= 1 for slave mode and n= number of slaves for master mode) while 4-wire mode is 4+n wires. Where n can be 0 or 1 in slave mode, depending on whether you use the masters CS signal for both, STE and CS.
None of the demo codes actually uses the masters CS signal. It is always assumed that the slave is the only slave and already selected and the SPI is properly synchronized etc. However, the CS signal from the master must be checked and interpreted in software anyway (e.g. if CS goes low, clear the SWRST bit to start the transfer, and if CS goes high, set SWRST to reset the SPI hardware). The SPI hardware doesn't know the high-level protocol and whether CS resets the high-level protocol or not or resets the SPI or not.
**Attention** This is a public forum