Thread: encoder.c
View Single Post
  #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...