Based on an 8051 microcontroller with an oscillator of 12MHz,Explain succinctly how you would design?
Based on an 8051 microcontroller, you are required to design a scheduler that controls four processes. Each process sends a message to a particular sensor, at least every 100millisecond. Each process should run sequentially forever (similar to traffic lights). Suppose that the microcontroller is based on a regular 8051 with an oscillator of 12MHz. You do not need to get involved in the procedure for sending a message. Explain succinctly how you would design the mentioned controller. Explain how you would use the timers and the corresponding value of their register. What would be the interrupt associated with each one of the events
Public Comments
- This is a pretty easy task! At reset, set-up the four processes and for each, a global flag variable, set to "false". Use timer 1 to switch between processes, executing a few instructions on each. This makes it "multitasking" (running four processes "at the same time"). Use Timer 2 to create an interrupt every 100 ms (that depends, of course, of your CPU clock speed). When a process completes its cycle, set its corresponding flag to true. When timer 2 interrupts, check each of the four flags. If true, send the corresponding message, reset the flag. (Can't be more precise without the details of all processes involved, but that is a general idea). PS: don't ask me later to write the ASM: that's YOUR job!
Powered by Yahoo! Answers