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

serial RS232 communication between PIC16 and PXA255 �C + br

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



Joined: 10 May 2005
Posts: 323
Location: Belgium

View user's profile Send private message

serial RS232 communication between PIC16 and PXA255 �C + br
PostPosted: Fri May 19, 2006 7:54 am     Reply with quote

Hi,

our device has mainly 2 processors. A PIC16 and PXA255 (larger with usb etc). They communicate via there SUART. Now this is a 2 line communication. There pins are connected via 2 pcb tracks 0.35mm thick and about 20cm long; max 40cm.

Now the question is; what can I set for maximum baudrate between the two? The faster, the more performant the system will be; but what is the limit?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri May 19, 2006 12:09 pm     Reply with quote

Electrically, there is no problem. You could run at several MHz without
problems. The limitations will be in your USART modules. Read the
specifications on your USARTs, to see what their maximum speed is.
Christophe



Joined: 10 May 2005
Posts: 323
Location: Belgium

View user's profile Send private message

PostPosted: Mon May 22, 2006 1:29 am     Reply with quote

Hi,

thanks for the input.

Page 114 of the PIC16F877A datasheet: seems that you can set baud rates up to 57600 bits/s.

though when I do:

Code:
#use rs232(baud=57600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8, ERRORS)


I get the compiler error: baud rate out of range.

Seems that 19200 is the maximum allowable by software, is that correct?
Ttelmah
Guest







PostPosted: Mon May 22, 2006 3:10 am     Reply with quote

No.
The 'answer' is dependant on what crystal you use.
The baud rate generated must be within a small margin of the required rate. The compiler checks that the rate you are asking for, is within a reasonable margin. The errors are (for a 10Mhz crystal):
Code:

10MHz

9600   1.73%   OK
19200 1.72%   OK
57600 9.58%   N/G


Higher crystal frequencies, will allow higher rates to be selected OK, but also _lower_ fequencies, which are an exact binary multiple ofthe required frequency will allow this. So (for example), a crystal of 3.6864Mhz, will allow 57600bps to be selected with no error.
If you select a baud rate that is a binary sub division of your clock (assuming a 10MHz clock), 250000bps for example, this can be selected and the compiler will not complain.
The problem is that the higher 'standard' rates, require either a crystal chosen to generate them, or a lot larger division ratio (faster oscillator), to be developed accurately.

Best Wishes
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