persistence of vision display
DESCRIPTION
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. - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Persistence OF Vision Display](https://reader036.vdocument.in/reader036/viewer/2022062411/56816930550346895de0792e/html5/thumbnails/1.jpg)
PERSISTENCEOF VISION
DISPLAY
Software Design Review
Andres Rodriguez
![Page 2: Persistence OF Vision Display](https://reader036.vdocument.in/reader036/viewer/2022062411/56816930550346895de0792e/html5/thumbnails/2.jpg)
General System Design MCU: STM32F405 MCU Bus Frequency: 84MHz Memory Requirements Flash: ~ 10Kb RAM: ~ 15Kb
Kernel: FreeRTOS RTOS Tick period 1ms
![Page 3: Persistence OF Vision Display](https://reader036.vdocument.in/reader036/viewer/2022062411/56816930550346895de0792e/html5/thumbnails/3.jpg)
Kernel Selection Real-time preemptive
multitasking kernel
FreeRTOS
3. Start Task4. OutputLED Task5. Bluetooth Receive Task6. Motor Control Task7. LEDBufferUpdate Task
Priority of tasks
![Page 4: Persistence OF Vision Display](https://reader036.vdocument.in/reader036/viewer/2022062411/56816930550346895de0792e/html5/thumbnails/4.jpg)
Start TaskDescription:
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
![Page 5: Persistence OF Vision Display](https://reader036.vdocument.in/reader036/viewer/2022062411/56816930550346895de0792e/html5/thumbnails/5.jpg)
Bluetooth TaskDescription:
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%
![Page 6: Persistence OF Vision Display](https://reader036.vdocument.in/reader036/viewer/2022062411/56816930550346895de0792e/html5/thumbnails/6.jpg)
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.
![Page 7: Persistence OF Vision Display](https://reader036.vdocument.in/reader036/viewer/2022062411/56816930550346895de0792e/html5/thumbnails/7.jpg)
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%
![Page 8: Persistence OF Vision Display](https://reader036.vdocument.in/reader036/viewer/2022062411/56816930550346895de0792e/html5/thumbnails/8.jpg)
LEDOutput TaskDescription:
Reads LED Buffer and outputs it to the LEDs at the correct refresh rate. Pends on mutex to acces LEDBuffer. 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%
![Page 9: Persistence OF Vision Display](https://reader036.vdocument.in/reader036/viewer/2022062411/56816930550346895de0792e/html5/thumbnails/9.jpg)
LEDBuffUpdate TaskDescription:
Pends on a semaphore to read text and colors from structure and then waits for LEDBuff mutex 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
![Page 10: Persistence OF Vision Display](https://reader036.vdocument.in/reader036/viewer/2022062411/56816930550346895de0792e/html5/thumbnails/10.jpg)
CPU load
L max= (20us) + (1.6ms) + (110us) + (4.12ms)
(200ms) (40 ms) (220us) (500ms)
L max= 54.83%
L average = 51.9 %
![Page 11: Persistence OF Vision Display](https://reader036.vdocument.in/reader036/viewer/2022062411/56816930550346895de0792e/html5/thumbnails/11.jpg)
ModulesModule Tasks Public Functions DataMain.c Start Task
Bluetooth.cAdapted From STM32F4_USART Sample
BTReceiveTask Bluetooth_Init();Bluetooth_Put();SetMotorEnable();
LEDUpdate SemaphoreUserInput Structure
SPICom.c
Adapted From STM32F4_SPI Sample
LEDSPI_Init();RPMSPI_Init();LEDSPI_Send();RPMSPI_Send();
MotorControl.c MotorControlTask PWM_init(); Power Motor variableMotor Speed variable
LEDs.c OutputLED TaskLEDBuffUpdate Task
UpdateLEDBuff();GetMotorSpeed();GetColors();
LEDBuffer Array
![Page 12: Persistence OF Vision Display](https://reader036.vdocument.in/reader036/viewer/2022062411/56816930550346895de0792e/html5/thumbnails/12.jpg)
Dataflow Diagram
![Page 13: Persistence OF Vision Display](https://reader036.vdocument.in/reader036/viewer/2022062411/56816930550346895de0792e/html5/thumbnails/13.jpg)
Questions?