Need Help with RS232 to TTL Converter; Thx - Page 1
Forum section: electronics / beginners

author: Electro Fan
author_rank: Super Contributor
timestamp: November 19, 2013, 05:55:32 am
content: http://www.nkcelectronics.com/RS232-to-TTL-converter-board-DTE-with-Male-DB9-33V-to-5V_p_369.html(There several photos and also a schematic for the product shown at the link above).I have one of the above RS232 to TTL converters.I'm simply trying to get the RS232 voltage to drop down to the TTL range, but something is amissI have connected two of the male pins on the TTL converter's RS232 connector to a RS232 port on my PC. Using HyperTerminal I can cause the green (RX) LED on the converter to blilnk. Each key press on the PC causes one green blink. By moving the wire from the PC port to the TTL converter one pin further over on the converter I can also make the red (TX) LED blink. (In this case it makes a "soft" red blink.)The LEDs are clearly being powered by the RS232 port as there is no other power being applied to the converter (at this point in the process).I have added header pins to the side of the TTL converter that is opposite the RS232 connector. When I attempt to read any voltage on the header pin side I get nothing. (I have probed GND and RX and GND and TX.)In reading the literature for the product I figured that the coverter chip might need some voltage beyond what it gets from the RS232 signal coming from the PC. I can't really figure out why this would be the case except that the converter board has a pin called VCC - so I tried adding 3V (and also 5V) from my power supply by connecting the power supply to the VCC and the GND pins header pins. With voltage from the power supply applied to the converter board the red TX LED turns on continuously and brightly. While this is occuring I can hit keys on the keyboard and get the green RX LED to blink.If at this point I move the PC's RS232 port power wire (the non GND wire) to the converter's top middle pin (which normally powers the red TX LED), the bright state of the red LED goes off, but the soft red blink ability of the red LED works as I hit keys on the keyboard.What I would have expected from all of this is that I should have been able to probe the header pins on the coverter (with my scope or a DMM) and see voltages between 0 and 3V or between 0 and 5V as I depress keys.The goal was to see the higher voltage from the PC RS232 port come down to the TTL range, but so far no luck.Any suggestions? Thanks!

author: jeremy
author_rank: Super Contributor
timestamp: November 19, 2013, 06:45:27 am
content: Looking at the schematic on that page, the VCC pin of the MAX232 is not connected to the RS232 port. So you must apply external power via the 12pin connector for the device to work. You can sometimes turn ICs "on" by putting weird voltage levels on the pins; you can "power" some of the 74 series logic chips via their inputs, but I promise they won't behave the way you think! It also needs external power so that the converter knows if it is stepping down to 5V or 3.3V (or something in between). I would be wary of anything which claims to be powered by the RS232 port; that is not what it was designed for and power supply ability may not be consistent across different computers.You won't see much/anything on a DMM because the signals will be too fast. Oscilloscope should work though.Easiest way to test these adapters is to just run a wire from RX to TX on the level translated side and then plug it into your computer. Anything you type should be sent back to you.Is there a reason you aren't just using a USB->TTL converter a la FT232?

author: Electro Fan
author_rank: Super Contributor
timestamp: November 19, 2013, 07:07:50 am
content: Quote from: jeremy on November 19, 2013, 06:45:27 amLast question first, I'm just experimenting in attempt to learn - not really trying to "build" or "connect" something.If I understand you correctly, the converter must have voltage supplied (from the power supply); it can't just run off the voltage from the PC RS232 port. If this is correct, it should be A-OK running off my DC power supply between 3 and 5 Volts, right?Next, I did try to do a loop back using the TX and RX header pins but as soon as I connect the TX to the RX to make the loop back it cuts out the bright/solid red LED. Maybe something is goofed up with my converter?Thanks for any further advice.

author: MrAureliusR
author_rank: Unknown
timestamp: November 19, 2013, 07:15:17 am
content: Are you making sure to attach the ground wire into the RS-232 port on the PC side?As said before, make sure everything is powered correctly (ususally listed as VCC) and grounded correctly. sometimes these modules have one pin to power the module and another to specify the I/O voltage on the TTL side. So make sure if there's a VCCIO or VIO pin that it has 5V as well.Assuming everything is connected properly (check your Rx/Tx wires -- we all get them messed up from time to time!) then it should work flawlessly. Personally, I've always found it easier to buy some MAX232's in bulk, some 1.0uF caps and just make my own module using protoboard. Takes about 10 minutes and they always work flawlessly.If you want more help making a MAX232 module I'd be happy to help.

