170 likes | 257 Views
BICYCLE SECURITY AND TRIP COMPUTER MATTHEW ROTHNIE. WESTERN WASHINGTON UNIVERSITY 4/25/12. System Software Design- Hardware Resources . MCU- MC9S12C128 16-bit 128-K Flash EEPROM, 4KB RAM 31 GPIO 25MHz bus speed ROM- no ROM Flash EEPROM- 4K RAM- 1K Resources- 23 GPIO.
E N D
BICYCLE SECURITY AND TRIP COMPUTER MATTHEW ROTHNIE WESTERN WASHINGTON UNIVERSITY 4/25/12
System Software Design- Hardware Resources • MCU- MC9S12C128 16-bit • 128-K Flash EEPROM, 4KB RAM 31 GPIO • 25MHz bus speed • ROM- no ROM • Flash EEPROM- 4K • RAM- 1K • Resources- 23 GPIO
System Software Design- Kernel • Kernel- Timeslice • Pre-emptive real-time Kernel • Tick period- 100 mS • Task and ISR total- • Start, Data, Key, Alarm, Sensor, Alarm ISR, Sensor ISR and Toggle ISR
System Software Design- START • Initializes all Resources • Period- Once at beginning • Execution time- ~500 mS
System Software Design- KEY • Scans Keypad and updates buffer • Period- 10 mS • Execution Time- ~1 mS • CPU load = 1 mS/10 mS = 10%
System Software Design- DATA • Handles user input • Gets speed values from the Speed-Sensor • Updates LCD values • Does all calculations for speed and distance • Handles Alarm Driver output • Period- 500 mS • Execution Time- ~30 mS • CPU load = 30 mS/500 mS = 6%
System Software Design- ALARM • Handles the alarm interrupts from the sensor, secure-loop and keypad entry • Period- Sporadic • Execution time- 1 mS
System Software Design- SENSOR • Takes all the output from the Hall Effect sensor and converts to timing information that can be used for the Data function • Scans Sensor output and updates buffer • Period- ~10 mS • Execution Time- ~1 mS
System Software Design- Sensor ISR • Gives output voltage for Buzzer Driver when alarm is “on” and the sensor reports movement • Period- Sporadic • Execution Time- ~2 mS
System Software Design- Toggle ISR • Goes into initialization routine after this interrupt occurs • Period- Sporadic • Execution Time- ~1 mS
System Software Design- CPU Load Load (max) = 10% + 6% = (with rounding) ~ 20%
KeyScan Data Flow Diagram KEYPAD KEYSCAN KeyInit() KEY TABLE Key Flag KeyPend() KEY
MAIN Data Flow Diagram Main.c CalculateDistance() Sensor() LCD CalculateSpeed() Alarm() ALARM DRIVER Buzzer()
ALARM ISR Data Flow Diagram IRQ Alarm() ISR Flag
TOGGLE ISR Data Flow Diagram XIRQ Alarm() ISR Flag
SENSOR ISR Data Flow Diagram PP 05 Alarm() ISR Flag