Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
01/18/03 14:22
Read: times


 
#36731 - RE: can 8051 do multi tasking?
There are 3 things that can be running independently in a basic '51:

-The CPU (Main thread of execution)
-The Timers
-The Serial interface

You need to set the Timer and Serial buffer (the On-chip Peripherals)in the Main thread of execution, each of which can then carry on with whatever it does. Whenever any of the peripherals encounters an event, it can generate an interrupt that diverts the main thread to service that event. Once the Interrupt Service Routine (ISR) is over, the main thread resumes where it was interrupted.

Synchronization with external events can be done with the External Interrupts.

Sometimes there are more onchip peripherals than just Timers and UART, and each of these may have its own interrupts.

Now you can use this basic framework to do any "multitasking" you may need to do. If you want some other system to do this for you, you are talking RTOS and in general an RTOS is not suitable or even needed for most '51 applications.

In your example use a timer to handle the timing of the square wave, so that in between the interrupts, the CPU is free to do whatever task you need it to do.

kundi

List of 13 messages in thread
TopicAuthorDate
can 8051 do multi tasking?            01/01/70 00:00      
RE: can 8051 do multi tasking?            01/01/70 00:00      
RE: can 8051 do multi tasking?            01/01/70 00:00      
RE: can 8051 do multi tasking?            01/01/70 00:00      
RE: can 8051 do multi tasking?            01/01/70 00:00      
RE: can 8051 do multi tasking?            01/01/70 00:00      
RE: can 8051 do multi tasking?            01/01/70 00:00      
RE: can 8051 do multi tasking?            01/01/70 00:00      
RE: can 8051 do multi tasking?            01/01/70 00:00      
RE: can 8051 do multi tasking?            01/01/70 00:00      
RE: can 8051 do multi tasking?            01/01/70 00:00      
RE: can 8051 do multi tasking?            01/01/70 00:00      
RE: can 8051 do multi tasking?            01/01/70 00:00      

Back to Subject List