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 support@ccsinfo.com

#use rs232 problem

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



Joined: 02 Oct 2004
Posts: 22
Location: cleveland

View user's profile Send private message Send e-mail

#use rs232 problem
PostPosted: Thu Mar 03, 2005 5:04 pm     Reply with quote

#use delay(clock=20000000)
#use rs232(baud=115200,xmit=PIN_C6,rcv=PIN_C7)

hello,
using the lines above i get the "USE parameter value is out of range "0X10" " error. I have used this exactly as written with no problems in the past.

using a pic18f252 at 20 MHz
compiler v=3.169

what am i missing?
as always, any help is greatly appreciated
dyeatman



Joined: 06 Sep 2003
Posts: 1924
Location: Norman, OK

View user's profile Send private message

PostPosted: Thu Mar 03, 2005 5:13 pm     Reply with quote

I compiled it in 3.169, 3.189 and 3.221 with no problems.
Humberto



Joined: 08 Sep 2003
Posts: 1215
Location: Buenos Aires, La Reina del Plata

View user's profile Send private message

PostPosted: Thu Mar 03, 2005 5:34 pm     Reply with quote

Just to have a clue, did you try with:

#use delay(clock=10000000)

or

#use rs232(baud=9600,xmit=PIN_C6,rcv=PIN_C7)


Humberto
webbone



Joined: 20 Sep 2004
Posts: 14
Location: Sacramento, CA

View user's profile Send private message

PostPosted: Thu Mar 03, 2005 8:06 pm     Reply with quote

You will need to use the BRGH10K option in your #USE RS232 directive.

Doing so should allow you to get a baud rate of 113636 which is about 1.4% below your desired rate - this should be tolerable by most serial ports that are running off of accurate clocks (if I recall correctly a +/- 1.5% error is allowable).

If you don't need the speed of 20MHz you could go for a lower clock frequency that makes 115200 on the nose such as 18.432 MHz.

Check the data sheet for your processor, section 16.1, for more details on baud rate calculation.
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