RS-485 problem.

Started by thor69uk May 18, 2006
Hi,

I hope someone can help with a little problem I have!

I am trying to get several 18F PICs to communicate over RS-485.

I will outline the basic idea behind the problem so it at least
makes a bit more sense!

I have several chips communicating via I2C to a local 18F PIC which
is then relaying the data to a master controller(18F PIC) which is
then passing the data to a host PC via USB.

My problem is one of bandwith.

The chips communicating over I2C are running at 400kHz which is fine
as the local PIC han handle it. This is then passing the data to
the master controller via '485. There will be several of these
types of boards so I would like to have a much bandwith on the
backbone as possible. I had originally looked at using a CAN
backbone but have had to scrap this as there will be too much data
trying to go down it. What I have found is that you can get RS-485
transceivers that can run upto 50MBps.

I realise that this is way too fast for every PIC I have found
(unless someone can suggest otherwise!) so I was looking at dropping
this down to the region of 10-20Mbps, which 'should' be achievable
with an 18F PIC? (Please correct me if I am wrong)

My problem is how do I get a PIC to communicate at this kind of baud
rate. Every data sheet I have found for the 18F series gives
115kbps as the max baud rate according to the register settings.

Has anyone any experience of this? Have I got it very wrong?

What I had thought is that when dealing with the CAN protocol you
can get buffer chips that allow you to write to the inbuilt buffers
via SPI for example and it then deals with the comms for you.

If there is nothing like this already I am happy to make one but it
makes me wonder how others are doing it? If they make RS-485
tranceivers that run at these speeds what are they using to feed
them with data?

Do I need to seriously upgrade my hardware away from PICs to
something more industrial?

If anyone can help I would be very grateful.

Kind regards,

Andy



to unsubscribe, go to http://www.yahoogroups.com and follow the instructions

> My problem is one of bandwith.
> What I have found is that you can get RS-485
> transceivers that can run upto 50MBps.

I don't think that is easy, did they also state which types of cables
will handle this speed, and at which distances?

> I realise that this is way too fast for every PIC I have found
> (unless someone can suggest otherwise!) so I was looking at dropping
> this down to the region of 10-20Mbps, which 'should' be achievable
> with an 18F PIC? (Please correct me if I am wrong)

10 Mbps is still basic old Ethernet speed, without overhead one byte
every 1us, which is
one byte every 10 instructions (18F at 40 MHz). Can you program a PIC to
handle that? I don't think I can, at least not with any processing.

> My problem is how do I get a PIC to communicate at this kind of baud
> rate. Every data sheet I have found for the 18F series gives
> 115kbps as the max baud rate according to the register settings.
> Has anyone any experience of this? Have I got it very wrong?

I think you are not realistic in the bandwidth you want. Anyway, how do
you get this amount of data into the PC? A UART won't handle it.

> Do I need to seriously upgrade my hardware away from PICs to
> something more industrial?

I think you should first make a realistic estimate of the bandwitdth you
need. For instance, 400kb I2C does not generate 400kbps of data. And
does the data realy change every 10 us?

Next you can find suitable hardware.

Or you can tentatively select hardware (18F PICs, RS485) and estimate
the bandwidth you can achieve.

Wouter van Ooijen

-- -------
Van Ooijen Technische Informatica: www.voti.nl
consultancy, development, PICmicro products
docent Hogeschool van Utrecht: www.voti.nl/hvu




to unsubscribe, go to http://www.yahoogroups.com and follow the instructions

The usart in a pic, with brgh=1, can go up to Fosc/16. With Fosc@MHz,
that'd be 2.5Mbps. Running 8N1, a byte would arrive every 4us. That
doesn't leave you a whole lot of time to do much with the data (40 or less
instructions per received byte).

Good luck!

Harold

