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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
04/15/08 13:37
Read: times


 
#153381 - Re: As mentioned
Responding to: ???'s previous message
Hello Chris,

My main problem was with your rather casual choice of the word SHOULD. Especially for a noob, as the OP obviously is, whatever they read they easily misunderstand as gospel, while all you meant to express was your personal preference. Please take my friendly advice: if you want to explain something to somebody who is almost a complete blank, every word counts and they all should be chosen very carefully. Maybe YOU know what you MEAN, but a reader only sees what you WROTE!
The use of the term "high memory" is never used in connection with the '51's architecture, and could cause confusion with those who do know this phrase from (old) PC memory architecture.
Finally, I see no advantage over using a call rather than a jump, or why it should be an absolute one at that. IF I can't cram an ISR into 8 bytes, as is almost always the case, I will immediately JMP out of there to continue elsewhere in code space, end leave it to the assembler whether that will translate into an AJMP or an LJMP.

ISR: JMP ISR_EXTENDER
...
ISR_EXTENDER: Do stuff
RETI

To the OP,

I'd like to advise you to reconsider seeing the external interrupt inputs as ideally suited for connecting pushbuttons to.
Pushbuttons are not ideal components, and upon pushing or releasing them they uncontrollably, rapidly bounce between on and off a couple of times before settling in their new state. This will rapidly trigger an external interrupt multiple times each time you push or release the button, which is not your intention.
The more common way to deal with pushbuttons is to connect them to any input pin (possibly even in a matrix configuration) and to periodically (say every 10 or 20ms) read them. This is most commonly done by means of a timer ISR. In the timer ISR, after the reading, you should then look at the button's history to see if the button could be bouncing or if it's stable (you need to see the button on for at least two consequtive scans before considering it really on, otherwise you could consider it off). This is called debouncing. Finally, the actual processing of the debounced button information, in your case set a corresponding output, is usually done in the main loop.


List of 18 messages in thread
TopicAuthorDate
8051 interrupt            01/01/70 00:00      
   what language?            01/01/70 00:00      
      8051            01/01/70 00:00      
         Ok            01/01/70 00:00      
            Re: OK            01/01/70 00:00      
               As mentioned            01/01/70 00:00      
                  High, higher, highest...            01/01/70 00:00      
                  Re: As mentioned            01/01/70 00:00      
                     My words are not casual......            01/01/70 00:00      
            It's assembler            01/01/70 00:00      
   this may be help            01/01/70 00:00      
      external trigger address            01/01/70 00:00      
         Read the tutorials...            01/01/70 00:00      
         Check the emulator manual            01/01/70 00:00      
            +800            01/01/70 00:00      
               read andy's post above            01/01/70 00:00      
               RE: Does this make sense to you?            01/01/70 00:00      
   I am sorted            01/01/70 00:00      

Back to Subject List