![]() |
|
|
www.southgatearc.org
|
Micro-controllers - Interrupts and TimersThis week we will discuss interrupts and timers. Interrrupts. Imagine reading a book, and then your wife interrupts you to mop the floor. Complying immediately, you gleefully put the book down, mop the floor and return to the book from where you left off, awaiting the next interruption at any time. In a similar way, a microcontroller can go along doing its normal tasks, and then receive a signal called an interrupt (from software or a hardware input pin) which tells it to stop, go service the interrupt, then return to where it left off. This a very a useful method if, for example, you want to use the interrupt to handle some routine when, say the PTT button is depressed on a microphone. Another method is achieved through polling. A similar analogy is going to the letter box every 10 minutes to see if that rig you ordered though the mail has arrived. With a microcontroller for example, you might want to poll whether the PTT is depressed every 100mS. This is achieved though a simple loop in software. Timers. Timers can cause an interrupt when the time (determined by the number of clock cycles and divider logic) exceeds a limit. This can be used for many purposes, like toggling the level of a square wave output at a pin, say, every second. Next time we will wrap up the microcontroller series with some valuable tips on where to go from here.
David, VK3DRB
Source: Wireless Institute of Australia
|
|
|
Other News Stories Get our news headlines for your website - click here
|
|
|
|||||||||||
|
|
||||||||||||
|
| |
|
| Home
| For
Sale & Wanted | Tell
a friend | Guestbook
| Cast Your Vote | Newsboard
| Amateur Radio
Forum | Links | Diary
Dates | | Games | SWLs | 'How To' Guides | Humour | Data Comms | Lottery | Amateur TV | Contests | Can You Help? | Contact Us | 10 Metres | | Clubs Worldwide | Subscribe to our Newsletter | | |
|
| |