I am using this circuit to interface a serial device to my propeller.
· I cant seem to send data though.
· The device i am using does not have a DTR connection. So currently i have nothing connected to
· RESn or DTR. Could this cause the propeller to
·not transimit?
·
Comments
In your case however I suggest that you at least pull DTR down to Vss and hopefully this will work. Alternatively I would just use a 1K from pin 2 to 5 to do the same thing but achieve a stronger pull-down.
*Peter*
However, this circuit still looks a bit strange to me. connecting NPN transistors to negative BE / CE voltages... On the net you can find a number of level converter schematics. Or use a MAX3232 with a few caps for a clean implementation.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Airspace V - international hangar flying!
www.airspace-v.com/ggadgets for tools & toys
The circuit that you posted was derived from what is currently built into all the BS2 modules.· The DTR pin supplies a negative voltage via the 10K resistor.· If you omit the DTR connection to the PC serial port you will not be able to program the Propeller, but if you supply a negative voltage, you should at least be able to communicate via the serial port.· Simply connecting the pull-down to ground will not provide enough voltage potential for the PC to communicate.
One method to generate a negative voltage is to use a diode/capacitor off of the PC ports TX pin.· Again, you still won't be able to program the Propeller, but you should be able to establish serial communication.
·
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
The 1K resistor to ground is sufficient as the PC's RS-232 input circuit is only looking for a low of anything less than 1V or so. A stronger pull-down of 1K or less is needed to ensure that it pulls-down hard enough and fast enough. If he has indeed done this properly and it does not work, yet works with a negative voltage, then I will concede that you were right (in this instance anyway) [noparse]:)[/noparse]
*Peter*
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Airspace V - international hangar flying!
www.airspace-v.com/ggadgets for tools & toys
That's the same thing that I suggested, only they used a different value resistor and a cap.
I have read several articles where most of them state....
"The RS232 physical specification gives a logic 1 at the receiver input as -3 to -25 volts and logic 0 as +3 to +25 volts."
...The region between -3V and 3V is usually stated as undefined, and some, not all, serial PC cards may not be able to deal with signals in this undefined range. Thus why creating a negative voltage usually solves the problem.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
Post Edited (Beau Schwabe (Parallax)) : 3/24/2009 5:46:32 PM GMT
What are the specs on your serial device?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
RS-232-C
RS232 Transfer Protocol
Protocol Value
Cable 9 pin to miniplug.
Baud 9600
Parity None
Bits 8
S Bit 1
Flow None
RS232 Cable Pinouts
Pin # Description· Pin # Description
1 Unused··········· 6 Unused
2 Transmit········ 7 Unused
3 Receive········· 8 Unused
4 Unused··········· 9 Unused
5 Ground
Hmm... Nothing that indicates any voltage thresholds?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
Thanks for the help.·
Just curious as to why it wouldn't work and why it works now.
Remember dodger, the forum's 3 ways, the original poster, the respondents, and the lurkers (at least for the thread).
*Peter*
Post Edited (dodger) : 3/30/2009 11:15:37 PM GMT
I can't see how you get it to work as you misread Beau's diagram which needs a diode in there. It looks like he used a "---|<---" symbol for the diode which you might have missed.
If you copy his diagram and paste it into a Spin window it will look clearer.
Still, with the way you have wired it the capacitor directly across the TX will degrade the transmit signal terribly to the point that it can't work.
I still maintain that you only need a 1K resistor (not 10K) or less from the collector of the PNP to ground for it to work.
*Peter*
P.S. I mean the "TX" from the PC of course
Post Edited (Peter Jakacki) : 3/31/2009 1:07:52 AM GMT
Too Right. [+1]
If you don't need to be standards compliant and just want it to work then use a non-inverting logic gate (I use 74HCT1G86) for the transmitter and a 10K series current limit resistor for the receiver with a 47K pulldown at the Prop end. Works every time.
Why there is nothing "standard" about the RS232 standard:
This modern RS232 "standard" and being "safe" is total rubbish. There is no need at all for a negative voltage as there is no way at all for the receiver to detect it or for any communications to benefit from it. Switching threshold is around +1.8V, no voodoo, no mumbo-jumbo about this figure. Your standard MAX232 type chip under actual load will output +/-6V and knowing the characteristics of the receiver you already know that the negative part is because of the original 60's standard which did require it back then. Many of my products have RS232 just because they need to be conpliant for the standards but the most I do to communicate to RS-232 othertimes is provide a buffer to output 0..5V as I normally have 5V available and then 2 resistors (pulldown + current limit) for the receiver. In fact one commercial product with standard RS232 had to be pressed into accepting 5 receive channels for digital radio broadcast use and my product only had 2 "proper" RS232 inputs (RXD+CTS) and the others were of the resistor kind. With the flexibility of the Prop and a bit of software these units have been running without a hitch 24/7 for years.
You can't get the distances with 0/5 that you can with +/-12.
Short runs? Meh. Probably not as important as getting that Pin2-Pin3 deal right.
Maxim makes a good deal of cash producing these devices and it's not because people are being duped by an "RS232" hoax.
Please.
Another +1 to that.
I bought whole lot some years back. Simple to use. Quicker to solder up than using discrete transistors and other components as you don't need to be checking tiny writing on transistors and getting them round the right way. MAX3232s are cheap. Uses 4 0.1uF caps (and I like to put another one across the supply pins) and if you are already buying 0.1uFs in bulk for bypassing ICs then they are cheap too. What else? You get two ports in one chip so if you want to add another port you can do it for free. You can short RS232 pins, cross them over, feed 12V AC or DC down the pins and it won't zap the propeller chip.
They are not +/-12V, they never have been, at absolute best they are +/-9V without load and with 1uF caps. Unlike the very first transatlantic cable where they tried using higher and higher voltages to go the "distance" until they had damaged the cable, it turned out that the solution was not voltage but having a more sensitive receiver, that is a better method. Anyhow, right at the moment I am running and powering a Prop and VGA display at the end of a 100M phone cable and I would never ever think of using RS232 to go the distance, never, just good old 0..5V for that thank-you. RS232 is limited in speed and distance and noise immunity because the standard is almost as old and misapplied as the first transatlantic cable methods were.
Stop propagating this RS232 "safe" nonsense although I agree that Maxim do make a lot of money out of propagating the "need to be safe" nonsense. The standard should have been redefined decades ago to fit in with modern "RS232" where the chips are designed to work with 0..5V "RS232" signals, it's a de-facto standard that the need for the negative part was dropped back in the early days of micros for compatibility with logic powered devices. Read the datasheets of any RS232 receiver and tell me different if you can.
I am not disputing the validity of what you are saying. Most equipment manufactured in the last 25 years or so will work quite well with a 0 to +5V signal. On the other hand if you want to be absolutely certain that your RS232 serial I/O will be compatible with any piece of equipment that has an “RS232” connector then you will need to have an output signal that goes between at least +3 to -3 volts. Even then, I have had some truly ancient equipment (35 years old and only recently retired) that will only work with a serial signal that is at least +-5V.
It is much simpler to use a MAX3232 or equivalent and be sure it works with whatever is connected to it than to rely on something that may or may not work.
The point is that I will use a MAX232 when it needs to be compliant. The fact is that I don't think we are talking about ancient equipment either as I am well aware of stuff that was made in the 70s and even 80s that did have receivers that required the negative voltage as part of their switching threshold. None of this applies and especially when you have someone who wants to cobble together an interface to "RS232" which invariably means a PC or something made in the last 25 years (a 10 year old PC i regarded as ancient) which have been following the unpublished "mum's the word" de facto standard of 0..5V. So whenever someone asks how they can cobble together an RS232 interface you could tell them to go out and buy a special chip or they could do it with bits they have laying around. KISS - without being "dangerous" (as opposed to safe). We may know what the standard is and isn't but there is no need to propagate this RS232 mystery.
While the Max3232 solution is in many ways ideal, the chip is hard to get here in Taiwan... so Beau's two transistor solution seems a very good choice. One can use the 2n2222 and 2n2907 for this as alternative parts without trouble.
Meanwhile, Peter can destroy something by exploring the absolute minimum of two resistors for a RS232 to Propeller interface.
The real problems is that all the manufacturers abandoned providing the +12/-12 power supply that true RS232 requires and decided to ignore the -12 requirement completely. It is so much cheaper to have the signal swing between +3.3 and 0.
And then suddenly, we had the USB port with a more expensive and more complex chip forced upon us and the RS232 and the PS/2 ports just disappeared.
++++++++
If you have trouble with reading the image, copy it to your computer and then zoom in on it. My browser zoom won't enlarge it.