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

soft rs232 doesn't work at 115200 as hard works

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







soft rs232 doesn't work at 115200 as hard works
PostPosted: Fri Oct 05, 2007 1:40 pm     Reply with quote

I wanted to connect Bluetooth module to my 18f252 using b4-b5 via 115200 br rs232 but couldn't do that. I got some garbage on my Hyper Terminal. When I switched to the c6-c7 I got right output on the screen.
Any ideas?
P.S. at 57600 everything was correct in both scenarios
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Oct 05, 2007 1:45 pm     Reply with quote

1. What is the PIC's oscillator frequency ?

2. What is your compiler version ?
vminin
Guest







PostPosted: Fri Oct 05, 2007 2:16 pm     Reply with quote

30000000
4.057
vminin
Guest







PostPosted: Fri Oct 05, 2007 2:20 pm     Reply with quote

more input:) I have no flow control in both cases.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Oct 05, 2007 2:29 pm     Reply with quote

What happens if you don't use the Bluetooth module ? Just connect
the PIC to your PC, and type text in a terminal window. Does it work
at 115200 baud with a software UART ?
vminin
Guest







PostPosted: Fri Oct 05, 2007 2:53 pm     Reply with quote

good point!

Yes, it works . And BTM works as well with HT at 115200
Ttelmah
Guest







PostPosted: Fri Oct 05, 2007 2:58 pm     Reply with quote

If I remember, we did some 'loop counting' a while ago, in another thread, and worked out how many instruction cycles were needed for soft RS232. The figure was somewhere round 45 instructions 'worst case' in the bit loop. At 30Mhz, you shold be able to handle this (65 instruction times available). It may be that the newer compiler is actually 'worse' at handling this than the older versions....
The only way to really find out if you are running out of loop time, would be to compile some test code, with higher and higher baud rtes, and look at the listing, to find the point where the shortest delay reaches zero.

Best Wishes
vminin
Guest







PostPosted: Fri Oct 05, 2007 3:04 pm     Reply with quote

to Ttelmah: If it couldn't handle cycles, would it work with the Hyper Terminal?
vminin
Guest







PostPosted: Fri Oct 05, 2007 3:43 pm     Reply with quote

to Tlelmah - it looks like you are right. If I add couple instruction in the loop it stops working. I will replace clock with 40Mhz and try v.3.xx compiler.

Any way, thanks guys for your help, I'll post result if any Smile
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