Go to Post This is proof we can change the world. - Al Skierkiewicz [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 14-01-2005, 13:10
Gary Bonner Gary Bonner is offline
Registered User
FRC #3974
 
Join Date: Jan 2002
Rookie Year: 2000
Location: PA
Posts: 115
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 14-01-2005, 13:34
Mr. Lim Mr. Lim is offline
Registered User
AKA: Mr. Lim
no team
Team Role: Leadership
 
Join Date: Jan 2004
Rookie Year: 1998
Location: Toronto, Ontario
Posts: 1,125
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 14-01-2005, 13:41
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: 9,112
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
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 04:44.

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