View Single Post
  #7   Spotlight this post!  
Unread 29-03-2004, 18:21
gnormhurst's Avatar
gnormhurst gnormhurst is offline
Norm Hurst
AKA: gnorm
#0381 (The Tornadoes)
Team Role: Programmer
 
Join Date: Jan 2004
Location: Trenton, NJ
Posts: 138
gnormhurst will become famous soon enoughgnormhurst will become famous soon enough
Re: Sometimes autonomous cycles at half rate (19 Hz instead of 38 Hz)

Quote:
Try printing out the packet number after every Getdata. It's rxdata.packet_num or rxdata.packetnum or something like that (you want the packet number in rxdata, not txdata). If your packet number keep incrementing by 2, you're missing packets.
Aha! Finally, a test I can do. Thanks, that's very helpful!


Quote:
im not sure what your trackers are, but if they involve interrupts based on outside effects, then you may get varying amounts of interrupts thereby causing your code to take longer.
Yeah, that occured to me, too, but I don't know how to test for it.


Quote:
Any chance your code is taking too long?
Always a chance. But I tested it way back in January with a scope and found the non-auton code taking less than 5 ms. I kind of think the auton code is not 5 times longer. I thought of taking my scope on the plane to Atlanta, but the thought passed (Tek 475 -- about the size of another carry on, but much more fragile than my socks). Besides, I think Kevin Watson's unmodified tracker.hex code had this same behavior, too. I think, but I might not swear to it.


Quote:
do you have printf statements in your code?
Yes. Turning off printf is a good thing to try. I may write a dummyPrintf() function and #define printf dummyPrintf

Code:
void
dummyPrintf( char *s, ... )  // note the var arg "..."
{
  return;
}

// and later:
#define printf dummyPrintf
Do you think that will do what I want (shut down all printfs at once)?

I think printf's are always suspect since I found a strange behavior: I would upload the code, it would start running, flooding the screen with printf output, so much that when I stopped the RC the screen kept going for a second or so. Then the program would not run again after a reset. I had to download the code each time to run it once. I got rid of most of the printfs, and that self-destructive behavior went away. Beware printfs!

Thanks for all your inputs.

-norm
__________________
Trenton Tornadoes 381
2004 Philadelphia Regional Winners
2006 Xerox Creativity Award
---
My corner of the USPTO.
My favorite error message from gcc: main is usually a function
My favorite error message from Windows: There is not enough disk space available to delete this file.