4 ms·
Indeed. It doesn't really matter as long as the firmware reliably does what it needs to do. A lot of MCUs only have one CPU, and so interrupts are one of the fe
by sgtnoodle 4y ago
Indeed. It doesn't really matter as long as the firmware reliably does what it needs to do. A lot of MCUs only have one CPU, and so interrupts are one of the features to allow multi-tasking in a predictable way. If you only have one thing to do, then go ahead and stick it in a main loop. If you only have two things to do, then spending a bunch of CPU cycles in an interrupt handler might not be a problem at all. If you're working on a sufficiently complex embedded system with a bunch of competing real-time goals, you learn to be very careful with what your CPU is doing at any given time.
Quite often, "inefficient" interrupt based or bit-banged peripheral drivers are the right answer, even if the hardware supports DMA. It all depends on the complexity of the application and how much time and money you have.