Professional Documents
Culture Documents
70
22
V
OH
I
OH
V
OL
I
OL
13
Humun und PhysicuI Interfuces {Chupter }
keypud oIIows numeric or oIphonumeric
informofion fo be enfered.
A keypod is bosed on swifches.
In order fo moke good use of ovoiIobIe
Iimifed porf pins, swifches of fhe keypod
is connecfed in o mofrix.
keypud urrunged in 4 3 mutri
{4 Rows und 3 CoIumns}
4 3 mutri
urrungement of
the keypud
requires onIy 7
MCU pins ruther
thun 1Z MCU pin
connections if
sepurute switches
ure used for euch
key,
How to reud the keypud
keypud urrunged in 4 3 mutri
{4 Rows und 3 CoIumns}
Suppose key 7 is pressed:
I
sf
phose yieIds:
3
rd
Pow Iine (porf bif b) wiII be Iow.
Z
nd
phose yieIds:
I
sf
CoIumn (porf bif 3) wiII be Iow.
I
sf
phose
Z
nd
phose
X is don'f core
condifion,
since unused
FIow Diogrom
14
Seven Segment DispIuy
Seven Segment dispIoy is o porficuIorIy
versofiIe sfondord configurofion of LEDs
pocked in o compocf woy. 8y Iighfing
differenf combinofions of fhe seven
segmenfs, oII numericoI digifs con be
dispIoyed, os weII os o number of
oIphobefic chorocfers. A decimoI poinf is
oIso ovoiIobIe in some unifs.
Two fypes of connecfions ore ovoiIobIe
nomeIy common-onode ond common-
cofhode.
There ore 8 LEDs in fhe pockoge
incIuding fhe dof poinf. Due fo common
onode/cofhode configurofion onIy 9
connecfions ore required. Pockoge hos
I0 pins in oII, wifh common onode or
cofhode foking fwo pins.
Seven Segment DispIuy
DigituI muItipIeing to drive severuI seven segment dispIuys
Each oI the digit common-cathode
lines is connected to a logic-
compatible MosIet transistor.
When the gate voltage oI the
transistor goes high, the transistor
conducts and the common cathode
terminal goes low, and any segment
whose anode is at logic high
illuminates
Digits are activated continuously in
turn. With the right speed, a 4 digit
number will be seen without
noticeable Ilickker
Common-cathode type 7-segments
15
Liquid CrystuI DispIuys
Liquid CrystuI DispIuy {LCD} is o very versofiIe dispIoy unif
ovoiIobIe in vorious fypes (oIphonumeric, grophic, serioI, poroIIeI,
efc.)
Driving LCD direcfIy is nof enfireIy simpIe. Hituchi deveIoped o
microconfroIIer (HD44780) specioIIy designed fo drive
oIphonumeric moduIes. This microconfroIIer defined on inferfoce
fhof hos become oImosf sfondord for LCD dispIoys. Wifh fhis
inferfoce, LCD inferfocing fo generoI-purpose microconfroIIers
such os PICMicro MCUs become quife eosy.
Liquid CrystuI DispIuys {LCD} ovoiIobIe in our Ioborofory is fhe
mosf common ond economic fype, known os poroIIeI LCD. LCD
dispIoys wifh Z row x Io coIumn, Z row x Z0 coIumn ore commonIy
used in MCU oppIicofions.
Liquid CrystuI DispIuys
Certuin Churucteristics of puruIIeI LCD:
Dofo is fronsferred on o 4-bif or 8-bif dofo bus, defermined by fhe user.
4-bif mode oIIows inferfocing of LCD fo MCU wifh onIy 7 connecfions, buf
somewhof sIower fhon 8-bif mode.
The 3 confroI Iines (Pegisfer seIecf, Peod/Wrife, EnobIe) of fhe 7
connecfions ore used fo confroI fhe LCD operofion.
AddifionoIIy on LCD moduIe suppIy ond ground connecfions musf be mode,
fhere moy be oIso confrosf, bockIighf connecfions.
There is o simpIe insfrucfion sef (i.e. inifioIi;ing ond cIeoring dispIoy,
Iocofing cursor, efc.)
There ore Z LCD-moduIe infernoI regisfers (dofo regisfer, insfrucfion
regisfer), which ore used fo fronsfer dispIoy dofo ond fo fronsfer
insfrucfions.
InfernoI resources of LCD invoIve dispIoy PAM ond chorocfer generofor
POM.
On-power up, HD44780 musf undergo specific inifioIisofion process,
hence usuoIIy cerfoin omounf of deIoys ore required for fhe HD44780-
driven LCD fo operofe wifhouf ony probIems.
16
Liquid CrystuI DispIuys
8 data lines
3 control lines
Power supply connection
Contrast connection
Ground connection
MCU Interuction with the PhysicuI WorId
To inferfoce wifh physicoI worId,
MCU musf be obIe fo defecf fhe sfofe of fhe physicoI voriobIes
ond,
MCU musf be obIe fo confroI fhese physicoI voriobIes
This inferocfion wifh fhe physicoI worId is by done by fronsducers.
Inpuf fronsducers, oIso coIIed sensors, defecf ond converf physicoI
voriobIes info eIecfricoI signoIs (i.e. Iighf or femperofure sensors,
or sensors fhof defecf Iineor or onguIor posifion, dispIocemenf,
efc.).
Oufpuf fronsducers converf eIecfricoI voriobIes fo physicoI, ond
fhose cousing physicoI movemenf ore oIso coIIed ocfuofors (i.e.
soIenoids ond mofors of vorious fypes, efc.)
17
MCU Interuction with the PhysicuI WorId
There ore numerous ronge ond fypes of sensors ovoiIobIe fodoy
incIuding 'smorf' or infeIIigenf sensors fhof ore infegrofed onfo on
IC hoving on-chip signoI condifioning.
Some SimpIe Sensor ExompIes
Microswitch
{bump-sensor}
used for
mechonicoI
posifion sensing
LDR {Iight-sensing}
PefIecfive-opficoI
sensor used os o
shoff encoder
PefIecfive-opficoI sensor consisfs of on
infrored LED, ond o phofofronsisfor
mounfed side by side.
We'II use
CNY70
{Vishuy}
1F7XA DigituI Input Churucteristics
The chorocferisfics for o IoF87XA (using bV suppIy) porf bif shown
beIow iIIusfrofes fhof inpuf voIfoge Iying befween 0 ond 0.8V is
inferprefed os o Logic 0, ond inpuf voIfoge Iying befween Z ond bV
is inferprefed os Logic I. An inpuf befween fhese is undefined.
Logic inpufs, hove infernoI profecfion
diodes (connecfed reverse biosed-
from inpuf fo ground ond from inpuf fo
bV). These profecfion diodes become
ocfive when inpuf is eifher of b.3V or
of -0.3V, wifh fhe moximum inpuf
cIomp currenf of Z0mA. If obsoIufe
rofings greofIy exceeded, MCU wiII be
domoged.
18
Ensuring IeguI Iogic IeveIs input protection; Switch debouncing
VoIfoge spikes in signoIs,
excessiveIy sIow edge signoIs, DC
offsef in signoIs ore possibIe
sources fhof con couse probIems
during MCU inpuf. Some simpIe
remedies moy invoIve os iIIusfrofed
beIow:
Ensuring IeguI Iogic IeveIs input protection; Switch debouncing
In digifoI circuifs mechonicoI
swifches moy hove o swifch bounce
probIem (when swifch is ocfivofed
mechonicoIIy fhere occurs mony
confocfs ond disconnecfions).
Hordwore soIufions fo swifch
bounce probIem incIude use of PC
Iow poss fiIfers, fIip-fIops,
Schmiff friggers, ond soffwore
remedies moy invoIve simpIe deIoy
Ioops.
19
Actuutors
In on embedded sysfem, physicoI movemenfs (Iineor or onguIor mofions)
con be required. SoIenoids, DC, Sfepper ond Servo mofors ore common
ocfuofor exompIes.
OnIy very smoII eIecfricoI Ioods, Iike LEDs con be direcfIy driven by o
microconfroIIer. Lorger Ioods, drowing beyond obouf Z0mA, or powered
from o voIfoge higher fhon fhe Iogic suppIy voIfoge, need fo be inferfoced
using power swifching devices.
Current is fIowing uIwuys in sume direction,
ReversibIe Switching of Actuutors by using H-ridge
H-8ridge invoIves fwo-poirs (A ond 8) of swifching devices
(fronsisfors) befween suppIy ond ground IeveIs. Eoch poir hos o
high-side ond Iow-side swifch confroIIed by confroI inpufs (X, Y)
The Iood (mofor) is connecfed befween fwo poirs fo form on overoII
H configurofion. The swifches in o poir musf never be on of fhe
some fime, becouse fhis wiII shorf fhe power suppIy fo ground.
Therefore, if is common fo drive fhe swifches fhrough Iogic
inverfers fhof ensure onIy one swifch be on of o fime in eoch poir.
Current flow when High-side
A and Low-side B is on
Current flow when High-side
B and Low-side A is on
We'II use LZ93D
H-ridge
{ST MicroeIectronics}