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

fastest reasonable UART baud rate between two PICs

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



Joined: 01 Mar 2010
Posts: 73

View user's profile Send private message

fastest reasonable UART baud rate between two PICs
PostPosted: Mon Jan 14, 2019 10:45 am     Reply with quote

Hello,

I'm using two PIC16F1527s to communicate with each other via the hardware UART.

I'm curious if you guys have any advice for fastest reasonable speed. I'm running the processors at 20MHz. I see in the datasheet the fastest UART speed it has data for is 115200 for 20MHz but my instinct is that I could go quite a bit faster comfortably. Or maybe it's capped at 115200?

Any insight?
temtronic



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

View user's profile Send private message

PostPosted: Mon Jan 14, 2019 11:07 am     Reply with quote

Well it's not capped at 115k200. That's a magical number for communicating with PCs.
I have had a PIC18F46K22 talk to a Vinculum module at 1Mbaud all day long and I recall getting 4M as well, though it's been years.
using table 22-3..from youtr PIC datasheet

FOSC/[4 (n+1)]

if FOSC=64,000,000 and n=0 then max baud would be 16Mbaud.

Keep in mind it's the RS-232 tranceivers and wiring that will have a HUGE impact on maximum speed. With serial communications you can go fast and short OR slow and long. I can get 15 miles at 22 baud.

Jay
Ttelmah



Joined: 11 Mar 2010
Posts: 19535

View user's profile Send private message

PostPosted: Mon Jan 14, 2019 11:33 am     Reply with quote

The old 'historical' baud rates are all simple multiples from 300bps.
This came from an early Bell modem. Later rates then went up as
integer multiples from this.
The PC when it launched used a crystal for the UART designed to give these
rates, and the fastest clock available on the original chip was 115200.
So the fastest rate on this became quite commonly the highest rate
used.
Later PC UART's then gave higher rates.

On the PIC, it is commonly quite a good idea to use rates that are nicer
divisions from perhaps a 20MHz clock. So rates like 250000, and 500000
are quite commonly used especially on RS485 links.

At higher rates, common links support shorter usable lengths. So RS485
(for example) is specified to work to 4000 feet at up to 76800bps, but only just under 300 feet at 1Mbps. So you need to look carefully at whatever
signalling standard you use if you want to use really high rates.
picj1984



Joined: 01 Mar 2010
Posts: 73

View user's profile Send private message

PostPosted: Mon Jan 14, 2019 1:25 pm     Reply with quote

this info is so helpful, thank you!

In my application I'm in the same enclosure, the PICs are on different PCBs connected via IDC cable. So I think I'll give a baud rate of 1M a go.
Ttelmah



Joined: 11 Mar 2010
Posts: 19535

View user's profile Send private message

PostPosted: Mon Jan 14, 2019 2:57 pm     Reply with quote

You may well find it worth terminating the lines. Sending 1Mb/sec on
a basic unterminated logic line will lead to lots of problems with ringing.

At the receive end of each line have two resistors. One to 5v and one to 0v.
Perhaps 180R to GND, and 270R to 5v. Gives about 100R characteristic impedance and biases to 2v.
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