> Hi,
>
> I hope someone can help with a little problem I have!
>
> I am trying to get several 18F PICs to communicate over RS-485.
>
> I will outline the basic idea behind the problem so it at least
> makes a bit more sense!
>
> I have several chips communicating via I2C to a local 18F PIC which
> is then relaying the data to a master controller(18F PIC) which is
> then passing the data to a host PC via USB.
>
> My problem is one of bandwith.
>
> The chips communicating over I2C are running at 400kHz which is fine
> as the local PIC han handle it. This is then passing the data to
> the master controller via '485. There will be several of these
> types of boards so I would like to have a much bandwith on the
> backbone as possible. I had originally looked at using a CAN
> backbone but have had to scrap this as there will be too much data
> trying to go down it. What I have found is that you can get RS-485
> transceivers that can run upto 50MBps.
>
> I realise that this is way too fast for every PIC I have found
> (unless someone can suggest otherwise!) so I was looking at dropping
> this down to the region of 10-20Mbps, which 'should' be achievable
> with an 18F PIC? (Please correct me if I am wrong)
>
> My problem is how do I get a PIC to communicate at this kind of baud
> rate. Every data sheet I have found for the 18F series gives
> 115kbps as the max baud rate according to the register settings.
>
> Has anyone any experience of this? Have I got it very wrong?
>
> What I had thought is that when dealing with the CAN protocol you
> can get buffer chips that allow you to write to the inbuilt buffers
> via SPI for example and it then deals with the comms for you.
>
> If there is nothing like this already I am happy to make one but it
> makes me wonder how others are doing it? If they make RS-485
> tranceivers that run at these speeds what are they using to feed
> them with data?
>
> Do I need to seriously upgrade my hardware away from PICs to
> something more industrial?
>
> If anyone can help I would be very grateful.
>
> Kind regards,
>
> Andy
> to unsubscribe, go to http://www.yahoogroups.com and follow the
> instructions
>
--- In p..., "Wouter van Ooijen"
wrote:
>
> > My problem is one of bandwith.
> > What I have found is that you can get RS-485
> > transceivers that can run upto 50MBps.
>
> I don't think that is easy, did they also state which types of
cables
> will handle this speed, and at which distances?
Transmitted a continuos 1010... at 40Mhz using an RS485 driver, on
a standard twisted cable + ground works without problems at 100m (I
suppose it's ok even at 500m or more, seing the signal shape).

BTW, an 1Vpp 70MHz video signal may be transmitted on the same
twisted cable over 250m using analogic differential drivers/receivers
(maxim)with very good SNR.

greetings,
Vasile

>
> > I realise that this is way too fast for every PIC I have found
> > (unless someone can suggest otherwise!) so I was looking at
dropping
> > this down to the region of 10-20Mbps, which 'should' be
achievable
> > with an 18F PIC? (Please correct me if I am wrong)
>
> 10 Mbps is still basic old Ethernet speed, without overhead one byte
> every 1us, which is
> one byte every 10 instructions (18F at 40 MHz). Can you program a
PIC to
> handle that? I don't think I can, at least not with any processing.
>
> > My problem is how do I get a PIC to communicate at this kind of
baud
> > rate. Every data sheet I have found for the 18F series gives
> > 115kbps as the max baud rate according to the register settings.
> > Has anyone any experience of this? Have I got it very wrong?
>
> I think you are not realistic in the bandwidth you want. Anyway,
how do
> you get this amount of data into the PC? A UART won't handle it.
>
> > Do I need to seriously upgrade my hardware away from PICs to
> > something more industrial?
>
> I think you should first make a realistic estimate of the
bandwitdth you
> need. For instance, 400kb I2C does not generate 400kbps of data. And
> does the data realy change every 10 us?
>
> Next you can find suitable hardware.
>
> Or you can tentatively select hardware (18F PICs, RS485) and
estimate
> the bandwidth you can achieve.
>
> Wouter van Ooijen
>
> -- -------
> Van Ooijen Technische Informatica: www.voti.nl
> consultancy, development, PICmicro products
> docent Hogeschool van Utrecht: www.voti.nl/hvu
>

----- Original Message -----
From: "Vasile Surducan"
To:
Sent: Saturday, May 20, 2006 7:53 AM
Subject: [piclist] Re: RS-485 problem.
> --- In p..., "Wouter van Ooijen"
> wrote:
>>
>> > My problem is one of bandwith.
>> > What I have found is that you can get RS-485
>> > transceivers that can run upto 50MBps.
>>
>> I don't think that is easy, did they also state which types of
> cables
>> will handle this speed, and at which distances?
> Transmitted a continuos 1010... at 40Mhz using an RS485 driver, on
> a standard twisted cable + ground works without problems at 100m (I
> suppose it's ok even at 500m or more, seing the signal shape).
>
> BTW, an 1Vpp 70MHz video signal may be transmitted on the same
> twisted cable over 250m using analogic differential drivers/receivers
> (maxim)with very good SNR.

You don't need a ground with twisted pair, unless the wires are shielded;
the shield would need to be grounded, of course.

Leon

---
[This E-mail has been scanned for viruses but it is your responsibility
to maintain up to date anti virus software on the device that you are
currently using to read this email. ]

> You don't need a ground with twisted pair

I very much think you do. Without a ground the common mode voltage can
easily exceed the range the receiver chip can handle. Or have you found
chips with a few 100 volts of common mode?

Wouter van Ooijen

-- -------
Van Ooijen Technische Informatica: www.voti.nl
consultancy, development, PICmicro products
docent Hogeschool van Utrecht: www.voti.nl/hvu

----- Original Message -----
From: "Wouter van Ooijen"
To:
Sent: Saturday, May 20, 2006 9:51 AM
Subject: RE: [piclist] Re: RS-485 problem.
>> You don't need a ground with twisted pair
>
> I very much think you do. Without a ground the common mode voltage can
> easily exceed the range the receiver chip can handle. Or have you found
> chips with a few 100 volts of common mode?

Of course, you are correct.

Leon
---
[This E-mail has been scanned for viruses but it is your responsibility
to maintain up to date anti virus software on the device that you are
currently using to read this email. ]



to unsubscribe, go to http://www.yahoogroups.com and follow the instructions