Student Zach Morris
The goal of this project is to learn how to approach a design, to incorporate my mathematical background into my electrical background, and to form one core set of knowledge.Through the MCTP program funded by a NSF grant and through the University of Colorado Applied Mathematics program, I plan to design and build a working digital video camera. To do this the video camera will need to have real time video compression. Any type of video compression that will be used in this system will be designed in software and will take a large amount of knowledge in mathematics to achieve this goal. The hardware of the camera will take require a very strong background in electrical engineering to interlock each piece of hardware into a working system.The two systems will have to work flawlessly together for any part of this project to work.This project will allow me to understand how a design is approached and will allow the intertwining my knowledge of mathematics and electronics in to one firm understanding of mathematics in engineering.
Abstract The Vehicular Electronic Data Recorder (VEDR) is a device which will provide a visual record of the events leading up to a car accident.This will be done by devising an in-car system with a camera outside of the car, recording and storing visual data about the car’s surroundings to random access memory.When an accident occurs, as triggered by an accelerometer, this data will be stored to an SD flash card, enabling the user to view what happened outside of the vehicle leading up to the accident.The finished product will be designed for consumers, enabling them to use this system on personal vehicles and easily view crash data on a home computer.
Purpose
The Vehicular Electronic Data Recorder (VEDR) is an easy-to-use system that a user can install in their vehicle and leave running during day-to-day use of their car. The VEDR will silently record video of the car’s surroundings, keeping the most current images stored to memory.The camera is small, and the entire system is powered off of the car’s battery, requiring no day-to-day interaction with the user.
In the event of an accident, an accelerometer will detect that the car’s movement has exceeded a certain threshold, and that data should be stored. Again, this process requires no intervention on the part of the user. The system includes backup battery power, so that data storage will not be impacted in the event of an accident.
The crash data is written to an SD Flash card, which the user can easily insert into a personal computer.Using the included software, the user will be able to seamlessly view video of the events leading up to the crash.
The driving force of the VEDR is the user.It’s simple to install, requires no day-to-day intervention, and provides data that can prove invaluable in proving the events of a car accident.
System Overview

Figure 1. System diagram.
The main components of the VEDR are:
· Xilinx Spartan-3 FPGA board
· Two PICs—Microchip PIC16F628A
· Camera—ST VS6524
· Static RAM—Cypress CY7C1061AV33
· Accelerometer-- Analog Devices ADXL210E
· Sparkfun Logomatic
·
Component List (excluding passive elements)
2x CY7C1061AV33 Static RAM
2x PIC16F627A Programmable Integrated Circuits
1x PCF8575 I2C I/O Expander
1x VS6524 VGA Camera Module
1x SparkFun Electronics Logomatic Serial SD Datalogger
1x ADXL210E +/1 10g Accelerometer
1x P6SMB18CAT3 Spike Shunt
1x FFP20UP20N Ultrafast Recovery Power Rectifier
1x LD1117 3.3V Regulator
1x LK112 2.8V Regulator
1x IFR7317 Dual P and N Channel MOSFET
1x MAX3232 RS232 Line Driver
1x XILINX Spartan3 FPGA
1x GXOU102H 12 MHz Clock Driver
PIC Description
This system has two microprocessors attached to it, the control PIC and the crash PIC.
PIC Functionality and Implementation
This system has two microprocessors attached to it, the control PIC and the crash PIC. The control PIC is a PIC16F628A designed and distributed by Microchip. The control PIC has control over every component within this system. There are five sections of hardware that it must boot up, continuously monitor, and shutdown. The PIC16F628A runs off an external oscillator between 4Mhz and 20Mhz, and the control PIC runs off one 8Mhz crystal. The picture below describes how to attach the crystal to the microprocessor so that it runs at the needed speed for our system. For the crystal to output the proper frequency it must be connected to a 22 pF capacitor on each side of the crystal, with the other side of the capacitor connected to ground. The figure below describes how to properly attach the crystal to this system.

Figure 2. System crystal.
Microchip 16F628A only has 12 accessible I/O ports. This created a problem, because to properly control all the functions that need to be controlled by this microprocessor 20 I/O ports are needed. To achieve this, an I/O expander was needed so that all components could be controlled by this one processor.
The PCF8575 designed and distributed by Texas Instruments is the I/O expander that is used in this system. This particular I/O expander is controlled via a dedicated I2C bus line. The reason this must be on a dedicated I2C line is because if you send a stop condition to this device the device will auto power off to save power. To keep the I/O lines at the proper voltage the device must never be sent a stop condition. The I2C address is an 8 bit address with the final bit a zero for writing to the device and a one for reading from the device. The read address is binary 00100001 and the write address for this device is binary 00100000. When writing to the device you write 1 bit for every I/O pin so if you sent binary 00001001 I/O pins zero and three will be high (+3.3v) and the other pins will be low (+0.0v).
The entire connection outline of the control PIC is laid out in the below picture.

Figure 3. Control PIC.
The main function of the control PIC is to boot and keep the CCD camera active. The CCD is controlled over a second I2C bus, this camera has a very particular boot order that must be received by the microprocessor to properly boot. The following table explains the boot order of the ST Microelectronics CCD device that is being used.
|
order in which command is sent |
IIC Start |
Device IIC Address |
Memory Address |
Data |
IIC Stop |
|
Function |
|
1 |
x |
0x20 |
0xC003 |
0x06 |
x |
|
Enable Camera Microprocessor |
|
2 |
x |
0x20 |
0xC034 |
0x01 |
x |
|
Enable Digital I/O |
|
3 |
x |
0x20 |
0x0308 |
0x02 |
x |
|
QBGA Mode |
|
4 |
x |
0x20 |
0x0396 |
0x03 |
x |
|
RGB565 Mode |
|
5 |
x |
0x20 |
0x0D82 |
0x08 |
x |
|
Frame Rate of 8 pictures per second |
|
6 |
x |
0x20 |
0x0C80 |
0x78 |
x |
|
Flicker Rate to fix room lighting |
|
7 |
x |
0x20 |
0x2080 |
0x02 |
x |
|
Dither Control Enable |
|
8 |
x |
0x20 |
0x0180 |
0x02 |
x |
|
Run Command |
|
9 |
x |
0x20 |
0x039A |
|