Question:
Converting RS232 to CMOS levels via resistors and a transistor?
BasAndit
2009-01-11 13:01:04 UTC
+3.3v-----------/\/\/\----o---------output(cmos level)
.............................|
+/-12v------\/\/\/--o \
.......................|-------< (transistor)
.......................|..........\
.......................o--\/\/\/---\----\
gnd -----------------------------------/

Sorry for my crappy graphics, you can look at a ss here http://zonemikel.com/crap/232converter.bmp

Basically the +/- 12 volts from the output of my db9 port on the back of the computer is chopped down to 6 volts to control the transistor (2n3904). When there is +12 volts output from my serial TX line it will allow the electrons to flow through the transistor to the ground making the output ground or logic 0. When the output from my serial TX is less than tweleve it will not allow the electrons to go to ground so they go back past the resistor to the 3.3volts creating a logic 1.

so if input = 12v output = 0v.
if input < 12v output = 3.3v.

Anyway its not working, its my own design so im not sure what im doing wrong. Any ideas ? Im only worried about changing the rs232 output into a cmos level so i can transmit it, Im not worried about the other way around (yet).

I dont want to introduce a basic logic circuit because im afraid of propagation delay.
Three answers:
billrussell42
2009-01-11 13:19:12 UTC
first of all, "so if input = 12v output = 0v.

if input < 12v output = 3.3v." is not a correct set of levels.



But your schematic doesn't reflect the levels anyway.



Re your schematic, why do you have a 12 volt battery in the circuit? I'll assume that is not there, and the RS232 input is on the pin IO1. But you do need the 3.3 volt battery.



also, your base resistors are much too low in value and may load the circuit. I don't recall the RS232 loading rules offhand, but make those two resistors 20x larger at a guess.



What are you seeing when it doesn't work?





PS "I dont want to introduce a basic logic circuit because im afraid of propagation delay." makes no sense. RS232 is a very slow data transfer standard, and prop delays on gates is usually about 10nS, much faster than RS232, which is in the microseconds.



.
zuberbuhler
2016-11-10 03:41:02 UTC
There are countless the rationalization why a resistor would or would no longer be required in a transistor circuit. Transistors used for digital logic (i.e. TTL) circuits act as switches. while bipolar transistors are used, uslually the emitter is grounded at as quickly as, and a resistor may be utilized in sequence with the backside to cut back base contemporary. The collector then is many times pulled to the prejudice voltage (Vbias) by ability of a resistor, and then the collector voltage indictes a a million (Vbias) or 0 logic point. An exception to that's far less straight forward ECL (emitter coupled logic). interior the case of analog amplifier circuits, there are countless configurations, the main straight forward being straight forward emitter or straight forward source (interior the case of MOSFETs), and from time to time straight forward base in school C amplifiers. In those analog circuits, resistors are used to regulate bias for sophistication of operation (how long the transistor conducts contemporary throughout 360 ranges of area) and would additionally cut back transistor saturation contemporary, besides as tournament the impedance of a transmission line. the place the resistors are located relies upon on how the amplifier is meant to artwork; In switching potential furnish purposes, transistors (many times MOSFETs) are meant to run the two in saturation or cutoff. Any time spent working different than those 2 circumstances reduces the performance. while the transistor is in saturation, the suitable transistor has 0 resistance (a quick), and clearly that's a suitable open while in cutoff. those circuits many times do no longer require any resistor to floor.
lare
2009-01-12 14:05:04 UTC
rs232 uses plus 12 volts as the mark and minus 12 volts as the space. You are using the plus 12 as mark and anything not plus 12 as the space. While this may look ok on the logic chart, it ruins the noise immunity of the loop as a practical matter. This kind of "decoding" will be subject to a lot of false signal errors. use a translator ic chip, they have the design problems already worked out.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...