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.
Tool/software:
This is running on the LaunchPad development board, does that have something to do with it?
I'm getting strange behavior on my I/O ports when running but with a simple test program making the pins produce square wave, it works file.
Yet in the program of interest I am getting continuous pulses on a port which is a peripheral data port after inserting the while(1);
There are no timers or interrupts in use (yet).
I tried making the (1) a volatile variable but that did not work.
This happens on both debug and release mode.
Hi, Andy
I tried making the (1) a volatile variable but that did not work.
What is this (1)? I am not sure about (1).
I'm getting strange behavior on my I/O ports when running but with a simple test program making the pins produce square wave, it works file.
Yet in the program of interest I am getting continuous pulses on a port which is a peripheral data port after inserting the while(1);
Seems Launchpad work normal.
There are a lot of MSP430 code example you can refer to in MSP430 SDK:
C:\ti\msp\MSP430Ware_3_80_14_01\examples\devices\MSP430F5xx_6xx\MSP430F55xx_Code_Examples\C
Regards,
Helic
HE means that instead of while(1) he put in while(x) where x is a volatile variable.
OP: Share your code. Use the insert->code function at the bottom of the message box.
while(1) does not "halt" the program. It merely puts main() into an infinite loop.
If your GPIO's are set up with timers and interrupts, they are perfectly happy to run when main() is in an infinite loop.
If for some reason I want to do something like this, I prefer:
while(1) LPM4;
**Attention** This is a public forum