Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
05/23/06 13:42
Modified:
  05/23/06 13:51

Read: times


 
#116921 - Capture registers
Responding to: ???'s previous message
Michael said:
let's say an interrupt has arrived and the value of timer2 has been saved into CT01...

org800Bh (Adress of Timer Interrupt SFR)

mov r0,#30h ;30 moved into indirect adressable register0
mov @r0,CT0I ;capture copied to 30h
reti

The count ot timer2 is captured in CTL0# and CTH0#, with the adresses ACH and CCH (remember, timer2 is a 16bit counter!). So, you need to save these registers in the ISR (interrupt sub routine).
You can also set a flag in the ISR to show the main program, that a capture event has occured.

Michael said:
but how to go on now?
now i've to move the capture again away from 30h, because if the next capture arrives, 30h will be erased too...

The main program knows two captured values: The old and new one. When the main program notices, that a new one has arrived (with the help of flag bit) then it moves the last new one to the address of old one and the actual new one to the address of new one. It also resets the flag. Now the main program builds the difference and displays the result.
Afterwards the main program looks again for the flag being set and again does what I wrote above, if so.

Kai

List of 51 messages in thread
TopicAuthorDate
measuring illumination by tsl220            01/01/70 00:00      
   sh.. project            01/01/70 00:00      
   PROCESSOR !            01/01/70 00:00      
      processor 80c552            01/01/70 00:00      
         why CCU? KISS            01/01/70 00:00      
            ccu is necessary            01/01/70 00:00      
               who is making it?            01/01/70 00:00      
                  well, thats true but....            01/01/70 00:00      
         Look at this            01/01/70 00:00      
   any programmes?            01/01/70 00:00      
      why not source code 1??            01/01/70 00:00      
         programmes=source codes;)            01/01/70 00:00      
            I agree            01/01/70 00:00      
               ok            01/01/70 00:00      
                  You are a lazy bone!!            01/01/70 00:00      
               source code 1            01/01/70 00:00      
                  you have still not explained ...            01/01/70 00:00      
   You need frequency counter. Look here.            01/01/70 00:00      
   elaborationg on simple solution            01/01/70 00:00      
      relax            01/01/70 00:00      
         blatantly untrue            01/01/70 00:00      
            please apologize            01/01/70 00:00      
               Timer2-what for?            01/01/70 00:00      
                  here's the exact definition of the prblm            01/01/70 00:00      
                     how do i attach files in the postings?            01/01/70 00:00      
                        Posting file listings            01/01/70 00:00      
                     Have a look again...            01/01/70 00:00      
                        ok, i'll do this immediately.            01/01/70 00:00      
                     Capture registers            01/01/70 00:00      
                     E-mail address            01/01/70 00:00      
                        mail adress            01/01/70 00:00      
   next problem            01/01/70 00:00      
      not spilling the beans            01/01/70 00:00      
   link forgotten sorry            01/01/70 00:00      
      In english...            01/01/70 00:00      
      CPT registers            01/01/70 00:00      
         maybe at this time he is in his little            01/01/70 00:00      
            happy about all postings            01/01/70 00:00      
               re flag            01/01/70 00:00      
                  re:re:flags            01/01/70 00:00      
                     You have to set the flag!            01/01/70 00:00      
         Do you have a simulator?            01/01/70 00:00      
            re:simulator            01/01/70 00:00      
               Single Stepping            01/01/70 00:00      
   save capture before next capture            01/01/70 00:00      
      Capture registers            01/01/70 00:00      
   The cookbook            01/01/70 00:00      
   code finished, but small error            01/01/70 00:00      
      atomicity            01/01/70 00:00      
      Who is Hans Meiser???            01/01/70 00:00      
         hans meiser!            01/01/70 00:00      

Back to Subject List