0% found this document useful (0 votes)
23 views10 pages

Low-Pressure Sensing with MPX201 O Sensor

Uploaded by

justsonic
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views10 pages

Low-Pressure Sensing with MPX201 O Sensor

Uploaded by

justsonic
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

MOTOROLA Freescale Semiconductor, Inc.

Order this document


SEMICONDUCTOR APPLICATION NOTE by AN1551/D

AN1551
Low-Pressure Sensing with the
MPX201 O Pressure Sensor

Jeffery Baum
Systems Engineering Group Leader
Sensor Products Division
Motorola Semiconductor Products Sector
Phoenix, Arizona

INTRODUCTION ,,,
,X $k\

Until recently, low+ost semiconductor pressure sensors Now that the pressure rang~ ~f i~k~est has been estab-
were designed to measure typical full–scale pressures only as Iished, the stage has been s~~~~~biderthe system solution
Freescale Semiconductor, Inc...

low as 10 kPa (1.5 psi). Of course, “measure” is a relative term. that is the enabling tec~~{d~ for achieving such low–
“Measure” is used hereto imply that an output of reasonable pressure sensing capaM~~{&o important in presenting this
magnitude, signal–to–noise ratio, and accuracy is produced low–pressure systemtwkn are some of the other applica-
by the sensing device. Such sensor products are available in tion characteristi~$esl~s the pressure range. For example,
various levels of integration and package types. Depending on the desired pre~~~~esolution, accuracy, available power
the level of application customization required and the budget supply volts@’Y~&end–equipment system architecture play
available, a sensor user may choose from a range of low– a major r@&.~&@@terminingthe implementation of this system
‘+~kv<$.
pressure sensor products such as a 10 kPa “bare-elemen? soluti~,n. s$$
,,:$,:
‘ -.,.
(uncompensated) device, a 10 kPa calibrated and tempera- ,,,:{.
+
~ ,$1>...
ture compensated device, or a fully signal+onditioned (high–
\r~EPOPMENT HISTORY
level output), calibrated, and temperature compensated inte- $. \..:\\.,
“,~.;i:
grated 10 kPa device. These options are typically available as ,$~~\ti,““”‘~orsimplicity’s sake, Iefs refer to this low-pressure sensing
well for higher pressures ranging up to 1000 kPa. “’”’itsvstem solution as the “smartsensinq” or “smart sensor svs-
What if the sensor user mu=t measure full–scale press~resfF ‘ t~m.” One of the key performance a~vantages of the smati
that are two, four, or even ten times lower than what #~#n- sensor system is that the output of the actual sensing element
tional sensor technology is capable of measuring?.;,@es~&h is ratiometric (linearly propoflional) to the excitation voltage
applications and customers exist?” The answe$$$~#@and applied to the sensing element. Since most semiconductor
“yes.” There are many potential customers t~~$~}~~~e such pressure sensors are characterized with a constant voltage
low–pressure sensing ability, the two ap~~~$~p’examples power supply, current excitation will not be discussed.
discussed here are: (1) heating v~~F~~$on and air– Although a sensor’s [Link] specified at a given power
conditioning (HVAC) in the context ,~#~#iJ#ng controls and supply voltage, there is some maximum supply that can be
(2) water–level sensing in applia~ce @~plications such as applied, beyond which power dissipation and self–heating
clothes washing machines, \*$$$$&i\,
.>;>>b\*$:: produce significant output errors or exceed the package’s
For the purposes of meas~,~~l{~w pressures, the units of thermal handling capability. This means that the strategy of
inches of water ~ H20) okd’i~$efers of water (mm H20) will increasing the sensor’s excitation to improve the sensor’s
be used. Typical HVA@ ap&@tions have a full–scale pres- sensitivity (increase signal output for a given applied pres-
sure of 40 mm H20 ,W*@shing machines have either 300 or sure) can be done in a dc fashion only up to some maximum
600 mm H20, de@~~/}#%n the region of the world (Note:just supply voltage. For Motorola pressure sensors, this limit
for reference ~{~~&&, 10 kPa = 4U’ H20 = 1000 mm H20 = allows only about a 5070 to 60% inCreaSe in sensitivity,
~$.,...
:J~,<,.~$‘<*
,::,~
1.5 psi). depending on the specific device family.
Of coW*~&sensor intended for a higher pressure range About five years ago, some of my colleagues were working
than @.~~$f interest can be used. However, the effect is that on pulsing the sensor supply voltage with a conventional volt-
onl~~$-ll potiion on the device’s dynamic output range is age and very low duty–cycle, sampling–and–holding the
w!~~the actual operating range. This low-level output may resulting output, and then filtering the output to produce a dc
thw be paired up with a larger than ideal amplifier gain. Thus, sensor output with very low–power consumption. This was the
a poor signal–to–noise ratio is usually the result, Some sensor impetus to consider pulsing a sensor at a much higher than
manufacturers have recently introduced pressure sensors recommended voltage and a low duty–cycle (1070 or less) for
designed for @ and 5“ H20 full–scale ranges (approx. the purpose of increased sensitivity. It is true that some of the
100–1 25 mm H20). These devices typically employ silicon sensor’s parasitic drawbacks, like its zero–pressure offset
with very thinly micromachined diaphragms or other sensing voltage and temperature coeticient of offset, are increased as
technologies that are significantly larger in form factor without well, but some of the sensor’s negative characteristics are
— any additional functionality. Thin diaphragm devices tend to be lessened. In addition, other sources of error and noise in the
extremely fragile and unstable. Even in cases where the system are not subjected to the higher amplifier gain that
— device is suticiently robust for the intended operating pres- would be required if operating the sensor at a conventional
sure range, the sensor has vey poor overpressure capability. supply voltage.

For More Information On This Product,


Go to: [Link] MOTOROLA
@ Motorola,Inc.1995 -. @
AN1551
Freescale Semiconductor, Inc.
The Motorola MPX201 O (see Table 1) is a calibrated and a Iow+ost MCU can also accomplish the functions of provid-
temperature compensated, 10 kPa (full–scale), pressure sen- ing a control pulse to a switching circuit (for the pulsed sensor
sor device. The data sheet specifies a full–scale output of 25 excitation) and affecting a synchronized sample–and–hold
mV at a 10 V supply voltage, for an applied pressure of 10 kPa. feature via software control of an on+hip WD convetier. In
This same device can be pulsed at 40 V at a 10% duty<ycle addition, the MCU has the capability to implement other
and produce either 100 mV for the same 10 kPa pressure or “smart” features that can lend the additional required accuracy
25 mV for only 2.5 kPa of pressure. This technique allows a and functionality desired for many low–pressure sensing
four–fold increase in the signal level for the rated full–scale applications. The system design intended for low–pressure
pressure of 10 kPa or the ability to maintain the same signal applications, as well as the performance-enhancing fea~res
level for a pressure that is four times lower (2,5 kPa). of pulsed excitation for increased sensitivity, signal ave~g%,
Although the idea is relatively simple, the key to providing
sofiware calibration, and software power supply r~d~k are
a low–cost smafl sensing solution is in both the hardware and
presented. The added functionality of intelligen~~@nica-
software implementation of this system. In the case of the
tions capability and serial digital output fl~w{y are also
micropower application, having a “stand-alone” analog sens- .,,:q~
discussed. ~:,tpp% y
ing solution was a key criteria. As such, this design used
Of course, these features lead to inm:~performance at
micropower op–amps, analog CMOS switches, gated timers
conventional, or even high–pres+u~${,~$ges. Nonetheless,
(one to control pulsed sensor excitation and one to control
these features have been dev~~~’~d ~“the context of low–
sample-and–hold function), and capacitive sample–and–
pressure sensing where the M~~~nce benefits area requi-
Freescale Semiconductor, Inc...

hold circuitry. The effect was a very low–current drain, micro-


site of the application. Alsq~$fiJ~~ acceptance of this system
power sensor solution. Since low–power, rather than low–
pressure, was the driving design goal, errors induced by technology is a much,:~~~;~@sk when coupled to providing
power supply variation, temperature drift, and device–to– a sensing capabilityyand@vBl of functionality that is otherwise
device tolerances were not critical. Not that these issues are not available in t~~~~:try today. Who would have suspected
not important for all applications, but for low–pressure sens- that a viable ,,-~~$ensing technology would have resulted
ing, even small temperature drifts, device parameter toler- from the ~~~i~~bf addressing the low–pressure sensing
ances, and power supply variations cause significant errors as market? ‘~@ificant pieces of this system solution are pro-
a percentage of the sensor output signal. tecte~/,ntel~&ctual propetiy. Motorola holds several key pat-
[t should be apparent that the “gated-timer pulsing/sampl+ en\&
,.$*. ohkysing pulsed excitation for semiconductor sensors
> ,$$,.
and–hold” system architecture can be equally well employed ~:@d *S filed several others regarding other potiions and
to pulse at higher voltages for increased sensitivity. However, ,c:~$$~~h enhancements to this technology.
f*..,>$
,,:.. 1;.”
,,~$tx.,\<,
! ,,

Table 1. MPX201O Operating Character@~,,(&upply Voltage = 10 Vdc, TA=25°C unless otherwise noted)
... .>>
~,. ....
:.3. ,.,:,$ .
Characteristic ~.j$:$,
.;.::\i,, ,+~$,$ Min Typ Max Unit
..,$.,
*i{\, :<$::\’+.l]$
s —
Pressure Range .,:.,.?%
.~i~).~~
~,. 0 10 kPa
,.\,> [.

Supply Voltage ,,.,~,j..:.,
,x :~$
.>j, 10 16 Vdc
,,. ...
Supply Current ,.~, — 6.0 — mAdc

Full-Scale Span (FSS) 24 25 26 mV


Zero–Pressure Offset -1.0 — 1.0 mV
,~. ‘.$:t”t)’
Sensitivity .,~ii
,.*“,~.> ~ 2.5 mV/kPa
i+:p, .!
~:;,+..
Linearity ..;,./,$$!IV -1.0 1.0 %VFSs
Pressure Hystg~~S@~ 10 kPa) *0. I %VFSS

Temperatur&x~&~ /esis (40°Cto+125°C) — +0.5 — ~oVFSS


,,(...,,*>.
Temper#u,r~~~ect on Full-Scale Span -1.0 -- 1.0 ~ovFss

Te@%@%#re Effect on Offset (O°C to 85°C) –1 .0 — 1.0 mV

~~$~hpedance 1300 — 2550 Q


&tput Impedance 1400 — 3000 Q
Response Tme (1070 to 90Y~) 1.0 — ms
Temperature Error Band o 85 ‘c
Offset Stability — +0.5 — ~oVFSS

For More Information On This Product,


2 Go to: [Link] Motorola Sensor Device Data

Freescale Semiconductor, Inc.
AN1551

SYSTEM DESIGN avoided by using a pulsed excitation at a low duty+ycle (on–


As mentioned in the introduction, the lowest pressure time) and reasonable period, and second order junction
devices in the Motorola portfolio are rated at a full–scale pres- effects do not occur until much higher voltages, the sensor
sure of 10 kPa (4V of H20). The calibrated and temperature output can be greatly increased by operating at a much higher
compensated, 10 kPa device (M PX201 O) is specified to oper- ac voltage than permitted by the dc counterpart of this same
ate at a 10 Vdc supply voltage and produce 25 mV (nominal) higher voltage. As an example, industrial applications like
at the full–scale Dressure of 10 kPa. This translates to a 0.25 HVAC have 24 V commonly available, and we want to accu-
mV/(V*kPa) pressure sensitivity. Additionally, the absolute rately measure pressures below 10“ H20. To achieve a 1–270
maximum supply voltage specified is 16 Vdc. Thus, the maxi- of full–scale accuracy (based on temperature drift errors~q s-
,,?,:’Y
mum full–scale output signal that can be achieved without tern noise, device tolerance, power supply vatiation~f~$~am,
exceeding the maximum supply voltage rating is 40 mV, or etc.), 9–1 2 mV is the typical minimum full–scale @a~;$hat is
60% greater than the output at the 10 Vdc specification. So, the desired target for the pressure range of ~QJ~~~F~or the
a 60~0 increase can be achieved in the output signal of the MPX201 O pulsed at 24 V, we obtain 15 ~ti;@~tput for an
sensor for the O–1O kPa pressure range, or the same signal applied pressure of 1W H20 (2,5 kPa~~~tii$#ame sensor
level of 25 mV can be preserved over a propoflionally lower device will only produce 6.25 mV aP~’’$@~mally specified
applied pressure range (i.e., O–6.25 kPa). The point here is supply of 10 V and 2.5 kPa, thus&no~~@ting the signal–to–
that increasing the dc supply excitation only produces limited noise ratio criteria for a 1–270 ~’${ac~ performance.
improvement in the output signal level. This smafl sensing soluti~&i,#$$@nded to sense full–scale
Freescale Semiconductor, Inc...

Much greater gains in output signal level (sensor span) can pressures below 10 H20#~~#ly~’of full–scale pressure reso-
be obtained, if it is possible to operate the sensor at signifi- lution and better than ~~,$~wscale accuracy. The following
cantly higher voltages. Since the thermal/power dissipation subsystems comprise~d’tfiardware potiion of this solution
limitation imposed by the maximum dc supply voltage can be

8-BIT
p, ,LO,?E, , MICROCONTROLLER

t
I

POWER SUPPLY
5v*5yo REJECTION
CIRCUITRY
REGUMTOR
I
A

~ tins

Hgure 1. Smart Sensing Block Diagram

For More Information On This Product,


Motorola Sensor Device Data
Go to: [Link] 3
AN1551 Freescale Semiconductor, Inc.
● high–side switch pulsing circuitry Thus, to detect low pressures and minute changes in pres-
sure, it is desirable to operate the sensor at the highest pos-
● signal–conditioning amplifier intetiace with resistors to
sible excitation voltage. The maximum supply voltage at which
adjust the sensor’s amplified, full–scale span and zero–
the sensor can reliably operate is determined by one or both
pressure offset
of the following two limitations: (1) maximum allowable sensor
● on–chip resources of a complete 8–bit microcontroller die temperature, (2) maximum supply voltage available in the
(MCU) sensing application/system.
● MCU oscillator circuitry (4 MHz) In terms of thermal/power dissipation, the maximum voltage
that can be supplied to the sensor on a continuous basis is
● 5 V *5% linear voltage regulator
relatively low compared to that which can be pulsed$~~:~e
● low-voltage inhibit (LVI) supewisory voltage monitoring sensor at a low duty–cycle. The average power t@$~~#S5]-
circuit pated in the sensor is the square of the average ~~d~~&xcita-
☛ resistor divider connected to the sensor’s power supply tion voltage divided by the input resistanc~5~wI& sensor.
.,. ,,.!.L::”.
~.,
bias to sense the excitation voltage across the sensor When the sensor’s supply bias is operated& %~y+~edfashion,
the average excitation voltage is simply ~#~PL&~uct of the dc
These subsystems are explained as follows to provide an supply voltage used and the perce~g$~~ycle that the dc
understanding of the system design and its intelligent features voltage is “on.” ;~:;\,>
,.;.:.,3
%$, I\,,.
(refer to Figure 2). The pulsing circuitry is a high+i,@~switch (two small-signal
Freescale Semiconductor, Inc...

switching transistors with @~&@fed bias resistors) that is


Pulsing Circuitry controlled via the output q~w~$e (TCMP) pin of the MCU. The
As previously mentioned, the sensor’s output is ratiometric output compare timerix~ti of the MCU provides a logic–
to the excitation voltage across the sensing element; the sen- level pulse wavefo$~ to’he switch that has a 2–ins period and
sor’s sensitivity increases with increasing supply voltage. a 200–Ls on–ti~~\#@e: this is user–programmable).
~rw
:1..:c>
,]. .,\\*;*:.
.,, .

,,., .,,.
‘!...,,

POWER SUPPLY
REJECTION DIVIOER

ti
111>1

m \

I LL

Signal Conditioning ● high input impedance


Even with pulsing at a relatively high supply voltage, the .
low output impedance
pressure sensing element still has a full–scale output that is
only on the order of tens of millivolts. To input this signal to the ● differential to single–ended conversion of the pressure
ND convetier of the MCU, the sensing element output must sensor signal —
be amplified to allow adequate digital resolution. A basic two– .
moderate gain capability
operational amplifier signal–conditioning circuit is used to
provide the following desired characteristics of an instrumen- Both the nominal gain and offset reference pedestal of this
tation amplifier interface: interface circuit can be adjusted to fit a given distribution of

For More Information On This Product,


4 Go to: [Link] Motorola Sensor Device Data
Freescale Semiconductor, Inc.
AN1551
sensor devices. Varying the gain and offset reference pedes- forms calibration with respect to a wide range of excitation
tal is desirable since pressure sensors’ full–scale span and voltages (20 -28 V typically for HVAC). Pressure measure-
zero–pressure offset voltages will va~ somewhat from lot to ment averaging is also incorporated to reduce both signal
lot and unit to unit. During software calibration, each sensor error and noise. In addition, the availability of a serial commu-
device’s specific offset and full–scale output characteristics nications interface allows a variety of software commands to
will be stored. Nonetheless, a variable gain amplifier circuit is be sent to the smart sensor system.
desirable to coarsely tune the sensor’s full–scale span, and a The following brief outline provides a more detailed
positive or negative dc level shift (offset pedestal adjustment) description about the software features included in the smati
of the pressure sensor signal is needed to translate the pres- sensor system.
sure sensor’s signal–conditioned output span to a specific
level (e.g., within the high and low reference voltages of the
ND converter). Sofiware Calibration and Power ‘;*~. .@
,.,ii$..
.}:*
~,!,.
‘?.:.*.$,
Supply Rejection *,..
,Llt,i{’
# *..., l.;%
.- ,,
Microcontroller Only six 8–bit words of information ~~$tofsd both to cali-
The microcontroller performs all of the necessary tasks to brate the smart sensor system for a.@~,R~fisor device and
give the smart sensor system the specified performance to store the relationship between %s# output and power
and intelligent features. The following describes its supply voltage. This informatig,~~$buseti to reduce errors due
responsibilities: to device–to–device vatia~~~$i;~b to reject variations in
Freescale Semiconductor, Inc...

Creates the control signal to pulse the sensor. power supply voltage th~~$an introduce error into the pres-
sure measurement. Th&~~&]s amplified output at the zerb
Samples the pressure sensor’s output.
pressure offset and f-le pressure are stored at each of
Signal averages a programmable number of samples for two different sup@~vo[t~es. In addition, the scaled and digi-
noise reduction. tized represen~~$WN3f the applied supply voltages is stored.
Samples a scaled< own version of the pressure sensor Compensatifg&Power supply variation in software allows
supply voltage. Monitoring the power supply voltage allows higher ~fl~y~ahce with lower tolerance, or even unregu-
the microcontroller to reject sensor output changes result- IatedF sfi~ly voltages. For HVAC applications, where a
ing from power supply variations. 24w%,line voltage will be simply rectified and filtered to pro-
Uses serial communications interface (SPI) to receive :~$d~.a&ude 24–Vdc supply, this approach has major perfor-
., .,.
commands from and to send sensor information to a .~%;@~,@ebenefits. The impact on applications where a regulated
master MCU. ~~::~pply iS available is that a lower+ost regulator or de-to-de
“+ converter can be used without compromising system accu-
Resistor Divider for Rejection of Supply ~~~ :’ racy significantly.
,$:}$::
,,>’,
Voltage Variation ~<11,~v\\i
~.
Since the pressure sensor’s output voltage is r@t@ficto
ND Sample Averaging
its supply voltage, any variation in supply volta@%Wi[~*esult in
Noise inherent to the 8–bit ND successive approximation
variation of the pressure sensor’s output voltW~Wbtienuat-
conversion method used by the smart sensor accounts for
ing the supply voltage (since the supply:-fray exceed
+1–bit resolution. Signal noise, which exhibits a measured
the 5 V range of the ND) with a resi~ot}~~~er, this scaled
peak–to–peak range larger in magnitude than 1 bit of WD
voltage can be sampled by the ~~r*roller’s ND con-
resolution, can be minimized by a sample averaging
verter. By sampling the scaled sg&~ $bltage, the microcon-
technique.
troller can compensate for any~~a~~ces in the pressure sen-
The current technique uses 16 ND converted pressure
sor’s output voltage that ~~$~~lo supply variations. This
samples, sums the result, and divides by 16 (the number of
technique allows correct ‘~k~s$hre determination even when
samples) to get the average:
the pressure sensor{@’&we~ed with an unregulatedsupply.
,:~,
~....,
!.~)i
.,>::,
5 V Regulatq~~:&:+ ‘“
.% ..~.+l
Avg= XT;
n (an) where n = 16 (1)
A 5 V t5Y0~~~~ge regulator is required for the following 1
functions;.:’~:~~, ‘*’ Assuming a gaussian distribution of noise, this averaging
● To ~~~id~#stable5 Vforthe high voltage reference (VRH) technique improves the signal-to-noise ratio (SNR).
@f@@’
~..<*. @f&rocontroller’s
?...&*J..
. WD converter. A stable voltage ref-
~Yl,~qce Is crucial for sampling any analog voltage signals.
● :$\~oprovide a stable 5 V for the resistor divider that is used
Smart Sensor Unit ID and Software
Revision Level
‘to level shift the amplified zero–pressure offset voltage.
This solution may be implemented as a single sensing sys-
tem using a nondedicated MCU to provide the sensing func-
Low Voltage Inhibit (LVI) Circuitry
tion and smart features or as a slaved smafl sensor (with
Low voltage inhibit circuitry is required to ensure proper
dedicated sensing MCU) that communicates over a serial bus
power+n–reset (POR) of the microcontroller and to put the
to a master controller or microprocessor (Host). Pati identifi-
MCU in a known state when the supply voltage is decreased
cation and software revision level can also be read on request
— below the MCU supply voltage threshold.
from the master MCU. This information is utilized by the
master MCU to determine what the full–scale pressure range
SOFWARE DESCRIPTION
of a given smart sensor unit is. This allows for multiple sensor
The smart sensor system’s EPROM resident code provides units with different pressure ranges to be controlled and
the control pulse for the sensor’s excitation voltage and per- sensed from a single master MCU.
For More Information On This Product,
Motorola Sensor Device Data Go to: [Link] 5
Freescale Semiconductor, Inc.

Table 2. Sofiware Command Codes

Function Command Data from


(Command Codes) from Host Smart Sansor

Request Pressure $01 $00-$FF

Dynamic Zero $02 —

Undo Dynamic Zero $03 — *,\


*’X,l,
$J,$<,.
,,.,’~
,’$:.
‘!i.,,,1+ts.,
Pressure Range $04 TBD ,:?:L*S
,*,Y
*’\$,~,
.?., <>.>:.
.. .:+\ <+
.t::.,,f
,1:
,}~~..
>:>’.’
~{,,.\
.,.,.,.\\,~
.\,:j+ ..}\’~:*\,
...pt
~$
,.;;:. . ,e,,,:::,
~
,;~:.rt,$s
.~,,!. .~,
..>$(.,,.
\‘~*Ji ,
.... .:$,.‘~.
.,?\r
. “-w
Communication Pressure Range (from O to 255)< +: ““;it#
The serial peripheral intetiace (S PI) is used to communicate
to a master/host MCU. The master MCU initiates all 1/0 control where ‘o ~5~5’) x FS =A$Fred Pressure (2)
Freescale Semiconductor, Inc...

,,.>,..
and sends commands to the slave regarding data requests,
calibration, etc. The command codes are parsed at the slave (This calculation is peti&~&#y the master MCU.)
.*$:>x&
.$9:&

in a look–up table, at which time the corresponding request Dynamic Zero @igflk:;hrrent input pressure as the offset
is serviced via subroutine. Table 2 lists the Master/Slave value, in order $~~w a nonzero pressure as the offset
commands. ,~t~f,.,,, !,i~
reference. ,~ ; .??
i>,, .
, ‘?::,,..+*>
.,,’,’;
Request Pressure Returns the percent of full–scale Undo D@c’Zero Resets offset to the otiginal stored
pressure applied to the sensor in the form of $00 (0) through offse~~see ~namic Zero).
$FF (255) and is equivalent to: y::>,.
~~~~~~e Range Returns a value representing the sensor’s
~m~~wbale pressure range.

+tsk
‘{~

1 /+
Din
MSB LSB
o I

Figure 3. SPI Timing Diagram —

For More Information On This Product,


6 Go to: [Link] Motorola Sensor Device Data
Freescale Semiconductor, Inc.
AN1551
enhancing features of signal averaging, software calibration, bility can be greatly enhanced via a smafl sensor system
and software power supply rejection. The added–functionality approach.
of intelligent communications capability, serial digital output
flexibility, and local control and decision–making capability are
ACKNOWLEDGMENTS
also at the user’s disposal. The development history, system
design, software functions, example communications rou-
tines, and serial output format have been detailed to provide
the reader with an understanding of how low–pressure capa-
Freescale Semiconductor, Inc...

For More Information On This Product,


Motorola Sensor Device Data Go to: [Link] 9
AN1551 Freescale Semiconductor, Inc.
*WE NEED A SUBROUTINE TO WRITE TO AND READ FROM THE SPI
*TO CALL THIS ROUTINS LOAD ACCUMULATOR A WITH THE CO~ DATA
*AND JSR WRITSPI . WNEN THE ROUTINE RETURNS, ACCUMULATOR A
*CONTAINS THE DATA RETURNED FROM THE SENSOR

WRITSPI LDX #PORTS BASE ADDRESS OF THE I/0


STAA SPDR, X SEND THE CO~ TO THE SENSOR
WRLOOP BRCLR 7,SPSR, WRLOOP LOOP UNTIL THE DATA HAS SHIFTED
OUT OF AND BACK INTO THE SPI
LDAA SPDR, X RETRIEVE THE RESULTS OF THE LAST
CONNAND
* TO THE SENSOR
RTS

* NOW WE NEED TO CALL THE ABOVE */


START JSR INITIO SET-UP THE I/0
LOOP LDAA #$1 1 IS THE COMMAND TO THE SENSOR THAT

* REQUESTS PRESSURE
JSR WRITSPI SEND THE CO~ TO THE SENSOR.
* ... THE VALUE RETURNED IN ACCUMULATOR A
* WILL BE IN THE RANGE O. .OXFF = O. .100%
Freescale Semiconductor, Inc...

* FULL SCALE PRESSURS THE SECOND TIME


* THROUGH THE LOOP . THE INITIAL TINS
* THROUGH THE LOOP , THE DATA RETURNED
1S’ INDETE~INATE DATA FROM THE SENSOR
BRA LOOP

Table 3. SPI Timing Characteri~s “kJ’-


..,.
Characteristic Symbq&’&*?\ “’Min Max Unit

Frequency of Operation fQpJt’.J ‘ dc 525 kHz


*
Cycle Tme ts~~’ar – 1920 ns
!> —
Clock (SCLK) Low Time ,t~~ ~$CLKL 932 ns
l)?.
Dout Data Valid Time <.$,.,,.~’ti> 200 ns
,~, h
,,\ .*..*.
..?,,l\+\,$
Din Setup Time ‘I:..{., ts 100 — ns
,&::\,?’
- ~, ,...,,
Din Hold ~me ,s$).?~!,
.$:,... ,~;;’~ tH 100 ns
‘.i::;:*3::$, .,#
On–Bus Delay Time .?;.;!...$\ .,,,, tDl 1 — ms
t~.i, ‘!:.’.
Off-Bus Delay Time .,].-, .>,i:,.,..}
,[: \i:.:. tD2 50 ps

Chip Select Period .,., “ki, 14 tti3 TBD — ms

. \sq%
.:i. ,&*

SERIAL DATA OUTPUT:~$RM~i CONCLUSION


,~:\,.
*).,*+p
The serial data outpu~:~,~~~ &bit number of value O–255. A smart sensing system that achieves high performance for
This number repres~~$~~&:’current applied pressure as a low–pressure applications has been presented here. The key
percentage of the ‘l:~%ale pressure rating of the smart pedormance advantage of the smati sensor system is that it
sensor. The ma~~~~~@U can simply consider an output of “O takes advantage of the fact that the output of the actual
to be zero p~~~~:%nd “255” to be full–scale pressure, To sensing element is ratiomettic (linearly proportional) to the
convert thi~;>-er to engineering units, such as inches of excitation voltage applied to the sensing element. A sensor
water ~’w},~ the master MCU must multiply the smart device is pulsed at a much higher than normally specified
sensor ou~ut (O–255) by the full–scale pressure of the smart voltage and a low duty–cycle for the purpose of increased
sensor in “ H20 and then divide (normalize) by 255, See sensitivity. Although some of the sensor’s parasitic drawbacks
equation 2. are increased in magnitude, some of the sensor’s negative
The master MCU can either use an absolute number for the characteristics are lessened, and other sources of error and
full–scale pressure of the smart sensor (as indicated noise in the system are reduced. The net effect is that a better
previously) or can query each smart sensor that is connected signal–to–noise ratio is obtained. This, combined with several
to the serial bus for its rated pressure range. The latter other performance-enhancing smaflfeatures, provides better
technique allows multiple smafl sensors of various full–scale pressure resolution and accuracy than inherent in the sensor
pressure ranges to be communicating with a single master device alone.
MCU, without the need for an absolute addressing scheme Besides the sensor excitation pulsing and output sampling
that contains full–scale pressure information for each sensor. functions, a low–cost MCU provides the performance–

