Hi All,
I want to write an SPI master code. Using MSP430F5309, I have to transmit and receive data.
I checked the example codes of for MSP430F5309. None of them includes polling method. I want a code which polls the status bit in SPI register and trasmits data serially.
If anybody has done that before, please share me the code. I have a question by the way. Can the data be seen on the MISO/MOSI pins of SPI if the lines are un-connected. I am testing with an eval board and using CCS V5. In the debug mode, it has an option to load the program to the flash. My question is, if I program the flash and exit the debugger mode, will the program run or should I use debugging option to run the program.
I just want to run my program on the eval board, just by programming it. Can I run it with the debugger connected or should I use external power supply.?
Since I am new to MSP430 and TI, I am asking these dumb questions.
Please help me regarding this.
Chaithra Bharadwaj I checked the example codes of for MSP430F5309. None of them includes polling method.
I checked the example codes of for MSP430F5309. None of them includes polling method.
Unless you have a Very Good Reason to use the polling method, it's best to follow what the TI example code does, which is using interrupts to handle the SPI communication. This allows you to put the MSP430 to sleep when it's not receiving or transmitting, so that it does not waste cycles and power. The sleep-interrupt method is the preferred programming model for the MSP430, see http://www.ti.com/litv/pdf/slaa294a
On your second question, once you flashed the device you can either run the code within debug mode, or you can exit debug mode and hardware reset the device (using the RST button).
And yes, the eval board is designed to be used with the debugger connected. However you can also provide your own power source if you wish. Just make sure the board and the debugger have shared ground in that case.
Tony
Thanks Tony,
Since I was using interrupts for other peripherals, I chose to use polling method for SPI. And yes, it worked with the eval board after programming .
Chaithra BharadwajNone of them includes polling method
Keep in mind that
_____________________________________Before posting bug reports or ask for help, do at least quick scan over this article. It applies to any kind of problem reporting. On any forum. And/or look here.If you cannot discuss your problem in the public, feel free to start a private conversation: click on my name and then 'start conversation'. But please do so only if you really cannot do it in a public thread, as I usually read all threads. And I prefer to answer where others can profit from it (or contribute to it) too.