Nifty Car: Embedded System: Core

Updated 2000-1-10

This documents the core embedded system that, if it is built, will be a combination of the security system and VDAS (Vehicle Data Acquisition System (its too long!)). With the addition of microcontrollers that display data received from the VDAS real-time data feed, this system can meet the requirements of the HUD. The target platform is a PIC16F877 running at 4, 8, or 16MHz.

Connected items and PIC peripherals used

Item Peripheral Function
Computer
Display devices
SCI / USART Sends acquired vehicle data via asynchronous serial. A computer may listen in along with other microcontrollers that operate displays. I would like the speed to be 19.2kbps to maintain speediness while not requiring really fast microcontrollers.
Computer SCI / USART Receives command to display a string to provide additional information. Maybe something else, too.
GPS Timer0 Counts the passage of seconds by counting pulses from the pulse per second output on the GPS. This is used to signal the need to send a new time to all devices after a minute.
Timer2 Used for interrupt based software asynchronous serial.
Speed indicators Timer1 Counts something with a regular period, although I don't know which of the three options for Timer1 will be used. Timer1 will time the interval between pulses.
CCP1 Captures the Timer1 value at the time of the vehicle speed pulse, or the vehicle speed and engine speed pulses.
CCP2 Captures the Timer1 value at the time of the engine speed pulse, or is unused if Timer1 uses its own oscillator connected to the PIC.
Security status External interrupt Alerts the microcontroller to a change in status of the car, activities around it, or other events that require the microcontroller to awaken from sleep mode. It will primarily be a security interrupt.
Keypad status Interrupt on change Notifies the microcontroller to a key press on a keypad.

Pin connections

Name PIC16F877 Connection to I/O Function
Port A
Sync serial clock RA0 Various devices
O
Communications over synchronous serial data bus.
Sync serial data RA1 Various devices
I/O
Communications over synchronous serial data bus.
Sync serial control RA2 74HC595 shift register clock
O
The 74HC595 outputs the slave select lines. This part could be replaced with some decoder or augmented with an additional 74HC595.
Sync serial control RA3 74HC595 output register clock
O
The 74HC595 outputs the slave select lines. This part could be replaced with some decoder or augmented with an additional 74HC595.
Time counter RA4 One pulse per second on GPS
I
Triggers an interrupt at a regular interval to update the time, and maybe position, with new GPS data. This will only be functional while the car is running and may not function for a few minutes after the car starts. This could be done by some other polling scheme, but I like this better for now.
Security status serial input RA5 74HC165 data output
I
The 74HC165 is used to serialize input for eight security inputs:
  • Vibration sensor (minor and major)
  • Motion sensor (minor and major)
  • Car running flag
  • Door(s) open flag
  • Remote arm command
  • Remote disarm command
Since the 74HC165 doesn't have a high impedance state for its serial data output, it must not be connected to the regular serial data bus data line.
Port B
Security interrupt RB0 (INT) An OR or NOR gate system
I
The security interrupt is used to inform the controller of an insecure state registered by one of the eight security inputs:
  • Vibration sensor (minor and major)
  • Motion sensor (minor and major)
  • Car running flag
  • Door(s) open flag
  • Remote arm command
  • Remote disarm command
Serial I/O enable RB1 MAX222 (?) !Shutdown input
O
Enables or disables RS-232 I/O from the MAX222. Disabling the I/O is done to save power while only the security system is active.
Key hit RB4 to RB7 74C922s data available output
I
Informs the controller that user input is available from a keypad interface.
Port C
Engine speed pulse input RC1 (CCP2) Conditioned tachometer pulse
I
Capture 2 is used to measure the interval between tachometer pulses. The information will be used to calculate engine speed for VDAS.
Vehicle speed pulse input RC2 (CCP1) Conditioned speed pulse
I
Capture 1 is used to measure the interval between speedometer pulses. The information will be used to calculate vehicle speed for VDAS.
Voice system input / SPI input RC3 ISD4002 serial data output
I
The ISD4002 uses the SPI protocol for serial data transfer. Since this requires separate lines for input and output, the ISD4002's output line could not be connected to the regular serial data bus data line.

The SPI hardware of the PIC might not be used to avoid the extra complexity of using two serial I/O schemes internally and having to mess with the SPI hardware when switching between SPI and 3-wire.

GPS connection RC4 GPS asynchronous RX line
O
Link to send commands and data to the GPS. Software implemented asynchronous serial is used.
GPS connection RC5 GPS asynchronous TX line
I
Link to receive data from the GPS. Software implemented asynchronous serial is used.
Real-time data feed RC6 (TX) Various devices
O
The real-time data feed includes current information from VDAS. The information is contained in packets such that other microcontrollers can easily get information relevant to their purpose and ignore the rest.
Computer input RC7 (RX) RS-232 TX from computer
I
The computer, or other external device, can issue three commands to the controller:
  • Display a given message to provide additional information
  • Take keypad focus (?)
  • Give keypad focus (?)
Port D
Keypad input RD0 to RD3 74C922s data outputs
I
Reads the 4-bit output of one 74C922. Up to 4 74C922s may be connected.
Keypad select RD4 to RD7 74C922s data enable
O
Selects one of the 74C922s to read data from. The 74C922 puts its data output lines in a high impedance state when not selected.
Port E
Interior siren RE0 ???
O
Used to activate the interior siren.
Exterior siren RE1 ???
O
Used to activate the exterior siren.
Ignition enable RE3 ???
O
Used to enable and disable the car's ignition. It should also kill the engine if already running.

Notes to myself