For More Information On This Product,


8 Go to: [Link] Motorola Sensor Device Data
Freescale Semiconductor, Inc.
AN1551
SOFTWAREEXAMPLES out of the parallel 1/0, so as to simulate the SPI pot. As long
as the timing relationships of data and clock follow those of
The following example listings show how a user may
Hgure 3 (see also Table 3), the smati sensor will function
communicate with the smati sensor via a master MCU. The
sofiware example shown assumes that the master MCU is an properly when intedaced to a processor with a parallel type
MC68HCI 1. Any MCU with the proper 1/0 functionality will intetiace. In the following two code examples, the sensor unit
operate similarly with the smart sensor system, is interfaced to the master MCU via the SPI port, and the
When using parallel 1/0 instead of an SPI poti to interface
sensor’s CS input is connected to the HCI1’s Poh D pin 5.
the smati sensor, the user must “bitbang” the clock and data This example is coded in ‘C’ for theMC68HC11: ,*!.
‘*{,3,
es:<.\.*:<2~,
>“*rit. ~
,r.,.-.
,}y ,:l?’ ~.
~,*
!:;l)
~* ~~~~~ ~~~~~~~~~~~~~ ~/~ (~~~=~=~~ ~~~~~ ~~~~ ~~ ~~~=”~~ ~/~ ~~~~~~~~~~~) */
..\~,,\
:)$:,!,
,.
~$$..
void init_io (void) .l,.:} *1
*b*$3t.\
{ ‘$:’
.jf’:$,!.
$
‘,,‘~.’~$~
.~:~
,!
p~~~~ = o~zg; /* ~~, p=~ = 1, p~~ = ~, p~~ = ~ *, .!$.
,,,:$
:., ,.$. ,a
\,,b.\,.$“””
DDRD = 0X3B; /* SS* PD5 = 1, PD3 = 1, PD1 = 1, PDO = 1 */ ~,,
,,. .,,
(~,,,.:,
,,:,
\~, ...!.
?~:.
SPCR = OX5E; /* ENABLE THE SPI, MAXE MCU THE ~STR, SCK = E CLK /4 */ .i..
‘.
~,.~ .<.** .Y+
/* ~j~ lNITIALIzATZ~N 1S COMPLETE *1 ,$,>
.... ‘*J.
*%.;./”
~,.,
} ~~l.h
,\:+:,&,
t~,?
,!.$,.,
~~
,+l,.,, ~t$..
,,..*
.,>..,.::,
Freescale Semiconductor, Inc...

f* ~ ~ED A F~CT1~N To ~lTE To - ~~ FR~K THE sP1 ~/ ~,,,,$


.> ‘T+:
mite_spi (char data) ~{,$i.c
T+‘ ,.
.’
i>,.
‘t~:t.x,y
:*’
{i.j)>\
...r
{ $l.i~\$>:*r,.,Jz>,
,,
/* ~ZTE THE DATA To T~ SpI DATA p~RT *f ,,.
SPDR = data; “’;y:
~+i;\\i,
while ( ! (SPSR & 0x80 )); /* WAIT UNTIL DATA HAS SHIFTED OUT OF AND .,:.
..
$.
%N ~$,.
.,,...
:,/,
BACK INTO THE SPI */ .,,
.$\$:,:,.,.
.~>\.
return (SPDR) : /. ~TR~E~ T~~ ~s~LTs OF THE ~sT ~o~ To .,, ‘~$< J
,,.

..,:~,~;k..,;,?;<.a
~
rtn_data = writ e_spi (OXO1 ); /* OXO 1 IS THE C-~ THE SENSOR
THAT RE~,F~kRESS~ . THE VALUE IN
rtn_d&~~.,w~ BE IN THE RANGE OF
-. ‘~
i..$s.
[Link]$yo.. 10 O% FULL SCALE PRESSURE THE
S-.p+I~ THROUGH THE LOOP. THE INITIAL
,s,.
“*~@JYHROUGH THE LOOP, THE DATA
$:$’Y-D IS INDETERMINATE *I
} ,,L>lr).+
4~.J>,r\8
~,:~.’
,\< \.J*t\
*., *.. -.
The next example is cod@:$~@#embly for the MC68HC1 1:
.’.:~:;.
, ~)$
.~..$F
* PORT OFFSETS INTO ,:~~ I/@ NAP
PORTS EQU ~?~’?~<~;’ a $1000 ASS~ THE 1/0 STARTS AT $1000
PORTD EQQ y ‘~?$ $8
J..~’{,,..$
.....
DDRD ~.,+\.,
?@2:k: ‘ ::
SPCR
SPSR ..,,%~$ds: $29
SPDR .yk ,,:%U $2A
~:+.
, ,..~,~
.,3.J@\
,,+;.,>,,.,
,.,>,,
.><*:,,
,J.$),,lt.,:,
,, ORG $EOOO
~~$~~~ INITIALIZE THE 1/0
I+$@bti LDX #PORTS BASE ADDRESS OF THE 1/0
..i,,
LDAA #$29
STAA PORTD, X SS* PD5 = 1, PD3 = 1, PDO = 1
LDAA #$3B
STAA DDRD, X SS* PD5 = 1, pD3 = I, pD~ = ~, pD~ = ~
LDAA #$5E
ST~ SPCR, X EN-LE THE SPI , NAKE MCU THE MASTR,
* SCK = E CLK /4
RTS 1/0 INITIALIZATION IS COMPLETE

For More Information On This Product,


Motorola Sensor Device Data
Go to: [Link]
7
AN1551 Freescale Semiconductor, Inc.
Freescale Semiconductor, Inc...

How to reach us:


USA/ EUROPE: Motorola Literature Distribution; JAPAN Nippon Motorola Ltd.; Tatsum”=PWLDC, Toshikatsu Otsuki,

PO, Box 20912 Phoenix, Arizona 85036. l+OW1–2~7 6F Seibtiutsu~Aenter, >142 Tatsumi Kot&Ku, To~o 135, Japan. 0W521431 5

MFAX: RMFAXO@ [Link] – TOUCHTONE (602) 2W609 HONG KONG: Motorola Semiconductors H.K. Ltd.; 8B Tai Ping Industrial Park, —
INTERNET [Link] com 51 Tng Kok Road, Tai Po, N.T., Hong Kong. 852-26629298

MOTOROLA For More Information On This Product,


@ 0 2PHX34660W
Go to: [Link]
PRINTED IN USA 10/95 IMPERIAL LITHO 155555,000 SENSOR YBAGAA AN1551/D

llllllllllllllllllllllllllllllllllllllllllllllllll

You might also like