??? 09/11/08 07:45 Read: times |
#158170 - Why not reading from main loop? Responding to: ???'s previous message |
Exactly why isn't it working to read the pins every time?
You normally don't want to perform your actions in an interrupt handler - unless the actions are basically limited to toggling other pins. Somewhere you need a main loop that performs the actions. This main loop must either poll the actual pins, or variables representing the requestes detected by some other code. And the main loop must be fast enough that it gives the required response time from a pin-change until the action is done. Depending on your requirements, the main loop may have to be able to perform many actions in case many pins changes at the same time, and still be fast enough to detect further changes. Using interrupts, timers etc are most useful if need to poll the pins at a higher frequency than you need to perform any actions - for example because you are filtering the signals and require that a pin is active a minimum time to trig an event. |
Topic | Author | Date |
HELP:regular monitoring of inputs 8051 | 01/01/70 00:00 | |
Use a timer ? | 01/01/70 00:00 | |
Explain | 01/01/70 00:00 | |
NOT WORKING | 01/01/70 00:00 | |
instant doesn't exist | 01/01/70 00:00 | |
Make your mind up! | 01/01/70 00:00 | |
bounce | 01/01/70 00:00 | |
Sounds strange ... | 01/01/70 00:00 | |
sampling | 01/01/70 00:00 | |
Please post legible source code | 01/01/70 00:00 | |
What debounce? | 01/01/70 00:00 | |
code | 01/01/70 00:00 | |
Did you check the preview? | 01/01/70 00:00 | |
Broken code | 01/01/70 00:00 | |
indentation | 01/01/70 00:00 | |
Simulation | 01/01/70 00:00 | |
Regular | 01/01/70 00:00 | |
Why not reading from main loop? | 01/01/70 00:00 | |
PLEASE HELP | 01/01/70 00:00 | |
have a look at Rate This Post | 01/01/70 00:00 | |
Study the state machine tutorial... | 01/01/70 00:00 | |
Is it here?![]() | 01/01/70 00:00 |