Presentation is loading. Please wait.

Presentation is loading. Please wait.

System Software Design and Documentation Zach Hill Western Washington University.

Similar presentations


Presentation on theme: "System Software Design and Documentation Zach Hill Western Washington University."— Presentation transcript:

1 System Software Design and Documentation Zach Hill Western Washington University

2 General System Design MCU – Freescale MC9S12DP512 Bus Frequency of 16MHz Memory Requirements  12kB RAM  256kB Flash  4kB EEPROM MicroC/OS-II  Tick period ~ 1mS

3 Tasks Start Task User Interface Task Key Task SPI Task

4 ISRs MP3_ISR USB_ISR

5 Task Design Main:  Initializes I²C, SPI, MicroC/OS-II, and LCD  Creates Start Task Start Task:  Displays Boot up message  Initializes USB, PWM, Key  Creates Other Tasks  Task Priority: 4  Task Period – once

6 Task Design SPI Task  Waits for semaphore from MP3_ISR and USB_ISR  Sends or receives data over SPI depending on the semaphore posted  Priority: 5  Execution Time: ??  Period: ??

7 Task Design User Interface  Handles button presses from user  Task Priority: 6  Execution Time: 4 mS  Task Period: 10 mS  CPU Load:.4

8 Task Design Key Task  Scans buttons, if one was pressed updates buffer  Priority: 7  Task Period: 10 mS  Execution Time: 50 uS  CPU Load:.005

9 MP3_ISR Generates a semaphore when Data Request pin on the MP3 decoder goes high Period: 1 mS (Sporadic) Execution time ~ 291 nS (max)

10 USB_ISR Generates a semaphore when SPI ready pin on USBWiz OEM board goes high Period: 1 mS (Sporadic) Execution time ~ 291 nS (max)

11 Overall CPU Load CPU load L max=.4 +.005 +.000291 +.000291 =.405582 L max= 40.56% L average = 20.2%

12 Kernel Selection MicroC/OS-II  Real-time preemptive multitasking kernel

13 Modules TasksPublic Functions and Data MP3_SPKR.cStart Task UserInterface Task SPI Task LCD.c-LcdInit() LcdMoveCursor() LcdPutStrg() LCDClrLine() UcosKey.cKey Task IIC.c-ReadIIC() WriteIIC() SPI.c-InitSPI() WriteSPI() ReadSPI() ProgEeprom.c-ConfigECLKDIV() EESectModify() EESectErase() EEWordWrite()

14 Dataflow Diagram Buttons Button Input KeyTask() KeyCodeTable key KeyFlag Button Driver ModuleApplication KeyInit() KeyPend()

15 Dataflow Diagram LCD I/OLCD Module Application UITask()

16 Dataflow Diagram SPI I/OSPI Module SPITask() USB_DATARDYMP3_RDY MP3 Data to decoder MP3 Data From USB

17 Dataflow Diagram IIC I/OIIC Module IIC Decoder Control Commands PWM Control Commands Application UITask()

18 Dataflow Diagram ISR PORTH ISR MP3_Isr MP3_RDY SPITask SPI.cMP3_SPKR.cInterrupt PostPend

19 Dataflow Diagram ISR SCI ISR USB_Isr USB_DATARDY SPITask SPI.cMP3_SPKR.cInterrupt PostPend


Download ppt "System Software Design and Documentation Zach Hill Western Washington University."

Similar presentations


Ads by Google