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.

My program always crashes because the following statement?

Other Parts Discussed in Thread: TMS320F2812

My program is about a robot control project. The platform is TMS320F2812.

After I added the following statement,

 setpoint=1.7+0.5*sin(1*3.14*sampleTime*CpuTimer0.InterruptCount);

My program crashes and enters into the following interrupt.

interrupt void ILLEGAL_ISR(void)   // Illegal operation TRAP
{
  // Insert ISR Code here

  // Next two lines for debug only to halt the processor here
  // Remove after inserting ISR Code
  asm("          ESTOP0");
  for(;;);

}

It's really tricky.

After I comment the statement, It works again.

I'm really confused. What is the matter with my program? Is it because memory allocation problem?

 

Thanks everyone in advance.