| ??? 10/29/98 04:12 Read: times |
#21 - RE: Timers written in C |
If you're going to execute an interrupt 22,000 times per second, I hope your interrupt is REALLY small. With a 12MHZ crystal you have 1 million instruction cycles per second available. Divide that by 22,000 and you get about 45 instruction cycles. Assume that the "average" instruction requires 1.5 instruction cycles and that means you can execute a maximum of about 30 instructions per interrupt--and that assumes your program does nothing but handle the interrupts, nothing else.
In other words, 22000 interrupts per second is pretty ambitious--and if you're writing it in 'C' it's going to be almost impossible. Unless you're using some high-performance chip with a high crystal speed or an efficient derivative such as the Dallas 80C320 that can do things faster. Is there any way you can accomplish your task with a lower number of interruptions per second? The number 22000 strikes me as probably having something to do with A/D or D/A conversion since it's approximately half the sample rate of a CD. Are there any other options you could integrate into your project to assist you with the A/D or D/A conversion? Good luck, Craig Steiner |
| Topic | Author | Date |
| Timers written in C | 01/01/70 00:00 | |
| RE: Timers written in C | 01/01/70 00:00 | |
RE: Timers written in C | 01/01/70 00:00 |



