Go to Post Celebrate your failures as well as your successes. - Taylor [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
  #1   Spotlight this post!  
Unread 28-01-2006, 22:50
Andrew Blair's Avatar
Andrew Blair Andrew Blair is offline
SAE Formula is FIRST with Gasoline.
FRC #0306 (CRT)
Team Role: Alumni
 
Join Date: Feb 2005
Rookie Year: 2004
Location: Corry
Posts: 1,193
Andrew Blair has a reputation beyond reputeAndrew Blair has a reputation beyond reputeAndrew Blair has a reputation beyond reputeAndrew Blair has a reputation beyond reputeAndrew Blair has a reputation beyond reputeAndrew Blair has a reputation beyond reputeAndrew Blair has a reputation beyond reputeAndrew Blair has a reputation beyond reputeAndrew Blair has a reputation beyond reputeAndrew Blair has a reputation beyond reputeAndrew Blair has a reputation beyond repute
Send a message via AIM to Andrew Blair Send a message via Yahoo to Andrew Blair
Timer0 Interrupt Behaviour

I'm trying to write some code (actually, modifying Kevin's) with a defunct MPlab, so unfortunately I can't check myself with a test build this weekend. I'm using timer0 as a timer, and have it configured for 10mHz (Or 100 ns). I intend to simply, every 100ns, poll some variables. I have three questions:

1. The interrupt routine is called after the timer overflows. Does it overflow at it's frequency (10mHz)?

2. Do I have to turn off the timer, before I do anything in the interrupt? And will, when executed, the code just enter back into the timer, or do I have to somehow reset it?

3. Did I screw anything else up?

Thanks, interrupts are scary.

Code:
  
void Timer_0_Int_Handler(void)
{
 // this function will be called when a timer 0 interrupt occurs
unsigned char tenth_micro_seconds;
unsigned int micro_seconds;
tenth_micro_seconds++;
 if (tenth_micro_seconds>=10)
 {
  micro_seconds++;
 }
}
__________________
Reading makes a full man, conference a ready man, and writing an exact man.
-Sir Francis Bacon

"Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction."
-Albert Einstein
 


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
Combining ADC, Serial, and Camera_s codes kaszeta Programming 6 22-01-2006 20:23
TTL port to a serial port on a demo board ImmortalAres Programming 16 09-07-2005 23:44
Accelerometer code ImmortalAres Programming 28 04-06-2005 01:02
heres the code. y this not working omega Programming 16 31-03-2004 15:18
Interrupts Questions mightywombat Programming 0 03-01-2004 14:50


All times are GMT -5. The time now is 20:29.

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