author: andtfoot
author_rank: Unknown
timestamp: November 19, 2013, 07:25:29 am
content: Quote from: Electro Fan on November 19, 2013, 07:07:50 amYup, running it off a power supply is needed. I normally use 5V (I'm usually going to an 89C2051 processor or similar).The LEDs on the board are put in to light up on a positive voltage on the RS232 pins. This is a logic 0, which is opposite to the normal idle state of the RS232 port (negative voltage, logic 1).So when you connected the Tx and Rx, the idle state coming into the Rx (logic 1, negative voltage, LED off) was pushed back out the Tx, and so it's LED turned off as well.At this point, I'd imagine you would measure 5V on both the TTL side pins relative to ground. (TTL is positive voltage = logic 1)This is all assuming you had the PC connected at the time.Did you get the text back and/or any lights blinky when sending some text down the line?Quote from: Electro FanThat sounds right. This is a DTE device, and so is your PC, so you would need a crossover cable (pin 2->3, and 3->2).

author: Electro Fan
author_rank: Super Contributor
timestamp: November 19, 2013, 07:41:14 am
content: Hey, Thanks Everyone!Progress!With confidence that I needed the external voltage from the power supply and focusing on the loop back (checking the RS232 to converter connections and using the level converted TX to RX connection with the converter header pins) it seems like everything is running!Like the TV commercial says, "it's easy when it's easy" - but until then it's a definite learning experienceI have found that turning the voltage and amperage setting up and down a bit on the power supply can sometimes cause the converter to shut down; I can see why when the volts or amps are set too low or too high, but it's hard to understand why in the midrange this should happen. Might be that something inside the converter chip is touchy?Anyway, I'm getting the characters I type in HyperTerminal returned to the PC (and echo is turned off in HyperTerminal) so I think the signal is going from the PC to thru RS232 port at roughly 12 volts peak to peak and then it's getting converted to TTL and then getting returned to the PC at the RS232 level - so it's all good.The next step is to probe the setup with the scope so I can confirm the voltage on the RS232 side and on the TTL side.Thanks again!

author: Electro Fan
author_rank: Super Contributor
timestamp: November 19, 2013, 08:02:52 am
content: Now we are rocking and rollingI probed the loop back on the level converted side (on the converter header) and the scope shows the characters rolling by with nice square waves (more or less as expected) and the amplitude measurement says 3.01-3.02 volts (and 3.11-3.12 Top) vs. my power supply's 3.10 volt setting. Definitely in the ballpark of TTL levels vs. RS232 levels.One (more) really beginner question. The scope probe was intially just attached to one of the converter header pins (the TX, along with the loop back wire). I didn't attach the probe ground to anything which is shown in image 1; in image 2 I attached the probe ground to the converter GND (along with the GND from the power supply). Presumably the cleaner signal in image 2 is the result of attaching the probe ground?Thanks

author: andtfoot
author_rank: Unknown
timestamp: November 19, 2013, 08:11:49 am
content: Quote from: Electro Fan on November 19, 2013, 08:02:52 amNot seeing any images, but yes you would get a cleaner picture with the ground clip attached. Without it, the return path for the signal is probably coming back via: PC ground -> PC power lead -> power board/socket -> house wiring? -> power board/socket -> scope power lead -> scope ground.

author: Electro Fan
author_rank: Super Contributor
timestamp: November 19, 2013, 08:20:46 am
content: Quote from: andtfoot on November 19, 2013, 08:11:49 amOk, much better to use the ground on the probe!

author: jeremy
author_rank: Super Contributor
timestamp: November 19, 2013, 09:16:49 am
content: Quote from: Electro Fan on November 19, 2013, 07:41:14 amWhat sort of changes were you making?Good to hear it is working.

author: Electro Fan
author_rank: Super Contributor
timestamp: November 19, 2013, 09:26:52 am
content: Quote from: jeremy on November 19, 2013, 09:16:49 amWell, since the spec calls for 0-3V or 0-5V I was curious to see at what levels the the TX and RX LEDs would give out (indicating that something might not be converting); so, I just changed voltage a tenth of a volt at a time within the ranges and also did likewise with the amperage setting on the power supply. I couldn't quite figure out what was causing the the LEDs to give out here and there but occassionally they did and then I'd have to reset volts or amps (mostly when I go close to the top and the bottom of the ranges, but sometimes in the middle.)

author: jeremy
author_rank: Super Contributor
timestamp: November 19, 2013, 09:43:57 am
content: The voltage and current knobs on your power supply represent supply limits, and twiddling them may be switching the supply between constant current and constant voltage mode (there should be a light or something that indicates this). Think about it this way: your voltage control is set at 5V, and the current control at 1.5A. When the supply switches on, it begins to increase the voltage from 0V up to your voltage limit. If we assume that your load is a constant resistance, as the voltage rises the current will also rise proportionally. If it gets to 5V (the limit), then the voltage stops rising and the supply is said to be in CV or Constant Voltage mode. Alternatively, if you resistance is low enough (let's say 1 ohm), then when the voltage rises to 1.5V (1.5V/1 ohm = 1.5A) it will hit the current limit. So your supply will stay at 1.5V to give 1.5A and is said to be in CC or Constant Current. Note that it will stay at 1.5V regardless of what your voltage limit is; after all, a limit is only a limit. You will likely hear a relay click when you switch between CV and CC.Note that if you twiddle the voltage knob while in CC mode, nothing will happen. The supply doesn't care if the limit is 5V, 6V or 7V! It's gonna stay at 1.5V so that you are within your current limit of 1.5A. Same sort of thing goes for CV mode.Perhaps you can see that if you are fiddling with the limits and cause your supply to switch between CV and CC then you can drop the voltage level below what is necessary for the IC to operate. If you can't, try it! Nothing like a real life experiment

author: Electro Fan
author_rank: Super Contributor
timestamp: November 19, 2013, 06:48:33 pm
content: Quote from: jeremy on November 19, 2013, 09:43:57 amThanks Jeremy,I watched to see if I could discern any repeatable thresholds (such as current limiting) and I wasn't able to do so on the first go round but I'll try again. (What's the best way to measure the resistance while the converter is being driven by the Power Supply and the converter signal is being probed by the scope?) I appreciate you taking the time to outline the specifics - I'll report back when I get some time to revisit this. EF

author: jeremy
author_rank: Super Contributor
timestamp: November 19, 2013, 09:55:03 pm
content: You can't really measure the load resistance directly, you need to measure the voltage and current and ohms law back out.Can you post a picture of the front panel of your power supply?

author: Electro Fan
author_rank: Super Contributor
timestamp: November 20, 2013, 05:10:01 am
content: Quote from: jeremy on November 19, 2013, 09:55:03 pmAttached are some photos.1 is the scope showing the TTL converter being supplied with 3.0 volts (the setting on the Power Supply); the scope measures the amplitude as 2.92 Volts. The Power Supply is set for a maximum of 0.7 Amps (you can’t see this); the actual amperage as per the Power Supply is 0.008 Amps (8 millivolts). I have a DMM in the circuit and it confirms 0.008 Amps.2 is the same as 1 but with a close-up so that you can see the 2.92 Volt reading on the scope.3 shows the PS turned down to 1.2 volts (with 0.7 amps set as the maximum); the PS is showing an actual of 0.001 amps. The square wave is barely holding together on the scope.4 shows the PS turned down to 1.1 volts (with 0.7 amps set as the maximum); the PS is showing an actual of 0.000 but perhaps it is delivering slightly more amps.In each of the photos where you can see the Power Supply the Constant Voltage indicator is on.2.92 Volts / 0.008 Amps = 365 Ohms ? (some times it fluctuates to 0.007 Amps)1.2 Volts / 0.001 Amps = 1200 Ohms ? (perhaps it's closer to 0.002 Amps?)perhaps the Power Supply is seeing a resistance of about 500-600 Ohms?

author: jeremy
author_rank: Super Contributor
timestamp: November 20, 2013, 05:32:40 am
content: Ah, the infamous Korad.According to my MAX232 datasheet:http://www.ti.com/lit/ds/symlink/max232.pdfYou can only run the max232 at a minimum of 4.5V ? Do you have a MAX232on your board? You should have a MAX3232 if you want to use 3.3V.If your voltage is out of spec, the behaviour of the IC is undefined and not guaranteed by the manufacturer. It might turn into a short circuit, or it might turn in to a high frequency oscillator, who knows. Don't lose sleep over trying to understand what it is doing; coincidently enough, 1.2V is the drop across a silicon BJT, while 1.1V isn't. So you could be doing some weird transistor biasing.

author: Electro Fan
author_rank: Super Contributor
timestamp: November 20, 2013, 05:55:45 am
content: Quote from: jeremy on November 20, 2013, 05:32:40 amAh, the famous BJT (Bipolar junction transistor)According to the converter supplier:http://www.nkcelectronics.com/RS232-to-TTL-converter-board-DTE-with-Male-DB9-33V-to-5V_p_369.htmlDescriptionOur new RS232 Converter Board, is a quick and easy solution to adding RS232 communication to your project. The board connects directly to most standard microcontroller UART's to provide simply 2-wire communication.The board incorporates the industry standardICL3232for signal conversion and buffering.Suitable for standard TTL 3V to 5.5V input.This compact and inexpensive board can be used on most control systems.FeaturesIncludes ICL3232 or compatible IC with CapacitorsSupports 3V to 5.5V (based on regulated DC voltage supplied to the board)DB9 Male Connector (RS-232) with DTE pinoutStandard Header Connector (TTL)Suitable for use with most microcontrollers300 to 115200 baudsBoard Dimensions: 32 x 37 mmPre-assembled board

author: jeremy
author_rank: Super Contributor
timestamp: November 20, 2013, 05:57:59 am
content: Interesting, the schematic on that webpack has MAX232 in it. But the stuff about running out of spec still stands; 1.2V is wayyy too low.

author: Electro Fan
author_rank: Super Contributor
timestamp: November 21, 2013, 03:36:07 am
content: Quote from: jeremy on November 20, 2013, 05:57:59 amRight, I get that 1.anything is too low; in the process of trying to figure out what was seemingly causing intermittent results (which I never quite figured out) I was just trying to see where things fell apart.Anyway, thanks for the guidance.New question(s): attached is an image showing something less than ideal at 5 volts - one thought is that it might be a poor ground connection using the particular jumper wires, pins, and alligator clips that I have put together. Or maybe it signifies something else? The 2nd image is the same signal (from HyperTerminal thru the RS232 port thru the TTL converter) at 3 volts. It seems to hold together better (using the exact same probe/GND connections). Or maybe the converter just plain does better at 3 volts than 5 volts? Or maybe the my GND connection is good enough for 3 volts but not solid enough for 5 volts?