|
|
View previous topic :: View next topic |
Author |
Message |
Elmi Guest
|
Strange baud rate |
Posted: Wed Jun 14, 2006 10:13 pm |
|
|
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
|
|
Posted: Wed Jun 14, 2006 10:36 pm |
|
|
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
|
Re: Strange baud rate |
Posted: Wed Jun 14, 2006 10:37 pm |
|
|
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
|
|
Posted: Fri Jun 16, 2006 1:01 am |
|
|
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. . .. |
|
|
|
|
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
|