code for SPI test for MSP430

can anybody guide me to write SPI communication test code for MSP430?

Reply to
sambitsarkar
Loading thread data ...

You'll need to tell us if this is homework or a commercial project, as the consultancy rates will vary.

--
The Force is dark on one side, light on the other and holds the world
together.

Hmmm, just like Gaffer Tape then.
Reply to
Hot Jock

The examples can be downloaded at msp430.com, in the Code Examples tab.

However, using the MSP430 as a spi master: I have found it best to onl use the RX ISR, and leave the transmit interrupt off. SPI always transmits a byte when it receives a byte, so when you get a R interrupt it means both the transmit register is ready for another byte and the receiver buf has a byte ready for you to read out. And in thi case its best to start the transfer by writing to the TXBUFx. The transfe ends when the RX ISR doesnt put another byte into the TXBUFx.

You also need to consider whether your slave needs a chipselect to toggl states after every byte, or every 16bits or whatever. So the code to driv the SPI depends heavily on what the other side needs.

The example code on msp430.com website is a good basic start.

Reply to
dudmuck

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.