csanders
Joined: 23 Apr 2005 Posts: 16
|
Intrerrupts corrupting floating point data?? |
Posted: Mon Nov 13, 2006 5:15 pm |
|
|
Hey everyone,
I am reading in an analog signal and averaging it in a somewhat length loop, to help give a stable reading - this is stored in a floating point variable.
I'm also using 2 of the hardware uarts processing the data as it is received by way of the rda interrupt (storing in a buffer), and a couple of timers using their interrupts as well.
What I have found is that when I turn the interrupts off, the floating point data is correct, but when these interrupts are enabled I have the problem of the data being incorrect - sometimes.
Now I have tried disable_interrupts(global) before I begin my averaging routine, but this causes a whole other problem of the averaging routing not executing properly giving a value that is wrong all of the time.
Has anyone ran into a glitch similar to this before?
The pic I am using is an 18F8720 |
|