|
|
|
| PIC to RS232 - 6 ways for a reliable hardware interface contact: vasile@s3.itim-cj.ro |
| 6 metode de interfatare a microcontrolerului la RS232 last update: april 2004 |
| Very cheap modules for learning PIC microcontrollers ! Interested ? Preturi romanesti pentru module cu microcontrolere PIC. Interesati ? |
| Transmiter's logic levels Why
we need level converters between PIC microcontroller and
PC? Because there are logic level differences on input
and output pins (different voltage potentials) between
those two families. For both TTL and RS232, the
red-yellow zone is the unwanted output level. |
![]() |
Diferente intre nivelele logice ale
iesirilor RS232 - TTL. Zonele verzi reprezinta domeniul acceptat al nivelelor logice, in timp ce zona galben-rosu reprezinta domeniul de incertitudine. Un potential situat in zona de incertitudine va produce (cu aceeasi probabilitate) la iesirea operatorului logic a unei stari 0 sau 1 logic. |
| Receiver's logic levels The RS232
transmitter must have highest voltage than the input
thresold of the RS232 receiver (+/-3V). |
![]() |
Diferenta intre domeniul permis de intrare pentru
RS232 respectiv TTL. Pentru o functionare corecta,
transmitatorul RS232 trebuie sa prezinte o tensiune de
iesire mai mare decat pragul de comutare al receptorului
(+/-3V). Cu cat distanta dintre transmitator si receptor
este mai mare, cu atat trebuie sa fie mai mare diferenta
intre tensiunea generata de transmitator si pragul de
comutare al receptorului. |
| 1 Old fashion using the 1488 (transmitter) and 1489 (receiver), this is a standard level converter with bipolar supply (the transmitter) and unipolar supply (the receiver). Both are inverted, so the comunication lines are active low. 1488/1489 can be grabbled from any old serial¶llel PC-ISA IO card. High output current on transmitter. Up to 900m/1200baud. Large heat dissipation. Very old. Not very happy with ESD. May be used for PIC to PIC connection. |
![]() |
1 Convertor de nivel al anilor '80. Transmitator cu 1488, receptor cu 1489. Comunicatia este activa in stare logica zero. Greoaie pentru utilizator, fiindca necesita doua circuite integrate si trei tensiuni de alimentare, metoda este energofaga dar robusta, mai putin in cazul unui stress ESD. Are marele avantaj al unui curent serios generat in linie, accepta distante mari, functioneaza bine la viteze pana la 115200. Se pot utiliza si alte combinatii de alimentari: +5V, -5V, +12V sau +5V, +15V, -15V. |
| 2 Converters with local charge-pump circuit. Bipolar supply generation from one single +5V supply. A huge numbers of IC's (MAX200 to MAX252). 3V and 5V supply available. Cheaper clones like ST232CN. Smallest output curent on transmitter than version 1. IC without external capacitors available. V+ and V- depends drastically by the line load. This is the most used level converter. Both transmitter and receiver lines are active low. Up to 1Mbaud transfer rate. Up to 50m/2400baud with a twisted Rx-GND, Tx-GND cable. Always check the opposite RS232 hardware equipment (for the input impedance) when are using this device! May be used for PIC to PIC connection. |
![]() |
2 Convertoare de nivel cu circuite specializate charge-pump. Max232, Max3232, ICL232CP Exista foarte multe circuite compatibile cu cel din imagine, in general scumpe. ST232CN are un pret acceptabil. Au avantajul simplitatii (necesita o singura tensiune de alimentare) si dezavantajul unui curent modest injectat in linie. Nu pot fi interfatate corect cu receptoare cu impedanta de intrare mica. Rata de transfer este de maxim 1 Mbaud. Comunicatia activa pe zero logic. Valorile condensatorilor C1-C4 difera de la 100nF la 22uF in functie de tipul de circuit. |
| 3 Tricky version. Do It Yourself style with (garbage) transistors recovered from your basement. Both transmitter and receiver are not inverted (active high). Up to 115200 baud/5m. D1 and D2 can miss with a PIC connection. May be used for PIC to PIC communication. |
![]() |
3 Varianta tranzistorizata. Receptorul si transmitatorul sunt neiversori (activi pe 1 logic). Avantajul este pretul de cost redus, dezavantajul major este necesitatea existentei a trei tensiuni de alimentare si impedanta inegala de iesire in linie pentru cele doua nivele logice de iesire. |
| 4 Very tricky version. Negative supply voltage borrowed from TXD-PC line, via D3. Transmitter is inverted. Receiver is not inverted. Up to 115200baud/5m. Transmitter's output impedance is different for low and high levels. When using a PIC, D1 and D2 are redundant components. It's working only with RS232 equipments which are generating the negative voltage ! (you can't connect two PICs on a RS232 and just duplicate the schematic for both PICs) |
![]() |
4 O varianta care necesita alimentare negativa din linia TX a PC-ului. Transmitatorul este activ pe 0 logic, receptorul este activ pe 1 logic. Impedanta de iesire a transmitatorului este diferita pentru cele doua nivele logice. Functioneaza fara probleme pana la 115200baud/5m. Tensiunea negativa nu este disponibila in portul PC pana in momentul initierii comunicatiei! |
| 5 A modified of the 4'th version, for a compatible active low communication, both lines are inverted (like MAX232). Working up to 115200baud/5m. Don't work for PIC to PIC connection on RS232. |
![]() |
5 O varianta modificata a versiunii 4. Comunicatia este activa pe 0 logic atat pentru transmitator cat si pentru receptor. Comunicatia este compatibila cu versiunea 1 sau 2. |
| 6 A much better solution than 1. Both transmiters and receivers are sharing the same package. GD75232 is pin to pin compatible with SN75185. Supply variant: VCC= +5V, VSS = -15V, VDD = +15V, GND = 0V Maximum data rate: 120Kbaud |
![]() |
6 O varianta ce combina transmitatorul si receptorul din fig.1 in aceeasi capsula. Cinci receptoare cu histerezis si trei transmitatoare sunt disponibile utilizatorului. Circuitul este robust si se comporta bine la tensiuni de alimentare accidentale ce depasesc specificatia tehnica. Necesita insa prezenta a trei tensiuni de alimentare. Este cel mai utilizat circuit convertor e nivel in cartelele IO pe bus (E)ISA. |
| 7 Don't miss the oportunity and take a look to this interesting page! |
Stef Mientki's RS232 hardware page | 7 Nu ratati ocazia de a vedea si aceasta interesanta varianta ! |