Download presentation
Presentation is loading. Please wait.
Published byCorey Butler Modified over 8 years ago
1
Electronic Memory Game System Software Design Jack Sullivan May 08, 2007
2
System Design Microcontroller: MC9S12DP512 Bus Frequency: 24MHz Memory: 14k RAM, 4k EEPROM, 512k Flash More than enough for this project. Kernel: MicroC/OS-ll Used for priority of player buttons 1ms tick period
3
Tasks & Priority 4.Start Task 5.Key Task 1 6.Key Task 2 7.Key Task 3 (Possibly) 8.Control Task 9.Display Task
4
Start Task Priority: 4 Description: Initializes the system Creates the other three tasks Period: NA (Runs once at start up) Execution time: 5ms CPU Load: NA
5
Key Task 1 Priority: 5 Description: Scans the menu buttons for an input Stores value into a buffer Period: 10ms Execution time: 100us CPU Load: 100u/10m = 0.01
6
Key Task 2 Priority: 6 Description: Scans the 1 st player controller for an input Stores value into a buffer Period: 10ms Execution time: 100us CPU Load: 100u/10m = 0.01
7
Key Task 3 Priority: 7 Description: Scans the 2 nd player controller for an input Stores value into a buffer Possible to be combined with Key Task 2 Period: 10ms Execution time: 100us CPU Load: 100u/10m = 0.01
8
Control Task Priority: 8 Description: Determines the state the game is in Creates the games memory sequence Verifies player-inputted sequence Period: 10ms Execution time: 150us CPU Load: 150u/10m = 0.015
9
Display Task Priority: 9 Description: Refreshes the LCD screen Lights up LED sequences Period: 10ms Execution time: 2ms CPU Load: 2m/10m = 0.2
10
Total CPU Load L = 100u + 100u + 100u + 150u + 2m = 0.245 10m 10m 10m 10m 10m L Max = 24.5% L Ave = 14.5%
11
Module Description ModulesTasksPublic Functions/Data PWM.cPWMInit() CreateTone() MemoryGame.cStartTask ControlTask DisplayTask GameSequence GenerateSequence() CompareSequence() LED.cLEDInit() Disp_Sequence() Lcd.c Code by Todd Morton LcdInit() LcdClrDisp() LcdClrLine() LcdMoveCursor() LcdDispStrg() Key.c Original code by Todd Morton KeyTask1 KeyTask2 KeyTask3 KeyInit() ButtonPend()
12
KeyPad Data Flow Button1 Button1Flag Button2 Button2Flag Key KeyFlag KeyTask2() KeyTask3() KeyTask1() Button2Pend () KeyPend() Button1Pend() KeyInit() Application Button Driver Module Button I/O Controller 1 Controller 2 Menu
13
Lcd Data Flow DisplayTask() StartTask() LcdInit() ApplicationLcd ModuleLcd I/O LcdDispStrg() GameSequence
14
LED Data Flow DisplayTask() ApplicationLED ModuleLED I/O Disp_Sequence() GameSequence LEDInit() StartTask() Led Driver
15
PWM Data Flow ControlTask() ApplicationPWM ModulePWM I/O CreateTone() GameSequence PWMInit() StartTask() Speaker
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.