View Single Post
  #9   Spotlight this post!  
Unread 15-03-2004, 17:50
Random Dude Random Dude is offline
Oregon State Head FTA
AKA: Chris
no team (Oregon Robotics Tournament & Outreach Program)
 
Join Date: Aug 2002
Rookie Year: 1998
Location: Oregon
Posts: 142
Random Dude will become famous soon enoughRandom Dude will become famous soon enough
Re: Timer interrupt hic-cupping - HELP

Quote:
Originally Posted by roknjohn
Here is the ouput using the EDU controller: (I only output a line every 5th program loop) I marked lines that contain errors with asteriks.
Code:
GetTime() = 16017d1  tmsClock =      352
GetTime() = 16d104a  tmsClock =      365
GetTime() = 17a8cf  tmsClock =	378  *****
GetTime() = 187181  tmsClock =	391  *****
It looks like the last hex digit is being dropped every so often.
Actually it's not the last one... the output you should be getting is

GetTime() = 016017d1 tmsClock = 352
GetTime() = 016d104a tmsClock = 365
GetTime() = 017a08cf tmsClock = 378 *****
GetTime() = 01870181 tmsClock = 391 *****


Notice the extra 0's. The problem is the printf function doesn't zero pad the output like it should. That is 'ok' for the ints, but for the longs it causes problems (In the printf lib, the printi function actually gets called twice for longs. once for each word.)