Question : Can you get a pic to do more than one thing at once?
Definitive Answer : Yes and No (answers like this is a girl thing).
Explanation : The PIC can ONLY execute one program instruction at a time at any instant in time. So technically the answer is NO. However there are two riders to this...
1. Some PICs are packed full of additional hardware. Those hardware elements operate independently from the controlling processor (although they may be synchronised and share things like the clock). So, YES, you can SIMULTANEOUSLY perform an ADC operation, Hardware PWM, Comparator Function, Capture Compare, SERIAL I/O, Op-Amp operation etc etc (providing you have a PIC with the appropriate hardware built-in) whilst your software is doing something completely different AT THE SAME TIME.
2. Whilst I said that the PIC can only execute one instruction at any given instant (and this holds true) the definition of an 'instant' is something else altogether. If you now define 'an instant' to be 1mS (one millisecond), a 40MHz PIC can execute 10,000 instructions in that 'instant'. To the casual observer, the PIC can be handling multiple software tasks simultaneously, in truth though, it is still only doing ONE thing at a time (just happens to be doing it damn quick).
So, here is where you work out EXACTLY what you need your PIC to do, and what your particular definition of 'an instant' is going to be. That will define if you can get your single PIC to perform all the tasks you need it to in your available time slot.
Bookmarks