SparkFun Forums 

Where electronics enthusiasts find answers.

Discussions on how to get your MSP JTAG programmer up and running.
By SSK
#59312
Hello members,

I am using MSP430F1611 for my project with CrossStudio. I need to use assembly instructions in between my C code like,

void Wait(unsigned int delay)
{
unsigned int c;
for(c=0;c<delay;c++)
{
//asm("nop");
}
}

But above use of "asm" is giving compilation error. I am finding it bit difficult to find the proper document for this. Has anyone used this earlier with CrossStudio? A document will be much helpful.

Thanks in advance.
By gm
#59321
If you want a delay using CrossStudio, here is the function that will do that:

#include <inmsp.h>
void __delay_cycles(unsigned long n);

This "delays program execution for exactly n processor cycles. n must be a constant."

If you still want to use the nop, then just use the function

_NOP(); // note the prepended underscore

HTH,

gm