gnupic@linuxhacker.org

gnupic@linuxhacker.org


Subject: Re: PIC16F877
From: Tom Jennings
Date: 21 Aug 2003 22:40:45 -0700

On Wed, 2003-08-20 at 12:37, Zero Code wrote:
> I used the same system to display ASCII bytes received, but my own seems not to work,
even at 2400bps....
> Did you solve the problem in the meantime?

I'm using the UART in the 16f628a at 115,200 baud without problems. The
trick is to use a crystal that's a multiple of 300... 18.432 MHz is what
I use. I also couldn't get decent 9600 bits/sec with a 20 MHz xtal...



> 
> From: Rick Mann 
> Date: Sat, 28 Dec 2002 13:14:14 -0800 
> 
> --------------------------------------------------------------------------------
> 
> Hi. I'm trying to get a PIC16F877 to work at 9600 baud. It works fine at
> 2400, with BRGH=0, but I can't seem to get reliable operation at 9600 with
> BRGH=1.
> 
> I thought I read somewhere that one shouldn't even try to use BRGH=1, but
> all of the examples I've seen on the Microchip website and Piclist.com seem
> to do it.
> 
> FWIW, it seemed to work better when the SPRG value was set to 26 instead of
> 25, the value everything says I should use.
> 
> I have a MAX232 from TI between the PIC and the PC. The handshaking lines
> are all hard-wired.
> 
> I try to send ascii '0' through '9' from my terminal program, and display
> those values on 8 LEDs. At 2400 baud, it works great. At 9600, I get
> incorrect (although consistently) values.
> 
> Any ideas? Thanks!
> 
> -- 
> Rick
> 
> 



gnupic@linuxhacker.org