System Software Design Dane Kim May 4 th, 2009 EET 475, WWU
General System Design MCU: Cypress PSoC CY8C29446 8-bit Bus Frequency: 24 MHz Memory Requirements: 5K ROM <1K RAM Kernel: Timeslice
Tasks, ISRs and CPU Load Task/ISRPurposePeriod (ms) Execution Time ( s) TimeSlice TaskMaintain slice period5010 Instrumentation TaskCalculate Speed and RPM Collect A/D samples for temp Calculate odometer value Poll for blinkers, other indicators LCD TaskUpdate instrumentation info on LCD50 Manage user interface Button TaskScans and debounces button presses10 Speed Timer ISRStarts/stops timer for speedometer34 (min)8.3 Tachometer Timer ISRStarts/stops timer for tachometer10 (min)8.3 Button Press ISRIndicates button press (debounced in LCD task)30.1 Shutdown ISRSenses low voltage and stores odometer dataNA Lmax = (10 s) + (150 s) + (50 s) + (10 s) + (8.3 s) + (8.3 s) + (.1 s) = 12.4% (10ms) (50ms) (50ms) (10ms) (30ms) (10ms) (30ms) Lave = 9.07%
Module/Library Description Module NameTasksPublic FunctionsPublic Data Main.cTimeSlice Instrumentation LCD Button LCD.cDisplay() Instrumentation.cSpeedCalc() TachCalc() TempSense() OdoCalc() IndiSense() LCD.asm (Cypress API) Delsig8.asm (Cypress API) TachTimer.asm (Cypress API) SpeedTimer.asm (Cypress API) Dac8.asm (Cypress API)
Data Flow Diagram – Speed/RPM Speedometer Timer Input Speed/Tach Timer ISR Instrumentation.c Instrumentation Task DataReady Timer Data DataRead
Data Flow Diagram - Temp A-to-D I/O DelSig A/D Instrumentation.c TempRead() DelSig_Result Start Read
Data Flow Diagram – Button LCD Task Button Task Button Pressed 1. Button Press
Data Flow Diagram - LCD LCD I/O LCD.c Struct InstrData Application LCD Task
Data Flow Diagram – Indicator Lights Turn Signal/ Neutral Gear/ High Beam I/O Instrumentation.c Indicator Data Instrumentation Task Main.c