View previous topic :: View next topic |
Author |
Message |
stoyanoff
Joined: 20 Jul 2011 Posts: 375
|
Problem with RS232 |
Posted: Mon Jul 22, 2013 12:26 pm |
|
|
Greetings! I'm using MPlab v8.91, CCS v4.134. I have a pcb with 3 16F628 and 1 16F88(master). The TX pin of 16F88 is connected to all RX(16F628). RX of 16F88 is connected to all TX pins. The problem is on RX master line. I don't have a stable voltage level there. I tried to add pull-up or down resistor - no effect. I think I must set the TX pins of 16F628 to float.
Can you give me an advice how to deal with this problem?
Thanks! |
|
|
g-netix
Joined: 19 Aug 2012 Posts: 19
|
|
Posted: Mon Jul 22, 2013 12:36 pm |
|
|
I think the problem is that you have 3 TX tied together, and if one of these try to send data, there is always a constant level that is in conflict with the data. You should try to put some resistors on each TX line or perhaps float high, but I don't know if it works with hardware UART.
Hope I helped you ;) |
|
|
stoyanoff
Joined: 20 Jul 2011 Posts: 375
|
|
Posted: Mon Jul 22, 2013 12:44 pm |
|
|
I was thinking to set the inactive TXs to float_high, too! But I`m not sure if I use for example output_float(), I will be able to restore the UART settings with putc() command...
Last edited by stoyanoff on Mon Jul 22, 2013 12:44 pm; edited 1 time in total |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9221 Location: Greensville,Ontario
|
|
Posted: Mon Jul 22, 2013 12:44 pm |
|
|
You might want to look at the CCS example on how to connect multiple PICs into a small network.Not only do the show you the hardware in the FAQ section of the help files, they have software in the examples as well..
Most people now use the RS-485 'defacto standard' for small networks, though you can use slightly modified RS-232 hardware.
I've used a novel VVSI system for decades while not fast it has been ultra reliable.
So there are several choices.
hth
jay |
|
|
asmboy
Joined: 20 Nov 2007 Posts: 2128 Location: albany ny
|
|
Posted: Mon Jul 22, 2013 5:38 pm |
|
|
To connect ONE TX pin to multiple RX pins - feed EACH RX through a 220 ohm resistor.
To combine MULTIPLE TX feeds : use CMOS "AND" gates to combine to a single line, and make sure in code that all PICS don't all talk at once.
A simple STAR net can be created with just AND gates and resistors
so long as baud rate and distance are not excessive. |
|
|
|