System Software Design
Frank Mirabelli
Motorola MC9S12DP512 Bus Frequency 24 MHz Available Memory
512K bytes Flash EEPROM, 4K bytes EEPROM, 14K bytes RAM
Required Memory 10K bytes ROM 5K bytes RAM 256K bytes of Flash
MicroC/OS-II Real-time preemptive multitasking kernel 1 ms tick period
Start Task Priority: 4 Button Task Priority: 5 WB Task Priority: 6 Sensor Task Priority: 7 Display Task Priority: 8 Logger Task Priority: 9 Clock Task Priority: 10 Terminal Task Priority: 11
Creates other tasks Initializes MicroC/OS, Clock, LED, and LCD Priority: 4 Period: Executes only once at startup Execution Time: ~ 200 ms (max)
Senses button presses Debounces buttons Priority 5 Period: 20 ms (periodic) Execution Time: 20 us (max) CPU Load: 0.1%
Controls the operation of the Wideband Sensor
Heats and holds sensor in operating range
Reads and stores A/F ratio reading Priority 6 Period 20ms (periodic) Execution Time: 1ms (max) CPU Load 5%
Reads and stores TPS, RPM, and EGT inputs
Priority 7 Period 20ms (periodic) Execution Time: 100us (max) CPU Load 0.5%
Pulls data from sensor variables and output them to displays
Controls communication to LCD, LED spectrum and 3 Digit displays
Priority 8 Period 500ms (periodic) Execution Time: 10ms (max) CPU Load 2%
Pulls data from sensor variables and output them to stores in Flash
Priority 9 Period 500ms (periodic – when running) Execution Time: 10ms (Logging) Execution Time: 50ms (Clearing) (max) CPU Load 10% (max)
Keeps track of Logger time Priority: 10 Period: 100 ms (Periodic) Execution Time: ~ 500 us (max) CPU Load: 0.5%
Outputs Logger data to Computer Priority 11 Period 20ms (periodic) Execution Time: 20us (normal operation) Execution Time: 20ms (Downloading) CPU Load 100% Note: Lowest priority task, will not block
when downloading Note: downloads RARELY happen
L max = (20 us) + (1 ms) + (100 us) + (10ms)
(20 ms) (20 ms) (20 ms) (500ms)
+ (500us) + (500us) + (20us) (100ms) (20ms) (100ms) L Max = 100% L Average = 17.5%
Module Tasks Functions Global Variables
Main.c Start TaskSensor TaskWB TaskDisplay TaskLogger Task
GetTime() EGTValWBValTPSValRPMVal
User.c Terminal TaskButton Task
UserInit()Getchar()Putstrng()
Clock.c Clock Task EnableFlag()ClearFlag()SetTimeHrs()SetTimeMins()SetTimeSecs()
LED.cTod Morton(Modified)
LEDInit()LEDDisp()LEDSpec()
LCD.c
Tod Morton
All LCD Functions
ProsEeprom.c
Freescale/Tod Motron
ConfigECLKDIVEEWordWriteEESectErase