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

RS232

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



Joined: 24 Jul 2012
Posts: 163

View user's profile Send private message

RS232
PostPosted: Fri Nov 08, 2019 3:26 pm     Reply with quote

Well not a CCS question at all. Truth is this is the best forum for information and a guiding hand I have ever run across so I post my request, ADMINS kill it off if you want I will understand as I said not a CCS question.

Needing to optically isolate RS232. Easily done, done it before, problem this go around is I need to do the isolation on the RS232 voltage side. I.e. after the MAX232 chip. Looking for a point to where to get some ideas on doing the isolation on the RS232 voltage side not the TTL side. The RS232 link is two MAX232 chips tied together each converting back to TTL levels like they do so well. Needing the isolation between the two MAX232s and no room for a commonly acquired isolator product needing to do it on the chip level myself for space requirements.


Thanks for any guidance on this topic.
temtronic



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

View user's profile Send private message

PostPosted: Fri Nov 08, 2019 3:42 pm     Reply with quote

Can be easily done with optocouplers, BTDT, on the 'RS232' side of the MAX232s.
Most products have space 'above' the main PCB, and al you need is the equal to a 14pin DIP in volume. If you don't have that, then, walk away from the product or ask the 'person in charge HOW he will do it !
beaker404



Joined: 24 Jul 2012
Posts: 163

View user's profile Send private message

PostPosted: Fri Nov 08, 2019 3:50 pm     Reply with quote

My question is voltage levels I guess, when isolating on the TTL side, levels are 0V and VCC. Doing it on the RS232 side of the MAX232 chip, requires a negative voltage? Or can you get away with a pull up to +12V and the low would be the appropriate ground? Thus eliminating the need for a negative voltage and simplifying the circuit greatly.
Ttelmah



Joined: 11 Mar 2010
Posts: 19546

View user's profile Send private message

PostPosted: Fri Nov 08, 2019 11:32 pm     Reply with quote

I have to ask 'why'?.
As you have realised isolation after the MAX232 is harder. Why not
isolate before?. Miles easier. Power the MAX232 off an isolated 5v
inverter, isolate the TTL signals feeding it, and you have isolated
RS232.
To isolate after, you will ideally need a -ve supply on the side
generating the bus, but the actual isolation is fairly simple, just
use a current limited driver to the LED (to cope with the wide range
of voltages that the RS232 signal may have), and then have the output
transistor switch the signals between your generated supplies.

Realistically though, you are making this more complex than it needs to
be....

However if you must opto isolate an existing signal, then just use
an off the shelf solution:

<http://www.nordfield.com/serial-rs232-optical-isolator>
temtronic



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

View user's profile Send private message

PostPosted: Sat Nov 09, 2019 5:55 am     Reply with quote

Yeesh, I can't buy the parts for $30 ! Let alone the 2 hrs design time, 2-3 hours to build, 1 hr test, oopsy, 2 hrs rework, 2 hrs real world test......easily waste a day, probably 2, no it'd be 3..reality...sigh, when a SIMPLE, 'it-work-out-of-the-box' SOLUTION can be had.
I quckly scanned the specs and speed 'might' be an issue. Optos have a limit, in this case 57600 which is a lot faster than the 300 I was working on decades ago.
Ttelmah



Joined: 11 Mar 2010
Posts: 19546

View user's profile Send private message

PostPosted: Sat Nov 09, 2019 10:49 am     Reply with quote

As some further comments, Rotronic in Germany do a similar unit that is
about half the price, but I don't know about worldwide supply of this, Mouser
list one supporting up to 200K+ bps, but a lot more expensive (though it
does support RTS/CTS as well):

<https://www.mouser.co.uk/ProductDetail/B+B-SmartWorx/9POP4?qs=sm11Wk%252BzBxsvWXAWL1a1%2FQ==&vip=1&gclid=CjwKCAiA5JnuBRA-EiwA-0ggPVibxJcxbwCJb0INVnp7MRIMl_BY36LtrSANJJEaeG1svZic6bf8XhoCsoIQAvD_BwE>

<https://www.reichelt.com/gb/en/rs232-optocoupler-galvanic-isolation-value-12991015-p149091.html?PROVID=2788&gclid=CjwKCAiA5JnuBRA-EiwA-0ggPUhaERF19nJ4pjPuSYmLnQfmSwQw3dRaQZ_B--CwoVrMmAceGSquIRoCNfsQAvD_BwE&&r=1>

In the UK, Amazon list about ten models, and the cheapest is under £6...

<https://smile.amazon.co.uk/s?k=rs232+isolator&_encoding=UTF8&adgrpid=52622361269&gclid=CjwKCAiA5JnuBRA-EiwA-0ggPW7jGG9aRGEfeC0P3_M4cnLeDGdn6ISdXAPkuMuz_x9RinNqpduP5RoCBlcQAvD_BwE&hvadid=259042662180&hvdev=c&hvlocphy=1006764&hvnetw=g&hvpos=1o3&hvqmt=e&hvrand=13094394360574069853&hvtargid=kwd-296868245441&hydadcr=4395_1795144&tag=googhydr-21&ref=pd_sl_vww01k7hj_e>

Key thing is to search for RS232 opto-isolators, not opto-couplers.

The high speed one uses external power.
PrinceNai



Joined: 31 Oct 2016
Posts: 480
Location: Montenegro

View user's profile Send private message

PostPosted: Sat Nov 09, 2019 8:04 pm     Reply with quote

If I understood your question correctly (the space constriction part), you are communicating with something on the same PCB, but with two totally separated power supplies. If that is the case, why do you need MAX232 at all? Do it on TTL level, two optocouplers and a few resistors should be enough to couple the signals optically.
PrinceNai



Joined: 31 Oct 2016
Posts: 480
Location: Montenegro

View user's profile Send private message

PostPosted: Sat Nov 09, 2019 8:34 pm     Reply with quote

It would help a lot if you'd explain exactly what you are trying to connect. Speed, distances. Do those things have to be connected with copper wire or can you use optical cables.
temtronic



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

View user's profile Send private message

PostPosted: Sun Nov 10, 2019 5:22 am     Reply with quote

As others have said ,we need more information about the project. Some need to know items...

1) what is the speed(baudrate) of the other 'device' ?
1a) what 'payload' ( amount of data, # of bytes).

2) what distance is it from the PIC ? inches or miles

3) What cabing is being used ?

4) what space ? Remembr think 3D !

5) What power is availabe ?

One easy method is use use a wireless link ! RF MODEMSs are isolated, cheap and simple to use. Have to watch power but some can go 115k200.
Ttelmah



Joined: 11 Mar 2010
Posts: 19546

View user's profile Send private message

PostPosted: Sun Nov 10, 2019 8:04 am     Reply with quote

and particularly what is actually attached both sides.

The problem is that 'RS232', has so many different meanings.

Genuine RS232 implies -ve supplies. Yet 90% of USB 'RS232' interfaces
get away without these. The interface chips used in PC's are actually
slightly 'lenient', and accept 0v as if it is a -ve signal. Now a lot
of devices will also accept this, but not all.
This is why the question raised at the start of whether -ve rails are 'needed',
is so open to question. The first isolator I linked too, makes the point
that it has a 7660 (which implies it is generating -ve rails). However, given
it is bus powered, it is unlikely to genuinely meet the current drive
requirements of 'RS232'.
If you have power available, one of the little 5v to +/-12v inverter
modules and a couple of quite basic transistor output optos can generate
signals that for 90% or uses will be fine (with the slew limitations
already noted). However for higher slew rates, things get harder. Also, by
the time you have paid for two optos and the inverter, you are over the
price of these modules....
temtronic



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

View user's profile Send private message

PostPosted: Sun Nov 10, 2019 8:15 am     Reply with quote

To add to Mr. T's comment....
time is a factor !
Often overlooked and not considered is YOUR time wasted trying to design /build/test/rework a solution when hardware exists 'off-the-shelf'.
We're only given xxxx hrs on this World, and the older you get the more you realize it. Heck I've spent 1/2 my life 'playin with PICs'. Yeesh 33 years and I'm still learning....

The more details of your project, the better we can help.
Jay
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