Download presentation
Presentation is loading. Please wait.
Published byFrancis Johnson Modified over 9 years ago
1
Digital Handheld Communication and Navigation Device www.trevorwilcox.com
2
Freescale 9s12xep100 microcontroller 50 MHz bus frequency Chip Resources 3 of 6 SCI Ports Two interrupt driven Wake-Up Interrupts on Port H and Port J (Key + RF) Time Channel 6 Interrupt (Used by Kernel) Memory Usage ROM – 21.6kB of 48kB (up to 1MB paged) RAM – 8kB of 8kB (up to 64kB paged) EEPROM – 500B of 2kB (up to 4kB paged)
3
uC/OS-II – A real-time preemptive multitasking kernel Tick Period – 1ms 3+2Tasks 2 ISRs 4 Flags 1 Mutex
4
Task/ISRPriorityPeriod (avg) Period (min) BehaviorExecution Time (avg) Execution Time (max) CPU Load (avg) CPU Load (max) RFrxISR-60sec*0.8msSporadic2µs * ~0.0%0.25% GPSrxISR-30sec*1.7msSporadic2µs ~0.0%0.12% StartTask4--Run Once2sec -- OS_TIMER_TIMER51ms Periodic0.5µs 0.05% SysTask (newKey)6120sec16msSporadic7.1ms* ~0.0%44.3% (newSec)1sec Periodic5ms* 0.5% (newMsg)60sec162.4msSporadic7.3ms* 0.02%4.5% (newGPS)30sec61.2msSporadic7.2ms* 0.02%11.8% KeyTask78ms Periodic8µs *10µs0.1%0.13% ClockTask81sec Periodic1µs *1µs~0.0% *Estimated **Maximum load should be considered average load because system will be sleeping during “average” load conditions. Maximum CPU Load:44.85% Average CPU Load:~0.7%**
5
Initializes Keypad, GPS, Clock, RF, and LCD hardware Creates the other tasks Period: Run once Execution time: ~2sec
6
Triggered by RDRF (Read Data Register Full) flag on RF SCI port Copies incoming byte to buffer and exits When end of message is detected or the buffer is full, posts a flag notifying SysTask Period: 0.8ms (time in between bytes at 9600bps), Behavior is sporadic Execution time: 2µs
7
Virtually identical to RFrxISR Triggered by RDRF on GPS SCI port Copies incoming byte to buffer and exits When end of message is detected or the buffer is full, posts a flag notifying SysTask Period: 1.7ms (time in between bytes at 4800bps) Execution time: 2µs
8
Scans keypad to detect and debounce user key presses Posts a flag notifying SysTask of user inputted key Period: 8ms (periodic) Execution time: Maximum: 10µs Average: 8µs (estimated)
9
Uses OS Delay to count current time of day and date Posts flag notifying SysTask that one second has elapsed Period: 1s (periodic) Execution time: 1µs
10
Runs on New RF Message, New GPS Message, New Key Press and New Second events Processes user input, including keypad multitap Processes RF and GPS data Provides the Graphical User Interface (GUI) State machine structure to react to events and display correct graphical output for the event type and current user screen Monitors power status and controls system power cycle Saves user settings in EEPROM Provides software tools to user
11
Parses and interperets NMEA 0183 message streamed from GPS hardware Location data is updated Period: Minimum: 61.2ms Average: 30sec Execution time: Parsing and translating: 200µs Maximum: 7.2ms (estimated) Average: 7.2ms (estimated)
12
Four primary functions: interpret received messages, transmit outgoing messages, manage message cryptography, and conduct Medium Access Control (MAC) Incoming messages are processed when newMsg flag is posted by RFrxISR. The header is examined to determine if the system is the intended recipient. If it is, an ACK message is transmitted to the sender. No ACK will be transmitted for “Broadcast-All” messages. Message content will be decrypted using aes256 module, and message data will be ready to use. For outgoing messages, message is encrypted, headers are added, and message is sent to the LN96 for transmission Period: Minimum: 162.4ms Average: 60sec Execution time: Parsing and translating: 300µs (estimated) Maximum: 7.3ms (estimated) Average: 7.3ms (estimated)
13
When the newKey flag is posted by KeyTask, SysTask will retrieve that key and interpret the key’s meaning based on the current state and cursor location Multitap function may be used depending on current state Period: Minimum: 16ms Average: 120sec Execution time: Maximum: 7.1ms (estimated) Average: 7.1ms (estimated)
14
When newSec flag is posted by ClockTask, SysTask will update the time on the LCD if appropriate A mutex will be used to control access to the date-time information Period: 1 sec Execution time: 5ms (estimated)
15
SystemTask *main.cLN96.c LCD.caes256.c EEPROM.c*messaging.c power.crandom.c tools.cmultitap.c gps.c9s12xep100.c *Module where task code exists. KeyTask *ucoskey.c ClockTask *clock.c
16
Module/LibraryTasksPublic Functions and DataEstimated ROM/RAM main.cStartTask, SysTask settingsData2500b/4kb LCD.clcd_init(),lcd_powerdown() lcd_setbgcolor(),lcd_display() lcd_backlight(),lcd_putchar() lcd_setfontsize(),lcd_putstrg() lcd_getfontsize(),lcd_clear() lcd_putimage(),lcd_getcolor() lcd_movecursor() lcd_setcolor(),lcd_eraseline() lcd_disptime(),lcd_getcursor() lcd_txtopaque() 780b/10b
17
Module/LibraryTasksPublic Functions and DataEstimated ROM/RAM EEPROM.c Adapted from Todd Morton EESectModify(),EESectErase() EEWordWrite 400b/10b power.cSleep(),Stop(),Powerdown()200b/10b tools.cgridFind()400b/300b multitap.cgetMultiTap()1800b/ 200b 9s12xep100start.c Adapted from Todd Morton _Startup()80b/0b uCOSkey.c Adapted from Todd Morton KeyTaskKeyPend(),KeyInit()400b/70b gps.c GPSrxISRgpsData gps_getRMC(),gps_getGSV() gps_init(),gps_setqueryrate() 1100b/400b
18
Module/LibraryTasksPublic Functions and DataEstimated ROM/RAM clock.cClockTaskTimeBuffer120b/70b LN96.cRFrxISRrf_init(),rf_write(),rf_reset()500b/10b aes256.c Copyright (c) 2007-2009 Ilya O. Levin aes256_init() aes256_done() aes256_encrypt_ecb() aes256_decrypt_ecb() 1400b/500b messaging.cmsgData,rfMsgBuffer sendMsg() 2000b/ 800b random.cgetRand()500b/100b
19
Module/LibraryTasksPublic Functions and DataEstimated ROM/RAM uC/OS-II (c) Copyright 1992-2007, Jean J. Labrosse OS_TASK_TIMERSee uC/OS-II Documentation2400b/ 1500b Math.c ISO C Standard Library undetermined String.c ISO C Standard Library undetermined STDIO.c ISO C Standard Library undetermined STDLIB.c ISO C Standard Library undetermined ~7k ROM for C Libraries Total:21.6kb ROM 8kb RAM
24
Kernel Choice Tasks StartTask RFrxISR GPSrxISr SysTask KeyTask ClockTask Data Control Medium Access Control GPS Communication Power Management Memory Usage ? toothpastefordinner.com www.trevorwilcox.com
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.