270 likes | 502 Views
Digital Handheld Communication and Navigation Device. Phantom. General System Design. 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)
E N D
Digital Handheld Communication and Navigation Device Phantom www.trevorwilcox.com
General System Design • 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)
Kernel Design • uC/OS-II – A real-time preemptive multitasking kernel • Tick Period – 1ms • 3+2Tasks • 2 ISRs • 4 Flags • 1 Mutex
Task/ISR Timing *Estimated **Maximum load should be considered average load because system will be sleeping during “average” load conditions.
Start Task • Initializes Keypad, GPS, Clock, RF, and LCD hardware • Creates the other tasks • Period: Run once • Execution time: ~2sec
RFrxISR • 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
GPSrxISR • 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
KeyTask • 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)
ClockTask • 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
SysTask • 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
SysTask (GPS) • 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)
SysTask (Messaging) • Four primary functions: interpret received messages, transmit outgoing messages, manage message cryptography, and conduct Medium Access Control (MAC) • Incoming messages are processed when newMsgflag 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)
SysTask (User Input) • 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)
SysTask (Clock) • 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)
Task/Module Relationships *Module where task code exists.
Questions? • 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