To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.handyboardOpen lugnet.robotics.handyboard in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / Handy Board / 1942
1941  |  1943
Subject: 
Re: NOTE 04/10/97 10:50:15
Newsgroups: 
lugnet.robotics.handyboard
Date: 
Mon, 14 Apr 1997 19:38:43 GMT
Original-From: 
Jeffrey Strauss Morehead <(morehead@)nomorespam(ece.utexas.edu)>
Viewed: 
3893 times
  
OK, I haven't looked at encoders.asm but if the following doesn't help
just send more questions.


On 10 Apr 1997, Ericson Mar wrote:

>      Hi,
> 
>      Can someone help me understand encoders.asm?
> 
>      This is what I deduced from the code and I'm wondering if my guess is
>      correct.
> 
>      1. When TIC3 and TIC2 inputs are changed, an "interrupt" in execution
>      occurs and and execution immediately jumps to the address stored at
>      the location TIC3INT and TIC2INT. (In this case, Port0_ShaftInt,
>      Port1_ShaftInt)

Sounds about right.

> 
>      2. But for the interrupt to actually execute, TLFLG1 must allow it.

TCTL2 sets rising, falling, or both edge modes; TMSK1 arms interupts; IC
event sets the TFLG1 register.

>  For TIC3 and TIC2, this must be true:
> 
>      TLFLG1 =  %XXXXXXX1     ->   TIC3 change causes an interrupt
>      TLFLG1 =  %XXXXXX1X     ->   TIC2 change causes an interrupt

correct

>      TLFLG1 becomes %-------1 and %------1- on TIC3 and TIC2 changes
>      respectively. So each bit must be turned off by the line
>      BCLR   TLFLG1,X %11111110      and
>      BCLR   TLFLG1,X %11111101      respectively,
correct

>      otherwise, the interrupt will keept on executing after the very first
>      change in state of TIC3 or TIC2, respectively.

>      3. TCLT2 stores a byte which when set to %00001111, makes the TIC3 and
>      TIC2 interrupts happen when either inputs change state from 0 to 1.
>      (What is at TCLT2 to make it interrupt on a 1 to 0 change?)

answer: TCTL2=0A =%00001010

TCTL2 bit 7 6 5 4 3 2 1 0
          0 0 EDG1B EDG1A EDG2B EDG2A EDG3B EDG3A
   PA2 mode    PA1 mode    PA0 mode

EDGxB EDGxA Input Capture Function
0 0 disabled
0 1 rising edge
1 0 falling edge
1 1 both rising and falling edges

Hope this helps
jm



Message is in Reply To:
  NOTE 04/10/97 10:50:15
 
Hi, Can someone help me understand encoders.asm? This is what I deduced from the code and I'm wondering if my guess is correct. 1. When TIC3 and TIC2 inputs are changed, an "interrupt" in execution occurs and and execution immediately jumps to the (...) (30 years ago, 10-Apr-97, to lugnet.robotics.handyboard)

2 Messages in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR