CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

MAX232

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
rikotech8



Joined: 10 Dec 2011
Posts: 376
Location: Sofiq,Bulgariq

View user's profile Send private message

MAX232
PostPosted: Thu Jul 26, 2012 6:14 am     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Jul 26, 2012 6:36 am     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Jul 26, 2012 6:58 am     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Jul 26, 2012 7:00 am     Reply with quote

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

View user's profile Send private message

using USB -> rs232 adapter
PostPosted: Thu Jul 26, 2012 9:09 am     Reply with quote

Do I need it if I even use rs232 -> usb adapter?
temtronic



Joined: 01 Jul 2010
Posts: 9226
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Thu Jul 26, 2012 9:55 am     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Jul 26, 2012 6:06 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Jul 26, 2012 7:20 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Jul 26, 2012 10:03 pm     Reply with quote

The nice thing about standards is there are so many to choose from Laughing

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

View user's profile Send private message

PostPosted: Fri Jul 27, 2012 3:11 am     Reply with quote

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

View user's profile Send private message

PostPosted: Sat Jul 28, 2012 1:52 am     Reply with quote

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

View user's profile Send private message

PostPosted: Sun Jul 29, 2012 4:40 am     Reply with quote

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

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Sun Jul 29, 2012 10:07 pm     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group