Datasheet

Thursday, 17 July 2003 MiniProject: Design Aspects Colin K McCord
EEE512J2 – Electronic Product Design Page 35 Chapter 7: Electronic / Software Design
The dip-switches are used to select RS232 baud rate, table shown on
the left. The push button has three functions, if the user holds down the
button during power up, it will put the ECG into test mode, e.g. 7-
segment, RS232, RAM chip, DAC, ADC, will run through a simple
diagnostics program. If the push button is pressed during normal
operation, this will pause the ECG display, which resumes when the
button is pressed again. The final operation of the push button is to mute
the buzzer when a patient has “flat lined” (e.g. heart beat stopped).
Port D is used for an 8-bit address bus, the only component that requires an address is the RAM chip
(M6264P-15). This RAM has 8k of memory, but because the address bus is only 8-bits wide, hence it is only
possible to access 256 bytes of memory (This is OK). If it is decided that more RAM is required at a later
stage of the design process, it is possible to use all 8k of RAM even though it appears that there are not
enough free ports on the PIC. The trick is to use two 8-bit latches (as used for the 7-seg displays), were one
latch sets the MSB of the address and the other sets the LSB of the address. Since both of these latches
should not be enabled at the same time, the one free pin (RC3) can be used to select between the latches
(e.g. use a not gate to one latch, and connect the pin directly to the other). But these increases chip count,
therefore product cost, hence there would need to be a good reason of the usage of the entire RAM chip.
Port B is used for the shared data bus, the RAM (M6264P-15), the DAC (ZN508E-8), and the 8-bit latches for
the 7-segment displays (74LS377) are all connected to this bus. Note that only one item can be enabled at
any one time, for example if writing to the RAM chip all other devices on the data bus must be disabled. This
is the classic microprocessor method of interfacing with devices, but it was not the only option it is possible to
use a serial RAM chip, serial DAC and serial latches, this would reduce the number of pins required on the
PIC (no need for data bus or address bus) hence a 28-pin device could be used, reducing product cost. But
the disadvantage of this is speed: time compressed memory is used to display the ECG on a CRT; it requires
a refresh rate of at least 50Hz (flicker free), since 256 bytes of data is displayed on the screen, this means
that the DAC must be updated 12,800 (50 x 256) times per second. If a serial DAC was used each bit is
clocked in one at a time, hence a serial baud rate of 102,400kbps (12,800 x 8) would have been required,
the PIC can achieve this, but there may not be enough processor power left to carry out other critical
operations.
The reason why the MAX232CPE (RS232 line buffer) was chosen was because it can be powered from a
single 5V power supply. Recall that RS232 requires +3 to +12 volts for a logic ‘0’ and -3 to -12 volts for a
logic ‘1’, the MAX232CPE has a built-in (external capacitors required) voltage doubler circuit (+10V) and a
voltage inverter circuit (-10V). This reduces product cost as the other option is to using a switch mode DC to
DC converter (cost about £5) to generate required power supply. Allow a +9 and -9 supply (could use -10,
+10) is required for the ECG amplifier circuit, hence a DC to DC converter is required anyway. Allow the
max232 data sheet states that the +10 and -10 voltage pins could be used to drive other circuits, but it is not
recommended, plus its good design practice to keep analogue and digital circuits separate (problems with
noise).
Notice that only the transmit wire is connected to the RS232 cable, the ECG monitor does receive any
feedback from the PC, just transmits ECG data continuously. Perhaps it is a good idea to connect the
receive wire, as this increases the possibilities for future product enhancement. For example the chosen PIC
can protect blocks of program memory, hence a bootstrap program can be written to check the serial
interface before calling the main program. If a certain block of characters are received during boot strap, it
moves into program mode, using a bidirectional communications protocol (RTS, ACK, NAG, etc…) a new
program can be download from the PC directly into program memory, when download is complete the new
program is called. This offers greater product flexible as software updates (bug fixes, new features) can be
downloaded free of charge and download directly into the product using the same serial interface and
software used to display the ECG.
7.4. Analogue Circuitry
Figure 7.4a shows the circuit diagram; it is important to note that this is a first draft (prototype) designed to
test the concept of an ECG amplifier, this version is not a valid commercial medial product as it does not
S2 S1 S0 Baud Rate
0 0 0 115,200 bps
0 0 1 57,600 bps
0 1 0 38,400 bps
0 1 1 32,768 bps
1 0 0 19,200 bps
1 0 1 14,400 bps
1 1 0 9,600 bps
1 1 1 4,800 bps