Go to Post I tried to make them look at disgruntled as possible. - Katie_UPS [more]
Home
Go Back   Chief Delphi > Technical > Programming
Team 51   CD-Events   CD-Media   CD-Swap   CD-Spy   FRC-Spy   Unsung FIRST Heroes   WFA
portal register members calendar search Today's Posts Mark Forums Read FAQ rules
VEXpro
The Chief Delphi Forums are sponsored by Innovation First International, Inc.
Chief Delphi Alumni
ADVERTISEMENT

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 01-14-2005, 12:10 PM
Gary Bonner Gary Bonner is offline
Registered User
FRC #3974
 
Join Date: Jan 2002
Rookie Year: 2000
Location: PA
Posts: 112
Gary Bonner has a spectacular aura aboutGary Bonner has a spectacular aura about
encoder.c

I’m trying to understand encoder.c. When the left encoder's phase-A signal changes from 0 to 1, it triggers an interrupt, which invokes Left_Encoder_Int_Handler() in encoder.c. Left_Encoder_Int_Handler() determines the direction of rotation, and hence either increments or decrements Left_Encoder_Count, based on the value of rc_dig_in06 (the encoder's phase-B signal) at the time of the interrupt. When (and where) is rc_dig_in06 updated so that it has the current value when it is looked up in Left_Encoder_Int_Handler()? What variables are updated in Process_Data_From_Master_uP() in main.c every 26ms?

Thanks.
  #2   Spotlight this post!  
Unread 01-14-2005, 12:34 PM
Happy Birthday! Mr. Lim Mr. Lim is offline
i.am.INSPIRED!
AKA: Mr. Lim
FRC #0610 (Crescent Robotics)
Team Role: Engineer
 
Join Date: Jan 2004
Rookie Year: 1998
Location: Toronto, Ontario
Posts: 919
Mr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond repute
Re: encoder.c

Quote:
Originally Posted by Gary Bonner
I’m trying to understand encoder.c. When the left encoder's phase-A signal changes from 0 to 1, it triggers an interrupt, which invokes Left_Encoder_Int_Handler() in encoder.c. Left_Encoder_Int_Handler() determines the direction of rotation, and hence either increments or decrements Left_Encoder_Count, based on the value of rc_dig_in06 (the encoder's phase-B signal) at the time of the interrupt. When (and where) is rc_dig_in06 updated so that it has the current value when it is looked up in Left_Encoder_Int_Handler()? What variables are updated in Process_Data_From_Master_uP() in main.c every 26ms?

Thanks.
Gary,

I believe rc_dig_in06 is just an alias which maps directly to the address of the appropriate PORT on the PIC. This usually means that there is no need to actively update it. You should be able to access them anywhere at any time and they should return updated values without much problem.

The PWM variables (pwm01, pwm02, etc) are a different matter, and I believe those are the ones you are referring to as being updated by Process_Data_From_Master_uP() in main.c every 26ms.

-SlimBoJones...
  #3   Spotlight this post!  
Unread 01-14-2005, 12:41 PM
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 7,061
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Send a message via AIM to Alan Anderson
Re: encoder.c

Quote:
Originally Posted by Gary Bonner
When (and where) is rc_dig_in06 updated so that it has the current value when it is looked up in Left_Encoder_Int_Handler()?
rc_dig_in06 is always updated. Consider it a direct connection to the seventh digital input on the RC.
Quote:
Originally Posted by Gary Bonner
What variables are updated in Process_Data_From_Master_uP() in main.c every 26ms?
Anything that comes from the OI. That's mostly the joystick/switch inputs and the competition mode bits, plus things like user_display_mode which is changed by pressing the little button under the display on the OI.
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


All times are GMT -5. The time now is 12:19 AM.

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


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Copyright © Delphi and Pontiac Central High School