[ Pobierz całość w formacie PDF ]
.As with most transmission media, there is a trade off between thespeed and the maximum distance the system can be used for.If youintend pushing the transmission distance to its maximum value, youwill have to accept a reduced speed.As a rule of thumb, halve thespeed if you double the distance.RS232CThis is one of the transmission standards created by the EIA committee.This standard allows for transmissions up to 50 feet (15 m) and atspeeds of up to 20 kbaud (it can actually exceed this speed anddistance but it s not guaranteed).The baud is the measure of the speedof transmission.It is the number of clock periods per second, whichapproximates to the number of bits per second.The RS232C transmission is balanced at about 0 V.Here s the time tobe careful, the binary one level is a negative voltage (between 5 and 15 V) and a binary zero level is a positive value between +5 and249Introduction to Microprocessors and Microcontrollers+15 V.This seems upside down compared with all our previous uses ofbinary.Our letter E would be transmitted as in Figure 17.9.Thetransmitter levels are specified as ±5 V but the receiver limits are 3V.This allows for a noise spike to be up to 6 V before there is anypossibility of misreading a piece of data.Figure 17.9RS232CtransmissionRS423AThis is an improved version having a maximum speed of 100 kbits/s3and a maximum cable length of D 4 mile (1.2 km).The transmissionvoltages have to be between ±3.6 and 6 V and the receiver can godown to ±0.2 V.Changing voltage levelsHow do we change the binary or logic values into the RS232 voltagelevels? If you are building a microprocessor-based system then themost obvious way is to use a pair of integrated circuits called the 1488(transmitter) and the 1489 (receiver).These integrated circuits havebeen around for many years and are simple and reliable.They have asmall snag in that they need 12 V supplies whereas nowadays 5 Vsupplies are much more common so you may find some newtransceivers (made by Maxim) more interesting.These only require asingle +5 V supply and generate their own ± voltages for the RS232Ctransmission.Each chip contains two transmitters and two receiversand operate up to 120 kbits/s.The devices are numbered MAX202,MAX208, MAX220 and MAX232 and others.PCs have a serial portthat provides signals at RS232C levels.Using RS232C in real lifeMost RS232C links are via a 25-pin D plug or a 9-pin D plug andsocket (Figure 17.10) but unlike the Centronics which is quite stableand usually work straight off, the RS232C can be a real nuisance.Before attempting to communicate, you must ensure that thetransmitter and the receiver are using the same word length and parityvalues are set for the same speed of operation.Even then, it may take250InterfacingFigure 17.10 D connectors for RS232Csome experimenting before they spring into life.The problem is thatthere are many more options for the other connections.All have to beagreed between the receiver and the transmitter.The specifications arenot detailed enough and can lead to different interpretations.It is notsurprising that it is often insufficient to connect an RS232C cablebetween two pieces of equipment and switch on.You will need to gethold of the RS232C connection specification and settle down in acomfortable chair.ModemsA modem (MOdulator DEModulator) converts a digital signal into twoaudio tones so that the transmission can occur along a telephone line.Telephones are generally designed to accept frequencies between300 Hz and 3.1 kHz.This relatively narrow bandwidth was chosen toallow speech to be transferred with undue loss of quality whileallowing the largest number of calls to be passed along the same cable.Once the digital signals are on a telephone line then the range isunlimited.Choice of systemsA few metresWe can use the raw binary data transmitted over a simple cable (seeFigure 17.11).Figure 17.11A very short rangelink up251Introduction to Microprocessors and MicrocontrollersTens or hundreds of metresWe can convert the transmitted signal to RS232C or RS423A asnecessary (see Figure 17.12).Figure 17.12Around thebuildingUnlimited rangeAdd a modem and link by telephone or optic fibre (see Figure17.13).Figure 17.13Around theworldAn optic fibre linkA piece of optic fibre is a solid piece of glass or plastic.The plasticfibre is about 1 mm in diameter and is suitable only for short ranges ofa few tens of metres but it has the advantage of being cheap and easyto use [ Pobierz caÅ‚ość w formacie PDF ]