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

baud rate soft RS232

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



Joined: 03 Dec 2005
Posts: 182
Location: Australia SA

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

baud rate soft RS232
PostPosted: Sat Apr 22, 2006 6:33 am     Reply with quote

I would like to drive on a 18f1320 with a 8mhz internal osc, a soft rs232 at 115200 baud rate on B7 and B6. the Max I can get to work is 38400.

PIC18F1320 when set for SYNC = 0, BRGH = 1, BRG16 = 1 or SYNC = 1, BRG16 = 1, the chart tells me I can on B1 and B4 (hardware TX/RX)

As I had my RS485 LAN on B1/B4 I was able to test Via RS485 however even thoe I could see the correct data, I was getting errors (posible due to RS485 chip timing??)

Do I need to go to a Xtal or is there a work around on the soft comms to run at 16 bit insteat of 8.

the 115200 baud is required for the Bluetooth interface. Wink


Andrew Confused
_________________
What has been learnt if you make the same mistake? Wink
Storic



Joined: 03 Dec 2005
Posts: 182
Location: Australia SA

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

PostPosted: Sun Apr 23, 2006 2:09 am     Reply with quote

from the pdf on the 18F1320 with enhance comms, it appears that soft comms follows the 8 bit calc and not the enhance Shocked
standard calc
8-bit/Asynchronous FOSC/[64 (n + 1)]

enhace calc
16-bit/Asynchronous FOSC/[4 (n + 1)]

On the standard calc, FOSC=8000000 SPBRG is 2 for 38400 with an error of 8.51%, This works OK to go above this I get an error.

If I can apply the enhance calc to soft comms @ FOSC=8000000 SPBRG is 16 for 115200 I would have an error of 2.12%, this setting seems to works on the hardware Comms. (TX/RX)

has anyone tried to program soft comms above the calc baud (SPBRG ), or would anyone know how I could do this. Confused

any Coding suggestion would be appreciated. It looks like hardware changes may be the simple fix, I did not want to do this at this time.

Andrew Confused
_________________
What has been learnt if you make the same mistake? Wink
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

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

PostPosted: Sun Apr 23, 2006 8:23 am     Reply with quote

Software uart is limited by processor speed.
Storic



Joined: 03 Dec 2005
Posts: 182
Location: Australia SA

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

PostPosted: Sun Apr 23, 2006 4:47 pm     Reply with quote

Thanks, I was thinking the same, however I hope there was a software fix, (revise design comming up) Wink

Andrew
_________________
What has been learnt if you make the same mistake? Wink
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