180 likes | 686 Views
Software Design Review. Persistence OF Vision Display. Andres Rodriguez. General System Design. MCU: STM32F405 MCU Bus Frequency: 84MHz Memory Requirements Flash: ~ 10Kb RAM: ~ 15Kb Kernel: FreeRTOS RTOS Tick period 1ms. Kernel Selection. FreeRTOS.
E N D
Software Design Review PersistenceOF Vision Display Andres Rodriguez
General System Design • MCU: STM32F405 • MCU Bus Frequency: 84MHz • Memory Requirements • Flash: ~ 10Kb • RAM: ~ 15Kb • Kernel: FreeRTOS • RTOS Tick period 1ms
Kernel Selection FreeRTOS • Real-time preemptive multitasking kernel Priority of tasks • Start Task • OutputLED Task • Bluetooth Receive Task • Motor Control Task • LEDBufferUpdate Task
Start Task Description: Initializes system, Creates other tasks and Sets semaphores and Flags to proper value to Ensures POV does not run until the User hits the “ON” button • Priority #3 • Period: once (at start-up) • Execution time ~ 10ms • Average CPU Load N/A
Bluetooth Task Description: Every 40ms checks for incoming Bluetooth data. If data ready to receive, receives first byte and uses it to sort the rest of the incoming data onto appropriate index of a structure and also sets variable used by Motor module to enable or disable motor. • Priority #5 • Period: 40 ms (Periodic) • Execution time ~ 430us • Execution time ~ 1.6ms (max) • Average CPU Load = 1.07 % • Peak CPU Load = 4%
User InterFace (App) Description: Allows user to turn motor on and off, change background color, change text color, enter text or choose pre-programmed animations.
Motor Task Description: • Checks the MotorEnable variable to Enable or disable Motor. Maintains motor speed as close as possible to 1500 RPM and saves it to a variable that Output LED task can access Via mutex • Priority #6 • Period: 200 ms(Periodic) • Execution time ~ 20 us (max) • Average CPU Load = 0.01%
LEDOutput Task Description: Reads LED Buffer and outputs it to the LEDs at the correct refresh rate. Pends on mutex to accesLEDBuffer. Gets MotorSpeed from motor module to determine LED refresh rate. • Priority #3 • Period: 220 usec(Periodic) updating 180 times per revolution • Execution time ~ 110us (max) • Avg CPU Load: 50%
LEDBuffUpdate Task Description: Pends on a semaphore to read text and colors from structure and then waits for LEDBuffmutex to update the LEDBuff with the new buffer. • Priority #7 • Period: sporadic • Execution time ~ 4.12 ms (max) assuming the array is for updating 180 times per revolution. • CPU Load: 0.824% Assuming Semaphore gets set every 500 ms
CPU load L max= (20us) + (1.6ms) + (110us) + (4.12ms) (200ms) (40 ms) (220us) (500ms) L max= 54.83% L average = 51.9 %