Go to Post It is critical to our continued growth and success to recognize, and to make others realize, THERE ARE NO OPPONENTS. - 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

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 11-02-2005, 22:58
psquared psquared is offline
Registered User
no team
Team Role: Programmer
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Chantilly
Posts: 34
psquared is an unknown quantity at this point
Accelerometer Timer Question

I am looking over the accelerometer code tonight, this way when i go in to program tomorrow, I'll be able to get started right away. I was looking over Kevin Watson's accelerometer code and I think I am understanding it, but I had a few questions.

The void Timer_2_Int_Handler is what contains all of the code to actually calculate the current acceleration of the robot, and update that acceleration. (I hope I am right here, otherwise i think im gonna be in trouble ) The void information says that it is called from user_routines_fast.c/InterruptHandlerLow(). This is where I am confused. Since we initialize the accelerometer with Initialize_Timer_2 which says it starts the timer, do I have to call this void (Timer_2_Int_Handler) in my user_routines.c or will it be automatically called. The reason why I am curious is b/c in the _fast.c code it shows the Timer_2_Int_Handler, but the _routines.c code is able to use the Get_Acceleration function and that stops the timer and returns the current acceleration, but how can Get_Acceleration work if i don't call Timer_2_Int_Handler in _routines.c.
I hope i was clear in my confusion, sorry if i wasn't.
So in short, do i need to call Timer_2_int_Hanlder in my user_routines.c code, or does the timer do it, and therefore all i need to do is call the get_acceleration?

Thanks for help with that question, and sorry if i made it more confusing then it was.

My other question deals with what analog port the code specifies for the accelerometer. I think it is the first analog port? Also how would I change the accelerometer.c code to change the port?

Thanks (in advance) for helping us out.
  #2   Spotlight this post!  
Unread 11-02-2005, 23:05
Unsung FIRST Hero
Mike Betts Mike Betts is offline
Electrical Engineer
no team
Team Role: Engineer
 
Join Date: Dec 2001
Rookie Year: 1995
Location: Homosassa, FL
Posts: 1,442
Mike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond repute
Re: Accelerometer Timer Question

Quote:
Originally Posted by psquared
I am looking over the accelerometer code tonight, this way when i go in to program tomorrow, I'll be able to get started right away. I was looking over Kevin Watson's accelerometer code and I think I am understanding it, but I had a few questions.

The void Timer_2_Int_Handler is what contains all of the code to actually calculate the current acceleration of the robot, and update that acceleration. (I hope I am right here, otherwise i think im gonna be in trouble ) The void information says that it is called from user_routines_fast.c/InterruptHandlerLow(). This is where I am confused. Since we initialize the accelerometer with Initialize_Timer_2 which says it starts the timer, do I have to call this void (Timer_2_Int_Handler) in my user_routines.c or will it be automatically called. The reason why I am curious is b/c in the _fast.c code it shows the Timer_2_Int_Handler, but the _routines.c code is able to use the Get_Acceleration function and that stops the timer and returns the current acceleration, but how can Get_Acceleration work if i don't call Timer_2_Int_Handler in _routines.c.
I hope i was clear in my confusion, sorry if i wasn't.
So in short, do i need to call Timer_2_int_Hanlder in my user_routines.c code...
Do you have to look at an alarm clock for it to ring? No. It goes off when you tell it to. So does an interrupt... You do not call it.
__________________
Mike Betts

Alumnus, Team 3518, Panthrobots, 2011
Alumnus, Team 177, Bobcat Robotics, 1995 - 2010
LRI, Connecticut Regional, 2007-2010
LRI, WPI Regional, 2009 - 2010
RI, South Florida Regional, 2012 - 2013

As easy as 355/113...
  #3   Spotlight this post!  
Unread 11-02-2005, 23:14
psquared psquared is offline
Registered User
no team
Team Role: Programmer
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Chantilly
Posts: 34
psquared is an unknown quantity at this point
Re: Accelerometer Timer Question

Ok, thanks, that is what I thought, i just wasn't sure, b/c it was called in _fast.c and that didn't make any sense to me, especially since it is a timer.
  #4   Spotlight this post!  
Unread 12-02-2005, 01:34
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,571
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Accelerometer Timer Question

Just to clarify, Timer_2_Int_Handler is called from InterruptHandlerLow which is called from InterruptVectorLow which is automatic.
Closed Thread


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
Example accelerometer code released. Kevin Watson Programming 0 20-01-2005 03:45
Question of the Week!!! (7/19/04) Andy Grady General Forum 23 23-07-2004 13:21
Question of the Week!!! (6/14/04) Andy Grady General Forum 23 01-07-2004 15:54
Timer interrupt hic-cupping - HELP roknjohn Programming 9 15-03-2004 17:56
Interrupt timer, executing code asap? SeanCassidy Programming 10 07-03-2004 01:47


All times are GMT -5. The time now is 15:56.

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