Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Problem #10 (15 points): This is a working simple RTOS example using two tasks.

ID: 2292429 • Letter: P

Question

Problem #10 (15 points): This is a working simple RTOS example using two tasks. The LED circuit is configured as shown below. Tick period is 1000 us Resistor LEDO pin Resistor MSP430 LED1 pin LEDO LEDI (1) What are the duty-cycles(%) measured at the LED0 and LEDI pins? (2) What are the estimation of the frequency (Hz) measured at the LEDO pin? Include vour derivations and/or explanations define TASKSTACKSIZE 512 Task Struct taskoStruct, taskiStruct; Char taskOStack [TASKSTACKSIZE],taskiStack [TASKSTACKSIZE] Semaphore Struct semStruct; Semaphore_Handle semHandle; Void task1Fxn (UArg argo, UArg arg1) while (1) Semaphore pend (semHandle, BIOS WAIT_FOREVER) GPIO write (Board LEDO, Board LED OFF) Task_sleep (500); Task_sleep ((unsigned int)arg0) Semaphore post (semHandle) Void task2Fxn (UArg argo, UArg argl) while (1) Semaphore pend (semHandle, BIOS WAIT FOREVER) GPIO write (Board_LEDO, Board_LED ON) Task_sleep (500) Task sleep ((unsigned int)arg0); Semaphore_post (semHandle);

Explanation / Answer

PWM can be used for LED brightness control including fading out LEDs rather than just turning them ON and OFF. To control the brightness of an LED we can vary the power which is sent to the LED. Using potentiometer the more the power the LED receive the brighter it is the less the power it receives the dimmer it is. Microcontroller are digital , meaning they only have power states ON and OFF. Although it is possible to supply a varying power from a microcontroller using DAC usually requires an additional chip. If over a short duration of time we turn LED on for 50% anf off for 50% then LED will appear half as bright since the total LED output over the time duration is only half as much as 100% on. By varying (or modulating ) the pulse width, light output from LED can be effectively control. Duty cycle refers to the total ammount of the time pulse is on over the duration of the cycle , so at 50% brightness the duty cycle of the LED is 50%. the cycle measured in Hz which gives cycle per second. During 20,000 microsecond the LED can be turn ON or OFF depending on the required duty cycle, a 67 % of duty cycle requires the pulse to be on for 13400 microsecond and then off for 6600 microsecond.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote