CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Intrerrupts corrupting floating point data??

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
csanders



Joined: 23 Apr 2005
Posts: 16

View user's profile Send private message

Intrerrupts corrupting floating point data??
PostPosted: Mon Nov 13, 2006 5:15 pm     Reply with quote

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
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Nov 13, 2006 5:37 pm     Reply with quote

See this thread:
http://www.ccsinfo.com/forum/viewtopic.php?t=27666
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group