Go to Post It will mean far more than you can imagine...and really, you can't lose. - David Kelso [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #7   Spotlight this post!  
Unread 15-03-2004, 16:10
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 Mark McLeod
I agree with Jamie, this printf will return bogus results. It only processes 16 bits and treats them as a signed int.

No, the %lx directive supports longs.




Though, as to the orignial question, I think it may be a critical section problem, where the interrupt code is running during a critical part of the main code. Specifically:

ThisTick=tmsClock;

That line actually compiles to about 10 lines of assembly. If the interrupt occurs during that section, really odd things can happen. You may need to disable interrupts right before that, and reenable them right after it.

[edit] Further thought on this (and clarification as to the actual problem) makes me realize that this wouldn't occur quite that often.[/edit

Last edited by Random Dude : 15-03-2004 at 17:52.
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Interrupt timer, executing code asap? SeanCassidy Programming 10 07-03-2004 01:47
Problems with interrupt timer actorindp Programming 1 20-02-2004 16:59
Interrupt Handlers and Variable Scope kaszeta Programming 2 14-02-2004 18:30
When would I use an interrupt? Apollo Clark Programming 7 18-01-2004 13:29
Interrupts Questions mightywombat Programming 0 03-01-2004 14:50


All times are GMT -5. The time now is 13:06.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi