Presentation is loading. Please wait.

Presentation is loading. Please wait.

Conserve-A-Watt System Software Design Justin Rapozo.

Similar presentations


Presentation on theme: "Conserve-A-Watt System Software Design Justin Rapozo."— Presentation transcript:

1 Conserve-A-Watt System Software Design Justin Rapozo

2 General System Description MC9S12DP512 – 24MHz Bus Frequency – 16K bytes RAM, 4K bytes EEPROM, 512K bytes Flash EEPROM Memory Required – 2K bytes RAM – 36K bytes Flash EEPROM Kernel Used – MicroC/OS-II – 1 ms tick period

3 Tasks Start Task UI Task Key Task Energy Meter Task

4 Start Task Creates the User Interface Task, Energy Metering Task, and Key Task – Priority: 4 – Period: Once (at startup) – Execution Time: ~1s

5 Energy Metering Task Handles measuring energy usage of the device under test. – Irms – Vrms Calculates Preal. Calculates energy consumption in kWh. Handles the storing and deleting of energy consumption. – Priority: 5 – Period: 1ms – Execution Time: 200µs

6 Key Task Checks for key presses so as to give the user options – Priority: 6 – Period: 5ms – Execution Time: ≤ 5µs

7 UI Task Handles user inputs and Displays real time/saved energy measurements. – Priority: 7 – Period: 500ms – Execution Time: 4ms (max)

8 CPU Load EnergyMeterTask Load: 200µs/1ms = 0.2 KeyTask Load: 5µs/5ms = 0.01 UITask Load: 4ms/500ms = 0.008 Total CPU Load(Max) = 0.1+0.01+0.008 = 0.218 x 100% = 21.8% Average CPU Load = 20.8%

9 Modules ModuleTask(s)Public Functions and Data EnergyMain.cStartTask UITask KeyTask N/A Meter.cEnergyMeterTaskData: Irms, Vrms, Preal, kWh ProgFEEprom.cN/AFuntions: ConfigFECLKDIV(), FEEsectModify(), FEESectErase(), FEEWordWrite() ProjectLCD.cN/AFunctions: LcdCommand(), LcdInitialize(), LcdPutChar(), LcdMoveCursor(), LcdPutStrg() AtoD.cN/AFunctions: AtoDInitialize(), ReadCurrent(), ReadVoltage()

10 Main Dataflow Hardware EnergyMain.c Hardware Meter.c ReadCurrent() ReadVoltage() KeyTask EnergyMeterTask ButtonsLCD UITask Key Energy Flag

11 A to D Dataflow AtoD.c A/D Converter AtoDI/O AtoDInitialize() 1ms ReadCurrent() PAD00 PAD01 ReadVoltage() ATDCTL5 ADR0DR0H ADR0DR1H AN0-1 A/D

12 FlashEEPROM Dataflow FlashEEPROM UITask EnergyMeterTask EnergyMain.c Meter.c Hardware EnergyMutex Key

13 Questions? Comments?


Download ppt "Conserve-A-Watt System Software Design Justin Rapozo."

Similar presentations


Ads by Google