View previous topic :: View next topic |
Author |
Message |
eaton
Joined: 02 Oct 2004 Posts: 22 Location: cleveland
|
#use rs232 problem |
Posted: Thu Mar 03, 2005 5:04 pm |
|
|
#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: 1933 Location: Norman, OK
|
|
Posted: Thu Mar 03, 2005 5:13 pm |
|
|
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
|
|
Posted: Thu Mar 03, 2005 5:34 pm |
|
|
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
|
|
Posted: Thu Mar 03, 2005 8:06 pm |
|
|
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. |
|
|
|