Page 179 - Making PIC Microcontroller Instruments and Controllers
P. 179
't?4 col{DlTlol{ll{G tHE oulPUT SlGl{Al
COMPUTEB SERIAL II{TERFACE
The PIC family of mi croconlrollers can send inlbrmation to. and receive inlormation
from, a compuier. This can be alone serially and in thc p allel mode lt is much easier
io usc serial communicatio s, which is covercd in detail in Chapter 9
COMPUTER PARALLEL INTERFACE
Some PlCs provicle thc abiliiy to create a slave parallel porl On ihe PtC 16F877A,
PORTD is uscd for rhis. while PORTE is uscd to control and monitof data transLr
contain details on using slave pofts lbr these inte|faces. but they are
Thc dalasheets
a1lhe level ollhis texl and if all you want 1o do is communicate with a
not Decessafy
jntedace We will not cover
PC, by far the easiest way lo do so is with a sedal RS232
parallel port commurications in this book
INDUCIIVE LOADS
Any time we are sending an clectricttl signal to an irductivc dc load' we have to make
arrangements to absorb the Ilow ofenergy reteased when the inductive load is dis-
conn;cted. The easiest way 10 do this is to prolide an aPpropriate diode that will
ofl-er a safe path for thc reverse current to dissipalc The diode is installed so it is
conducting in th,3 direction oppositc to the normal flow of currcnt Altach the cath-
ode ofthe diode to the positive terminal, ard the anode to the ncgative lerminal of
ihe induclive load as close to the load as possible- In this posiiion. no currcnt will
ilow ihrough the diode when conneclcd across the dc voltage, bul when thc device
(rclay, solcnoid, anal so on) is disconnccted, the reverse current ftom it will flow
acro;s this diode and be dissipated in thc device ilself. Diodes nust be selected to
match the expected load amperage and voltage There is no harm iD ltsing a djode
that is larger than needcd.
RESISTIVE LOADS
Resistive loacls can be connecteal directly through solid state rclays (SSRS) thal will
acceptTTllevel signals and that calt contrcl anywhere from l0 to 40 amps at 120 volts
ac d;ecdy. These SSRs arc thc intedaces ofchoicc for connecdng thcse loads because
thcy are easy to use and all lhe internal clectronic work is already done for us (see
Figure 12.1). Some of these units even have a tiny LED built into $em lo indjcate
wien they are active. (Dcvices ollcn turn o1T and on whcn the ac voltage goes through
the0 voltage transition, soyou must make sure the load vohage will actually gothrough
0 volt, or the device will/may nol switch.)
Selcct a unit specifically suited to the task you have in mind lrexpensive unrts
are available fiom mosl supply houses selling surPlus electronic equipment on fie
Internel. I myself have purchased uscd units and have ncver reccived onc that did