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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
01/13/06 14:27
Read: times


 
#107289 - never us a register for a dedicated purp
Responding to: ???'s previous message
The optical encoder is connected to port 2 pin 2 and goes high when triggered,i was thinking maybe i should use port3 pin 2(INT0\bar) and wont have to use the timer as a counter but i fall short on how to use this external interrupt.
1) why "wont have to use the timer as a counter"
2) if using int0 just inc DATA variable
3) using T2 gives you a 16 bit count, do you need more

AGAIN:
which derivative are you using?

If the interruted does occur i need to incerment r1 so when i return from the subroutine i can display it on a 7 seg display.
For example P2.2 goes high 6 times in 5 seconds r1 will read 6 so later i can display the content R1.

never us a register for a dedicated purpose, use a variable. Sure, it will "work" if you are careful, but you set a trap for errors occurring with every change to the code.

Erik

List of 17 messages in thread
TopicAuthorDate
timer/ counter            01/01/70 00:00      
   clarify            01/01/70 00:00      
   To rephase my Question            01/01/70 00:00      
      what is "the event counter"            01/01/70 00:00      
         Event counter explained            01/01/70 00:00      
            I know what the datasheet (the "bible")            01/01/70 00:00      
   Try prioritizing            01/01/70 00:00      
      About Prioritizing            01/01/70 00:00      
      Priority            01/01/70 00:00      
   Should of been original question sorry !            01/01/70 00:00      
      a few comments            01/01/70 00:00      
         i dont have to stick to P2.2            01/01/70 00:00      
            never us a register for a dedicated purp            01/01/70 00:00      
               Thanks for tip            01/01/70 00:00      
                  you do not need that            01/01/70 00:00      
               thanks            01/01/70 00:00      

Back to Subject List