Datasheet

Thursday, 17 July 2003 MiniProject: Design Aspects Colin K McCord
EEE512J2 – Electronic Product Design Page 36 Chapter 7: Electronic / Software Design
comply with all the relative medial standards. This design is extremely simple, but the chosen amplifier is
analogue devices AD624AD, this amplifier is an “Instrumentation amplifier” with a CMRR (Common Mode
Rejection Ration) of 110dB and a gain of 1,000. Note the AD624AD chip is the most expensive chip in the
design, costing £22.50 (retail price); hence perhaps a lower cost solution is possible. The reason why this
expensive chip was chosen was because of its good CMRR (At least 80dB was required) and high precision.
4.7k 47k
1uF 1uF
Simple Low Pass Filter
47k
47k
10M
10k
1
2
3
11
13
12
16
AD624AD
8
4
5
6
7
9
10
+9V
-9V
1uF
1uF
Electrode 1
Electrode 2
Electrode 3
D1
D2
To ADC
VCC
Figure 7.4a. ECG Amplifier circuit
A simple CR second order low pass filter was used to filter high frequencies (anti-aliasing) and the two
diodes ensure that the PIC is not damage in the event of over voltage or negative voltages.
7.5. PIC Program
The philosophy that should be used during the development of the PIC code is to keep it simple,
straightforward, comprehensible, and to a minimum. It was decided to write the program in C, C is a high –
level programming language which allows for programs to be written quickly without any knowledge on how
the CPU works.
The other option is to program at the assembly level, this has the advantage of producing more efficient code
(runs extremely fast), but this code is not transparent to the chosen chip, hence if it was decided to change
the microcontroller, the program may have to be completely rewritten, allow Microchip’s range of
microcontrollers seems to have good backward compatibly, hence maybe only manor chargers are required.
The main draw back for assembly level program is the time it takes to develop the program, writing the
program in a high-level language like C is easier and takes less time, hence reducing development costs.
Start
Setup Ports, Baud
Rate, and ADC
Setup Timer 2 to
cause and
interrupt 128 times
a second
Scan Array of data
and Update DAC
Figure 7.5a. Simplified Main routine
Timer2_ISR
Return
Read ADC
Add ADC reading
to the end of the
array
Transmit ADC
Reading through
RS232.
Figure 7.5b. Simplified Interrupt routine