??? 08/16/06 20:13 Read: times Msg Score: +1 +1 Good Answer/Helpful |
#122371 - the controller task Responding to: ???'s previous message |
In general, the task of a microcontroller can be summed up quite simply:
(1) examine inputs (2) take appropriate action (3) go to 1 Examining and interpreting the inputs is the key, of course, and, combined with the current state of the system, one determines the appropriate action and executes it. If you had no interrupts, you'd examine the inputs as frequently as possible and practical, interpret them and take appropriate action. Examining and interpreting inputs is a job that increases in complexity with the number and type of inputs. If, however, one can dedicate an interrupt to an input, then examining THAT input and interpreting its place in the greater scheme of things is essentially handled, or, at least, can be, by virtue of the fact that it essentially inserts the appropriate action in the form of the ISR at whatever point in the instruction stream that "blessed" event occurs. It can, therefore, be seen as simplifying the remaining code as well as simplifying the task of handling that particular event. RE |