The information in this publication has been carefully
checked and is believed to be entirely accurate at the
time of publication. Samsung assumes no
responsibility, however, for possible errors or
omissions, or for any consequences resulting from the
use of the information contained herein.
Samsung reserves the right to make changes in its
products or product specifications with the intent to
improve function or design at any time and without
notice and is not required to update this
documentation to reflect such changes.
This publication does not convey to a purchaser of
semiconductor devices described herein any license
under the patent rights of Samsung or others.
Samsung makes no warranty, representation, or
guarantee regarding the suitability of its products for
any particular purpose, nor does Samsung assume
any liability arising out of the application or use of any
product or circuit and specifically disclaims any and all
liability, including without limitation any consequential
or incidental damages.
"Typical" parameters can and do vary in different
applications. All operating parameters, including
"Typicals" must be validated for each customer
application by the customer's technical experts.
Samsung products are not designed, intended, or
authorized for use as components in systems intended
for surgical implant into the body, for other
applications intended to support or sustain life, or for
any other application in which the failure of the
Samsung product could create a situation where
personal injury or death may occur.
Should the Buyer purchase or use a Samsung product
for any such unintended or unauthorized application,
the Buyer shall indemnify and hold Samsung and its
officers, employees, subsidiaries, affiliates, and
distributors harmless against all claims, costs,
damages, expenses, and reasonable attorney fees
arising out of, either directly or indirectly, any claim of
personal injury or death that may be associated with
such unintended or unauthorized use, even if such
claim alleges that Samsung was negligent regarding
the design or manufacture of said product.
All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted in
any form or by any means, electric or mechanical, by photocopying, recording, or otherwise, without the prior
written consent of Samsung Electronics.
Samsung Electronics Co., Ltd.
San #24 Nongseo-Dong, Giheung-Gu
Yongin-City, Gyeonggi-Do, Korea 446-711
Contact Us: younghee46.won@samsung.com
TEL: (82)-(31)-209-3865
FAX: (82)-(31)-209-6494
Home Page: http://www.samsungsemi.com
Page 3
Revision History
Revision No. Date Description Author(s)
0.00 June 17, 2010 - Initial draft Xu Hui
Page 4
Table of Contents
1 OVERVIEW OF ARM BLOOD PRESSURE MONITOR...................................8
1.1 KEY Features of ARM Blood Pressure Monitor...........................................................................................9
1.2 System Block Diagram...............................................................................................................................10
1.3 Principles of Electronic Blood Pressure Monitor........................................................................................10
1.4 Process of Blood Measurement in Blood Pressure Monitor ......................................................................11
2.1 Analog Signal Processing ..........................................................................................................................13
2.1.1 Introduction to MPS-3117 Pressure Sensor.......................................................................................14
2.1.2 Constant Current Driver Circuit ..........................................................................................................14
2.2.4 Battery Voltage Detect........................................................................................................................24
2.2.5 I2C Device: EEPROM and Real Time Clock......................................................................................25
2.3 Pump Motor Driver Circuit..........................................................................................................................26
2.4 Valve Motor Driver circuit...........................................................................................................................27
2.5 Buzzer Enable and Driver Circuit...............................................................................................................28
2.6 Power Supply Circuit..................................................................................................................................29
3.2 Battery Voltage Detect ...............................................................................................................................31
3.4 EEPROM Write and Read Operations.......................................................................................................37
3.5 Interrupt Service Subroutine ......................................................................................................................38
6.1 Test Environment.......................................................................................................................................48
6.2 Final Measurement Environment Setting...................................................................................................49
6.3 Test Result .................................................................................................................................................50
7 APPENDIX 1: BILL OF MATERIALS ............................................................51
Figure 3-9 User Button (Start, Up/Down, Delete, Unit, Save, External INT4-7) ISR Flow Chart.........................41
Figure 4-1 Schematic of Analog Board ................................................................................................................42
Figure 4-2 Schematic of Main Board....................................................................................................................43
Figure 5-1 Main Board and Analog Board PCB Assembly (Top Layer)...............................................................44
Figure 5-2 Main Board and Analog Board PCB Assembly (Bottom Layer) .........................................................45
Figure 5-3 Main Board and Analog Board PCB (Top Layer) ...............................................................................45
Figure 5-4 Main Board PCB (Bottom Layer) ........................................................................................................46
Figure 5-5 Final Implementation of Blood Pressure Monitor (Main Board)..........................................................47
Figure 5-6 Final Implementation of Blood Pressure Monitor (Analog Board) ......................................................47
Figure 6-1 Final Measurement Environment Setting ...........................................................................................49
Table 7-1 Bill of Main Board Materials .................................................................................................................51
Table 7-2 Bill of Analog Board Materials..............................................................................................................53
This application note describes an arm blood pressure monitor (BPM) based on Samsung's S3P8245
microcontroller. The reference design is intended for novices, who are not familiar with blood pressure monitor
system design. You can modify the design to build more complicated applications.
With rising living standards and increase in ageing among people, medical testing equipments have become
necessity for families. For instance, home blood pressure equipments have become increasingly popular with the
Chinese families.
Usually, these equipments are of two types:
•First is the Mercury sphygmomanometer. The main advantage of such equipment lies in its numerical stability.
However, the disadvantages include: patients cannot measure themselves if they are alone; the equipment
must be operated by healthcare professionals. This equipment can also result in significant visual observation
error. The measurement results can be different, depending on the doctor's experience and criterion, so it can
lead to subjectivity. The Mercury sphygmomanometer is bulky and not easy to carry (not portable).
•Second is the electronic Blood Pressure Monitor (BPM). The main advantage of such equipment include:
ease of use; patients without any professional training can also use this equipment. It is easy to record the
measured values with this equipment. Besides, it is lightweight and portable. Due to its advantages, more
families are using this equipment. From 2007 to 2010 alone, China's annual demand for electronic blood
pressure monitor grew to 350 million units.
Electronic blood pressure monitor are of two types:
BT +6V : Battery +6 V
Power Mana. : Power Management
Cons. Cur. Driver : Constant Current Driver
Start But. : User Button
Power But. : User Button
RTC :
Real Timer Clock
: Not used
Cons. Cur .
Driver
2nd Order
HPF : 0 .8Hz
Amplifier
11 x
(Start)
(Power ON/OFF)
10 MHz
32. 768 KHz
Battery Vol .CPU
Pressure
Sensor
V+V-
Diff - Amp
Analog Board V 1 . 0
2 nd Order
LPF : 38Hz
ADC2
ADC0
ADC1
BT
+6V
OSC
ADC
INT0
Pulse Rate
Trigger
Power Mana .
+5V
S3P8245
ROM
SIO
RAM
Ext. INT
INT1 INT2
Start
But .
EEPROM
3
I/OPWR
LCD
T1
TB
BUZ
INT4-INT7
Power
But .
Main Board V 2 .1
2
RTC
4
19 SEG * 4 COM
19
M
M
Other
User Button
LCD Screen
Pump
Motor
Valve
Motor
Figure 1-2 System Block Diagram
1.3 Principles of Electronic Blood Pressure Monitor
Typically, blood pressure can be described as systolic blood pressure (SBP) and diastolic blood pressure (DBP).
•Systolic blood pressure (SBP): The blood pressure is measured at the time of heart contraction, that is, when
blood hits the blood vessels.
•Diastolic blood pressure (DBP): The blood pressure is measured when the heart does not contract. If the cuff
pressure is equal to the blood pressure, blood begins to flow and produces a "cuff" sound. The blood pressure
is measured at this point (SBP). Once the cuff sound weakens, it gradually disappears. The blood pressure is
measured again at this point (DBP).
1.4 Process of Blood Measurement in Blood Pressure Monitor
• The process of blood pressure measurement in the blood pressure monitor is described as follows:
• When the patient presses the Start button, the microcontroller opens the inflatable pump motor.
• The BPM system inflates up to 200mmHg. After reaching this value, it slowly deflates with the speed of
5mmHg per second.
• The pressure sensor outputs a signal through differential amplifier.
− One part of signal goes to the ADC0 channel to monitor the DC component of blood pressure signal.
− Other part goes to 0.8Hz second order high-pass filter to remove the DC component.
− Rest of the AC component of 11x amplification is inputted to the 38Hz second order low-pass filter (to filter
power and skin friction with the cuff of high-frequency noise and frequency interference, and to adjust the
signal in the range of 0 to 5V).
− One part of the filtered AC signal is sent to the pulse rate trigger circuit for generating trigger pulses that
starts the ADC module operation.
− Other part is sent to the ADC1 channel for calculating the amplitude of AC signal.
• Find the maximum peak-to-peak amplitude. Mark this point as MAP point.
• Before MAP point, determine the value that is the closest to 0.54*MAP. The corresponding DC component
value of this transient position specifies the systolic blood pressure (SBP) value.
•After MAP point, determine the point whose value is closest to 0.72*MAP. The corresponding DC component
value specifies the diastolic blood pressure (DBP) value.
•By using the internal timer to measure the interval between every two adjacent pulses, the system easily
obtains the pulse rate (PR) value.
•All the measurement results will be showed on the LCD screen.
The blood pressure monitor system needs a filter and an amplify circuit for the purpose of processing weak analog
signals and recognizing pulse signals. Such system is made of a single PCB board called the Analog Board. The
board provides a constant current driver (for pressure sensor), pre-amplifier (for pressure sensor's output weak
signal), high-pass filter, intermediate amplifier, low-pass filter, and pulse signal (which is sent to the MCU).
Figure 2-1
R2
4.7K ohm
P1.2/T1PWM
VHPF
shows a schematic diagram of the Analog Board.
VCC_+5V
R1
4.7K ohm
Q1
9012
J4
1
2
3
CON3
2
3
Amplifier: 11x
-
+
U4A
LM358
VCC_+5V
84
R28 10K ohm 1%R27 1K ohm 1%
R4
1.2K ohm
3
3
4
4
MPS-3117-006G_6_SOP
Pressure Sensor
VMAG
1
C13
104
2
U1
2
5
5
R31 49.9K ohm 1%
R5 0 ohm
AGND
R11 30K ohm 1%
1
1
6
6
R12 30K ohm 1%
R32 10K ohm 1%
GND
R6 1M ohm 1%
R20
2.4K ohm
AC Signal of BP
C8
104
R29 30K ohm 1%
2nd Order LPF: 38Hz
-
2
+
3
R13
1M ohm 1%
R16
1.3M ohm 1%
VCC_+5V
R21
182K ohm
P2.1/ADC1
C11
104
R7 1.3M ohm 1%
U2A
LM358
1
VCC_+5V
84
C4
104
C5
104
+
-
6
+
5
84
VDIF F
VDIF F
R23 100 ohm 1%
C6
10uF
R30 1K ohm 1%R25 1K ohm 1 %
7
LM358
U4B
VCC_+5V
R35 1M ohm 1%
R3 100 ohm 1%
C2
104
P2.0/ADC0
+
C3
104
R14 1K ohm 1%
R17 1M ohm 1%R18 1.5M ohm 1% R19 360K ohm 1%
C7
104
C9
VLPF
104
R33 5. 1M ohm 1%
DC Signal of Blood Pressure (BP)
C1
10uF
VCC_+5V
R8 1M ohm 1%
VCC_+5V
R34 10M ohm 1%
84
5
+
6
-
R22
100K ohm 1%
R24
50K ohm
VCC_+5V
R9 200K ohm 1%
U2B
LM358
R15 1K ohm 1%
2nd Order HPF: 0.8Hz
3
2
Pulse Rate Detector
7
641
-
LM311
7
+
U3
5
8
C12
104
R10 200K ohm 1%
VHPF
VCC_+5V
R26
10K ohm
P0.0/INT0
C10
Pulse Rate
104
Figure 2-1 Analog Board (Driver, Diff-amp, 0.8Hz HPF, 11x Amp, 38Hz LPF, and Comparator)
MPS-3117 is a pressure sensor for blood pressure monitor from Taiwan Metrodyne Microsystem Corp. Its
dimension is 7mm×7mm×10mm, and its measurable pressure ranges from -299.95mmHg to +299.95mmHg.
MPS-3117 uses a constant source to drive the Wien Bridge. It sends the double-ended output differential signals
according to the pressure.
Figure 2-2
shows the appearance and pin assignment of MPS-3117 pressure sensor.
Figure 2-2 MPS-3117 Pressure Sensor Appearance and Pin Assignment
2.1.2 Constant Current Driver Circuit
The BPM system requires a constant current source to drive pressure sensor. The typical value of drive current is
1mA while the maximum value of drive current is 3mA.
VCC_+5V
R1
1
2
3
J4
CON3
4.7K ohm
Q1
9012
R4
1.2K ohm
3
3
4
4
MPS-3117-006G_6_SOP
U1
2
2
1
1
6
6
5
5
R2
4.7K ohm
P1.2/T1PWM
Figure 2-3 Constant Current Driver and Pressure Sensor
In the BPM system, the differential amplifier plays the role of amplifying weak signal output from pressure sensor.
One way to do that is directly to the microcontroller as a DC signal of blood pressure. The other signal is provided
to the back analog circuits for filtering and amplification processing.
The diff-amplifier circuit output can be calculates as follows:
The analog board of the BPM system uses 2nd order Butterworth high-pass filter circuit, whose transfer function is
calculated as follows:
2
()
HS
HPF
=
CC
2
SS
()
++
()()( )
89102 389101718192 3
+
23
RR CCRRRRRR CC
+++++ +
S
1
5
6
VCC_+5V
84
+
-
U2B
LM358
R15 1K ohm 1%R14 1K ohm 1%
7
VHPF
VDI FF
R8 1M ohm 1% R 9 200K ohm 1% R10 200K ohm 1%
C2
C3
104
104
R17 1M ohm 1%R18 1.5M ohm 1% R19 360K ohm 1%
Figure 2-5 High Pass Filter Circuit : 0.8Hz
Suppose the network coefficient a11 of 2nd order Butterworth is 1.414 and the angular frequency is 0.8x2π, while
the value of both C2 and C3 is 0.1uF. So, the values of R8+R9+R10 and R17+R18+R19 can be calculated as
follows:
System uses 2nd order Butterworth low-pass filter circuit, whose transfer function is calculated as follows:
1
RRRCC
()
+
HS
()
LPF
=
2
SS
RRR
()
++
() ()
313229 11313229 8 11
Suppose the network coefficient a11 of 2nd order Butterworth is 1.414 and the angular frequency is 38x2π, while
the value of both C2 and C3 is 0.1uF. So, the values of R31+R32 and R29 can be calculated as follows:
System uses a single, high-speed voltage differential comparator as the pulse rate trigger circuit. The signal,
which goes through the RC low-pass filter, will input to the positive side of comparator LM311. More reference
voltage is put on the negative side. When the signal is greater than the reference voltage, LM311 will be output
high. Otherwise, it holds the low level. Figure 2-8
shows the pulse rate trigger circuit.
R35 1M ohm 1%
VLPF
R33 5. 1M ohm 1%
VCC_+5V
C7
104
C9
104
R34 10M ohm 1%
R22
100K ohm 1%
R24
50K ohm
Figure 2-8 Pulse Rate Trigger Circuit
The reference voltage value is calculated as follows:
3
2
VCC _+5V
-
+
8
C12
104
VCC_+5V
641
LM311
7
U3
5
R26
10K ohm
P0.0/INT0
C10
104
RR
VVV
CMPREFDD
=×=×
2424
++
222424
5
RkR
100
By adjusting the potentiometer R24 value, you can select the appropriate reference voltage for pulse rate trigger
circuit. The actual value of R24 in this BPM system is 0.745V.
2.1.8 Interface between Analog Board and Main Board
There are two interfaces (J8 and J9) between analog board and main board in the BPM system. One is called J9
that includes DC and AC signals of blood pressure and pulse rate trigger signal. Also, J9 provides +5V power,
both analog and digital ground. Both analog ground and digital ground is shorted by a 0Ω resistor. The other
interface is called J8 that controls the pressure sensor operation status. When P1.2 outputs low level, the sensor
turns on, else it turns off.
1
2
3
4
5
6
J9
CON6
P1.2/T1PWM
Pressure P1.2
ON 0
OFF 1
J8
1
2
3
CON3
R82 0 ohm
AGND
GND
VCC_+5V
P2.0/ADC0
P2.1/ADC1
AGND
P0.0/INT0
Figure 2-9 Interface between Analog Board and Main Board
In the reference design, Samsung’s S3P8245 is used as the microcontroller. The main function of this
microcontroller is to control both pump motor and valve motor, acquire and process both DC and AC of analog
signal, respond the pulse trigger and user button, and then display on the LCD screen.
The second function of this microcontroller is power management, record monitored results, and alarm patients
via buzzer.
P0.4/IN T4
P0.5/IN T5
P0.6/IN T6
P0.7/IN T7
C7 33pF
C11 33pF
C15 33pF
C16 33pF
J4
1
2
3
4
CON4
Y2
10MHz
Y3
32.768KHz
C10
100uFC8104
P0.1/I NT1
C17
104
VCC_+5V
+
12SW 5SW KEY -SPST
VCC_+5V
R23
10K ohm
C18
0.1uF
VCC_+5V
R24
10K ohm
SEG9
SEG8
SEG7
SEG6P2.4/AD C4
SEG10
SEG11
SEG12
SEG13
SEG14
SEG15
P4.1/SEG17
P4.2/SEG18
P4.3/SEG19
P4.4/SEG20
P4.5/SEG21
P5.0/SEG24
P5.1/SEG25
P4.6/SEG22
SW6
KEY2
P5.2/SEG26
P5.3/SEG27
P5.4/SEG28
P5.5/SEG29
P5.6/SEG30
P5.7/SEG31
P3.0/TBPWM
P3.1
P3.2
P3.3
P3.4
VDD
GND
XOU T
XIN
TEST
XTI N
XTOU T
RESET
P0.0/I NT0
The internal LCD module in S3P8245 can directly drive up to 128-dot (32 segments × 4 commons) LCD panel.
The internal resistor bias can provide 1/2 bias, 1/3 bias, and 1/4 bias, without any bias pin or off chip resistor.
S3P8245 supports two kinds of LCD voltage driving circuit, that is, internal and external. This solution uses
external LCD voltage driving circuit.
The LCD panel used can display systolic blood pressure (SBP), diastolic blood pressure (DBP), pulse rate (PR),
diagnose result, and other system status (such as battery under-voltage). The drive method is +5V, 1/4 duty, and
1/3 bias.
Figure 2-11 LCD Function Diagram and External Driving Circuit
2.2.4 Battery Voltage Detect
Battery voltage is measured through R30 and R29 to ground. The relationship between voltage of P0.2/ADC2 port
and battery voltage is as follows:
R
VVVV
=×=×≈×
ADCBATBATBAT
2
29
RRk k
++
2930
k
10
105.1
0.662
When the battery voltage drops to 4.8V, the voltage of ADC2 input is about 3.179V. After battery voltage resumes
to 5.1V, the voltage of ADC2 increases to 3.377V.
The system uses a two-wire EEPROM 24C01 as blood pressure monitored data memory unit. Three I/O ports
(P2.5 ~ P2.7) are used to control this device. One is used to control the power supply when EEPROM is not used
during the main software process. Other two ports are the serial data and clock line between the MCU and
EEPROM interfaces.
Even though the final system does not use the RTC, this interface is used for hardware and software upgrades.
The system remains real-time clock circuit for high-resolution time and date application. The PCF8563 is a CMOS
real-time clock/calendar optimized for low power consumption. A programmable clock output, interrupt output, and
voltage-low detector are also provided. All addresses and data are transferred serially via a two-line bidirectional
I2C bus. Its maximum bus speed is 400 kbit/s. The built-in word address register is incremented automatically
after each written or read data byte.
1
2
3
VCC_+5V
U5
A0
VCC
A1
WP
A2
SCL
VSS4SDA
24C01_8_D IP
9012
8
7
6
5
R18 10K ohmQ2
R20 100 ohm
R21
R22
20K ohm
20K ohm
P2.5
P2.6
P2.7
Y1
32.768KH z
C9CAP
C5
CAP VR
U3
1
OSCI
2
OSCO
3
INT
4
VSS
PCF 8563_8_DI P
VDD
CLKOUT
SCL
SDA
VCC_+5V
C6
104
8
7
6
5
R7
R11
20K ohm
20K ohm
P3.3
P3.4
Figure 2-13 EEPROM Circuit and Real-time Clock Circuit
The BPM system has a 6V DC motor for cuff inflation. The scope of internal air pressure is restricted to measure
blood pressure (170 ~ 200mmHg). This driver circuit uses symmetry bridge type to support three motor modes,
including start, stop, forward, and reverse modes.
When the User button is pressed (or system error occurs during measurement), the system will generate a buzzer
sound to grab the patient's attention. S3P8245 supports four kinds of frequencies for buzzer output. Therefore,
one I/O port connected through the buzzer module is used to control the buzzer frequency. The other I/O port is
used to enable or disable the buzzer output.
GM6155-5.0 is an efficient linear voltage regulator with ultra low noise output, extremely low dropout voltage, and
extremely low ground current. The EN pin (#3) in this regulator controls the VOUT pin (#5), which supplies power
to the MCU.
When EN is low, VOUT has no output. On the contrary, when EN is high, VOUT outputs +5V power. After
pressing Key1 (Power ON/OFF user button), the +6V battery voltage is sent to ground through R37, SW7, D4,
and R46. The voltage of R46 is about 3.97V. When EN is high, VOUT will start to output +5V power to the
microcontroller. During the system initialization process, after the microcontroller starts operation, P0.3 outputs
high level. Then regardless of whether Key1 continues to be pressed or released, the EN pin will always be high
and the system will work properly. After that, if you press the Key1 again, the +6V battery voltage is sent to ground
through R37, SW7, and R40. The voltage of R40 will quickly rise to 3.97V and the diode D4 is off, leading to a
rising edge on the external interrupt input port P0.2/INT2.
After the MCU responds to this interrupt, P0.3 output low level, diode D6 is off and EN will be directly shorted to
ground through R46. As a result, VOUT will stop the output power supply to microcontroller. The system will enter
the power-down mode.
Figure 2-17
P0.2/ INT2
shows the power supply circuit of this blood pressure monitor system.
Figure 3-1 shows the system flow chart with sequence of events in the software. After the microcontroller and
system initializes, if the Start button is pressed, the software enters the main loop. Battery voltage detect is used
for monitoring the battery voltage. The Blood Pressure Monitor starts a new blood pressure measurement for the
patient. After that, the software will respond to external user button operation, and execute the corresponding
function. When the system is waiting for User button out of time, the software will automatically shut down the
power supply.
This subroutine will complete a blood pressure measurement process for patient.
3.3.1 Overview of Blood Pressure Monitor
After initialization, the software inflates the pressure value to 200mmHg. The release valve remains closed during
this time. It then starts to exhaust the gas. Two seconds later, the external interrupt port 0 is enabled in order to
respond to the pulse signal.
In the ensuing process, the system monitors both DC signal and AC signals of blood pressure. As soon as the
software deflates the pressure value to 50mmHg, the system will end deflation. The pulse signal triggers the ADC
start operation. The software receives the effective DC and AC values of current cycle, that is, an effective pulse
signal. It can record up to 40 times of this effective pulse signal.
The software analyzes and diagnoses all monitored data. The final results are displayed on the LCD screen.
The subroutine monitors both DC and AC signals of blood pressure. Calculate the AC signal's peak-to-peak value
between two adjacent effective pulses. Determine the maximum and minimum values, and calculate the difference
between the two peaks. At the same time, the software will calculate the average DC signal value during the two
pulses.
The subroutine analyzes the obtained DC and AC values of blood pressure to determine the SBP and DBP points.
• First, find the largest peak-to-peak value in AC data buffer. Mark this point as MAP point.
• Second, search the point whose value is the closest to 0.54*MAP. This point is located in front of the MAP
point. The corresponding average value in DC data buffer specifies the systolic blood pressure (SBP) value.
•Search the point whose value is the closest to 0.72*MAP. This point is located behind the MAP point. The
corresponding average value of DC data specifies the diastolic blood pressure (DBP) value.
•Finally, the PR value for patient can be determined by analyzing the entire pulse rate (PR) data.
The system uses two wires EEPROM 24C01(1K, 128*8) as storage unit, which can record up to 35 blood
pressure monitor results, including SBP, DBP, and PR values. 24C01 is an EEPROM chip with I2C interface.
Read and write operations on the bytes have a special definition, as follows:
Write Start
Varibles Initialization
Send START Signal
Send C ontrol Byte
(1010xxx0B)
Receive ACK
N
Signal?
Y
Send Word Address
(0xxxxxxxB)
Receive ACK
N
Signal?
Y
Send Data to EEPROM
(xxxxxxxxB)
Read Start
Varibles Initialization
Send START Signal
Send Control Byte
(1010xxx0B)
Receive ACK
N
Signal?
Y
Send Word Address
(0xxxxxxxB)
Receive ACK
N
Signal?
Y
Re-send START Signal
Receive ACK
N
Signal?
Send STOP Signal
Delay 5ms
Write End
Figure 3-6 EEPROM Write and Read Operation Flow Chart
If the user power on/off button is pressed, the software will execute this subroutine. Only when the P0.2 remains
high level for more than 40ms, the system will be able to determine if this is a valid key. Then you can turn off the
power. The goal is to remove noise interference on P0.2. This way the system cannot be misused.