View Single Post
  #16   Spotlight this post!  
Unread 23-01-2006, 00:34
Joel J's Avatar
Joel J Joel J is offline
do you..
no team
 
Join Date: May 2001
Rookie Year: 2000
Location: San Jose, CA
Posts: 1,445
Joel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond repute
Re: Analog-to-Digital Converter Code

Yes, it samples faster than the rate the data is being sent.

I have another question for Kevin (of course, I'm trying to optimize everything, but I don't want to make a bad move while doing this):

Is there a specific reason for switching from doing both the initiation of and saving of an ADC sample in the timer interrupt? I remember in last year's gyro code that both functions were done in the same place, whereas now you are using both the timer interrupt, and the ADC interrupt to take the samples. Is it safe to kinda shift the ADC functionality to the timer interrupt and reduce the extra overhead by removing the ADC interrupt altogether? Or do the two of them together execute faster, somehow, than the single timer?

Before you:
- Started the initial A/D conversion in Initialize_XXXX()
- Saved the value at the start of the timer2 interrupt
- Did the if/else/etc to put the value in the right place
- Started another A/D conversion by setting the GO bit.
- Exited the timer2 interrupt.

And if I get the go ahead, I'll just do this again.
__________________
Joel Johnson

Division By Zero (229) Alumni, 2003-2007
RAGE (173) Alumni, 1999-2003