Presentation is loading. Please wait.

Presentation is loading. Please wait.

Software Design Review Andres Rodriguez. General System Design  MCU: STM32F405  MCU Bus Frequency: 84MHz  Memory Requirements  Flash: ~ 10Kb  RAM:

Similar presentations


Presentation on theme: "Software Design Review Andres Rodriguez. General System Design  MCU: STM32F405  MCU Bus Frequency: 84MHz  Memory Requirements  Flash: ~ 10Kb  RAM:"— Presentation transcript:

1 Software Design Review Andres Rodriguez

2 General System Design  MCU: STM32F405  MCU Bus Frequency: 84MHz  Memory Requirements  Flash: ~ 10Kb  RAM: ~ 15Kb  Kernel: FreeRTOS RTOS Tick period 1ms

3 Kernel Selection  Real-time preemptive multitasking kernel FreeRTOS 3. Start Task 4. OutputLED Task 5. Bluetooth Receive Task 6. Motor Control Task 7. LEDBufferUpdate Task Priority of tasks

4 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

5 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%

6 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.

7 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%

8 LEDOutput Task Description: 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%

9 LEDBuffUpdate Task Description: 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

10 CPU load L max= (20us) + (1.6ms) + (110us) + (4.12ms) (200ms) (40 ms) (220us) (500ms) L max= 54.83% L average = 51.9 %

11 Modules ModuleTasksPublic FunctionsData Main.cStart Task Bluetooth.c Adapted From STM32F4_USART Sample BTReceiveTask Bluetooth_Init(); Bluetooth_Put(); SetMotorEnable(); LEDUpdate Semaphore UserInput Structure SPICom.c Adapted From STM32F4_SPI Sample LEDSPI_Init(); RPMSPI_Init(); LEDSPI_Send(); RPMSPI_Send(); MotorControl.cMotorControlTaskPWM_init(); Power Motor variable Motor Speed variable LEDs.cOutputLED Task LEDBuffUpdate Task UpdateLEDBuff(); GetMotorSpeed(); GetColors(); LEDBuffer Array

12 Dataflow Diagram

13 Questions?


Download ppt "Software Design Review Andres Rodriguez. General System Design  MCU: STM32F405  MCU Bus Frequency: 84MHz  Memory Requirements  Flash: ~ 10Kb  RAM:"

Similar presentations


Ads by Google