I am trying to use the ADC1 on the Tower evaluation board with K60.
For initialisation I use the Processor Expert (see attetchment) and this is the start code:
After calling StartLoopMeasurement() the whole system hangs, not even the jtag debugger is able to pause the system. Interesting is, with disabled interrupt for ADC1 everything works fine, exept the interrupt of course.
With interrupt enabled, the interrupt handler it is called once and never again. Is there something I have to do in the interrupt or what is my problem?
Of course. I atteched the whole Eclipse project.
He should create a sine wave on DAC0_OUT and toggle the Pin PTC1 each time the ADC interrupt handler is called.
The ADC0 runs in free run mode, capturing the state of the poti of the tower board (ADC1_DM1).
The main loop will create the sine wave with a frequency depending on the ADC value.
We have reproduced the same behavior, the project freezes after a while. It seems that the problem is related to usage of floating point math and interrupts. I have reproduced the same behavior with new simple project containing just one timer interrupt and main loop containing floating point expression and assignment.
As a workaround it seems to work to disable interrupts as you did or removing floating point calculation.
I have asked compiler team to check this issue.
Processor Expert Support Team
Any news on this? I notice that my system has been crashing during a floating point operation. I have narrowed it down to the floating point operations but I can't seem to make it happen on demand
We are seeing a similar thing using floating point trig. The CPU seems to freeze along with the debugger. Has there been any progress in resolving this?
It seems that this is a problem of my main loop:
for(i=0; i<10000; i++)
//GPIOD_PTOR = (1<<6);
With this code the cpu crashes after a few seconds, uncommenting the Cpu_DisableInt() and Cpu_EnableInt(); functions solves this problem. I tryed to find out which command is responsible for that but it seems like all commands are. Is it a problem with the floating point operations? Maybe they are not interruptable? Any idea?