atv instrumentation display system design ed raezer senior project western washington university
DESCRIPTION
Designing “To Do” List Hardware Which MCU to use? How to interface system with ATV? What to use for user interface? Software Which software kernel to use? What tasks are needed? How much memory needed?TRANSCRIPT
Desired Functions Speedometer
0-99 MPH 1 MPH Resolution
Tachometer 0-12000 RPM 100 RPM Resolution
Odometer 0-9999.9 Miles 0.1 Mile Resolution
Clock 12 Hour Clock HH:MM:SS
Designing “To Do” List Hardware
Which MCU to use? How to interface system with ATV? What to use for user interface?
Software Which software kernel to use? What tasks are needed? How much memory needed?
MicroController Choice Motorola MC9S12C32
32k Bytes EEPROM, 2K Bytes RAM
Estimated Memory Needed 8k Bytes EEPROM, 1.5K Bytes RAM
26 I/O Ports
RPM Readings
3.57KR8
1.02KR9
D1
D2
ComparatorU2
1.02kR12Splice into
Pulse Signal
+5V
DG
ND
+5V
DGND
+5V
MAX931
+
-
IN-
IN+
V-
GND
HYST
REF
V+
OUT
4
3
2
1
5
6
7
8
-1.7Vpk pulse generated every engine rotation.-Needed to be converted to a digital 0-5V square wave
signal so the MCU could read it.
RPM Sensing circuit
0V
5V
t
Wheel Rotation Magnetic Reed
switch Magnet mounted
on brake rotor trips switch every rotation
Creates a 0-5V square wave
User Interface 2x16 LCD Display
Large Characters W/ backlight
Shift Light Green LED
Redline Light Red LED
RPM LED Bargraph 3 Pushbuttons
MODE
LCD DISPLAY
PUSH BUTTONS
LEDS
10 Seg. LED
BARGRAPH
Kernel Selection Kernel Choice: MicroC/OS-II
Real-time preemptive multitasking kernel with a 1 ms tick period
Configured for my program Modify (os_cfg.h)
Task Needed & Priorities4- Start Task5- Clock Task6- U.I. Task7- Button Monitor Task8- RPM Task9- Speed Task
Start TaskDescription:
-Initializations: LCD, Keys, OSTick-Intialize Port Directions and Initial Values -Creates Tasks-Priority #4-Period: once (at startup)
Clock TaskDescription:
-Keeps time using a software clock-Runs timer for speed task-Updates time buffer-Period: 10 msec (Periodic)
User Interface TaskDescription:
-Reacts to button presses-Clock Setting-Activates LEDs-Changes Display Modes-Displays data on LCD Display
RPM TaskDescription:
-Retrieves pulse count from pulse accumulator every 600 msec and converts to RPMs-Updates RPM buffer.-Controls LED Bargraph-Period: 600 msec (periodic)
ISR Interrupt caused by input from wheel
rotation sensor Counter incremented every time
wheel makes one rotation. Period: Dependent on speed of ATV
Speed TaskDescription:
-Every 5 wheel rotations, speed is calculated using timer ran in the clock task.-Unless 3 secs. have elapsed, then speed is calculated using # of tire rotations in that 3 second period.-Updates odometer -Updates speed buffer
Dataflow DiagramReed Switch
Ignition Pulse
Pulse Accum.
RPMTask
RPM Buffer
UserInterface
Task
LCD Display
Clock Task
CloickBuffer
Speed Task
Speed Buffer
OdometerBuffer
Physical MCUDisplays
ISR Rotation Counter
LED Bargraph
User Interface State Diagram
SPEED XX MPH
CLOCK XX:XX:XX
SPEED XX MPH
TACH XXXXX RPM
SPEED XX MPH
ODOM XXXXX MILES
RESETODOMETER
UP + DOWN
MODE
MODE
MODE
START
SET CLOCK
UP +DOWN
UP + DOWN