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

Strange baud rate

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







Strange baud rate
PostPosted: Wed Jun 14, 2006 10:13 pm     Reply with quote

Hi,
When I use baud=115200, I got weird character? When I use baud=57600, seems all ok. Are they anybody know why? I tried many thing before I come to here.

It worked fine when I change to xmit and rcv to pin_c6 and pin_c7 respectively, but not with pin_c0 and pin_b0 respectively with 115200 baud rate.

Are they any rule to implement RS232 w/out h/ware uart?

Code:

#include <18F4520.h>

#fuses HS, NOWDT, PUT, NOPROTECT, NOLVP
#use delay(clock=20000000)
#use RS232(BAUD=115200, XMIT=PIN_C0, RCV=PIN_B0, FORCE_SW, PARITY=N, ERRORS)

void main () {
while (1) {
printf("TEST");
delay_ms(1000);
}
}
Elmi
Guest







PostPosted: Wed Jun 14, 2006 10:36 pm     Reply with quote

Just want to add something. Compiler ver3.222.
I just bought this c compiler and already have go through all the solution described in the reference manual. Dayz spent looking someone else message in this forum but still have no clue.

So if anyone could explain me why I got this problem? I would be so thankfull.

Thanking in advance.
asmallri



Joined: 12 Aug 2004
Posts: 1634
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

Re: Strange baud rate
PostPosted: Wed Jun 14, 2006 10:37 pm     Reply with quote

Elmi wrote:
Hi,
It worked fine when I change to xmit and rcv to pin_c6 and pin_c7 respectively


Did you have the forced software selected when you had pin_c6 and pinc_7 selected?

The ERRORS flag is only valid for the hardware UART - in other words FORCED_SW and ERRORS are mutually exclusive.

115Kbps and a software UART implementation is challenging as there is only 43 instruction cycles between bits.
_________________
Regards, Andrew

http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!!
Elmi
Guest







PostPosted: Fri Jun 16, 2006 1:01 am     Reply with quote

Thnks Andrew,
Just figured out how to solve the prob, use PLL and get 40mhz speed and it run smooth. . . . of course i have to change to 10mhz osc.

Thnks anyway. . ..
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