View previous topic :: View next topic |
Author |
Message |
rikotech8
Joined: 10 Dec 2011 Posts: 376 Location: Sofiq,Bulgariq
|
MAX232 |
Posted: Thu Jul 26, 2012 6:14 am |
|
|
Is that compulsory to use MAX232 between my controller and the PC in my UART communication project. Will the communication work properly without this chip(MAX232)? |
|
|
RF_Developer
Joined: 07 Feb 2011 Posts: 839
|
|
Posted: Thu Jul 26, 2012 6:36 am |
|
|
No, you can use many of the many, many RS232 - TTL/CMOS level convertor ICs, but you have to use *an* IC of this sort, which one you use is up to you and your hardware.
RF Developer |
|
|
Gabriel
Joined: 03 Aug 2009 Posts: 1067 Location: Panama
|
|
Posted: Thu Jul 26, 2012 6:58 am |
|
|
in other words, YES.
you need a RS232 level converter between PC and PIC.
PIC --->Level Converter-----> PC
if you dont want to use a level converter, i suggest you read this first:
http://en.wikipedia.org/wiki/Magic_smoke
G _________________ CCS PCM 5.078 & CCS PCH 5.093 |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9226 Location: Greensville,Ontario
|
|
Posted: Thu Jul 26, 2012 7:00 am |
|
|
or....
you can use a collection of transistors and resistors
but..
it is much easier and more reliable to use a 'max232' type product.
I've 'cheated' using a MAX488 for years.No caps required,good for 1 serial port,8 pin package. The MAX232 will convert 2 serial ports but needs 4 caps and takes up more board space.
hth
jay |
|
|
rikotech8
Joined: 10 Dec 2011 Posts: 376 Location: Sofiq,Bulgariq
|
using USB -> rs232 adapter |
Posted: Thu Jul 26, 2012 9:09 am |
|
|
Do I need it if I even use rs232 -> usb adapter? |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9226 Location: Greensville,Ontario
|
|
Posted: Thu Jul 26, 2012 9:55 am |
|
|
Yes, an RS232<-> USB convertor converts RS232 level signals to USB and vice versa.
The PIC can be thought of as a 'TTL' device NOT an 'RS232' device.
You can buy TTL<->USB convertors. Very common now, about $4 each.
They can as either 5 volt or 3 volt modules, so you must buy the correct one for your application or project. |
|
|
gpsmikey
Joined: 16 Nov 2010 Posts: 588 Location: Kirkland, WA
|
|
Posted: Thu Jul 26, 2012 6:06 pm |
|
|
I have seen *some* pc's that use 0 and 5v instead of true RS-232 levels on the serial port (saving having a negative supply etc), however unless you are VERY sure yours does it that way (check with a scope) and you are never going to hook it to another real RS-232 port, see the reference above to the "magic smoke". The best and safest plan is to use either a level shifter IC or discrete components, although with discretes, you will need to come up with the negative supply if you want to actually create true RS-232. Don't forget that a RS-232 IC typically also inverts the signal which may or may not be an issue for you (but it can cause confusion if you are not aware of it).
mikey _________________ mikey
-- you can't have too many gadgets or too much disk space !
old engineering saying: 1+1 = 3 for sufficiently large values of 1 or small values of 3 |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9226 Location: Greensville,Ontario
|
|
Posted: Thu Jul 26, 2012 7:20 pm |
|
|
Yup...so much for 'industry standards' and 'legacy' devices! It's getting hard to conform to known standards when 'they' bend the rules to shave a few pennies off the cost to build a product.Or, who decided to flip pins 2 and 3 on the serial I/O of PCs?
Weird thing is I just orderd a bunch of those ttl<->usb modules for $3 each! Cheaper than the PIC I'm using..crazy !! |
|
|
gpsmikey
Joined: 16 Nov 2010 Posts: 588 Location: Kirkland, WA
|
|
Posted: Thu Jul 26, 2012 10:03 pm |
|
|
The nice thing about standards is there are so many to choose from
mikey _________________ mikey
-- you can't have too many gadgets or too much disk space !
old engineering saying: 1+1 = 3 for sufficiently large values of 1 or small values of 3 |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19513
|
|
Posted: Fri Jul 27, 2012 3:11 am |
|
|
Quite a few laptops, use +/-5v instead of the higher voltages normally used by RS232 (the interface _requires_ +/-3v into the load at the end of the cable, so with short cables, you can always get away with this). They are actually using RS423 transceiver devices. Most of the devices that use +5/0, actually _require_ the device at the other end to be generating the -ve rail, and then 'steal' their negative supply from this, so will give working voltages if attached to a normal RS232 transceiver at the other end, but not if tested without such a device attached. They use chips like the Dallas DS275. RS232, only actually _requires_ +/-5v at the output, but when designed, given the transistor voltage drops achievable, this implied that the supply rails would have to be perhaps +/-7v.
The standard MAX232, inherently supports interfaces that don't go below 0v, having a low threshold at just 0.8v (worst case). This was done, so that open circuit (break), was always detectable, rather than being 'undefined', in the transition region from '1' to '0', but also implies that negative drives are not needed to make it work (though are to meet the actual signalling standard....).
Unfortunately, a large part of the problem comes from people like CCS, who call the setup routine for the UART '#USE RS232', when it actually has nothing to do with RS232!. #USE ASYNC_SERIAL would be a 'better', term. It is plain to people who look at the example code, where they use the same setup, to talk to RS485, that this interface is not RS232.
Exactly the same happens with the machines that use +/-5v signalling, or +5/something signalling, where the original designers probably said something like "this will give a serial port useable for 90% of standard jobs", while the marketing people then decided to call the port 'RS232', when it does not meet the voltage signalling requirements of this interface....
The most reliable way to connect to a reasonably close device at low data rates, is still RS232, using a proper transceiver. For higher data rates, longer ranges and multiple drops RS485.
Best Wishes |
|
|
bkamen
Joined: 07 Jan 2004 Posts: 1615 Location: Central Illinois, USA
|
|
Posted: Sat Jul 28, 2012 1:52 am |
|
|
Ttelmah wrote: | Quite a few laptops, use +/-5v instead of the higher voltages normally used by RS232 |
And that's ok...
IIRC, there were revisions to the RS232 standard that went from +/-15 to +/-7 and I think +/-5 was RS232C or D (I forget which)
So that's ok -- they can still tolerate the higher voltages.. but it's a good thing to know when developing hardware. _________________ Dazed and confused? I don't think so. Just "plain lost" will do. :D |
|
|
mr_Orange
Joined: 14 Apr 2012 Posts: 12
|
|
Posted: Sun Jul 29, 2012 4:40 am |
|
|
RS Components sells ttl to usb converters with a ftdi chip in the usb connector. Available with wire ends or with a plug so you only need a header on your pcb. But they do cost about €15,-. |
|
|
jgschmidt
Joined: 03 Dec 2008 Posts: 184 Location: Gresham, OR USA
|
|
Posted: Sun Jul 29, 2012 10:07 pm |
|
|
For reading debugging output (generated by printf's) from my projects I usually use the software UART with the INVERT option. I have fed this into both legacy serial ports and serial to USB converters on my PCs. I've been doing this forever with all chips and many versions of the CCS compiler, and it's real easy. My first steps in any new project are always to blink the heartbeat LED and print out a debug message to verify my setup is working and that the clock is set correctly.
If the project calls for a serial interface I always put in one of the converter chips as discussed in the preceding replies.
Cheers, _________________ Jürgen
www.jgscraft.com |
|
|
|