gnupic: PIC16F877 & USART


Previous by date: 4 Jan 2003 19:56:05 -0000 Re: PIC16F877 & USART, Jeff Jackowski
Next by date: 4 Jan 2003 19:56:05 -0000 Re: PIC16F877 & USART, Declan Moriarty
Previous in thread: 4 Jan 2003 19:56:05 -0000 Re: PIC16F877 & USART, Jeff Jackowski
Next in thread: 4 Jan 2003 19:56:05 -0000 Re: PIC16F877 & USART, Declan Moriarty

Subject: Re: [PIC]: PIC16F877 & USART
From: Jeff Jackowski ####@####.####
Date: 4 Jan 2003 19:56:05 -0000
Message-Id: <Pine.OSF.4.44.0301041342310.358804-100000@fly.hiwaay.net>

On Wed, 1 Jan 2003, Rick Mann wrote:

>on 12/31/02 1:27 PM, Andreas Junge - DSLX at ####@####.#### wrote:
>
>> What is your clock rate for the pic? There are multiple tables for different
>> clock rates in the documentation.
>
>Oh, I forgot to mention that, sorry. 4.000 MHz.
>
>So, here's the thing. I appreciate everyone giving me info about how to set
>up the values, but the problem I'm facing is that I *did* set up the values
>correctly, using both formulas (the one from Microchip and the one that
>accounts for rounding errors).
>
>The formulas work for 2400 baud, but don't seem to work for 9600 baud.

Bother, I pressed the wrong button. Sorry for the extra post.

I wrote some code in C to do exactly what you are trying to do, and it 
works fine with the published values. It isn't for a free compiler, but it 
does mess with the hardware registers directly. If you think it might 
help, you can get the code at 
http://home.hiwaay.net/~jeffj1/projects/index.html from the top link. The 
relavent stuff is in uart.c.

The only major difference I could find between what your code does and 
what mine does is that I set the USART enable bit after setting all other 
values. I'm not sure if that is needed, but it seemed like a good idea at 
the time.

-- 
Jeff Jackowski
        http://ro.com/~jeffj/


Previous by date: 4 Jan 2003 19:56:05 -0000 Re: PIC16F877 & USART, Jeff Jackowski
Next by date: 4 Jan 2003 19:56:05 -0000 Re: PIC16F877 & USART, Declan Moriarty
Previous in thread: 4 Jan 2003 19:56:05 -0000 Re: PIC16F877 & USART, Jeff Jackowski
Next in thread: 4 Jan 2003 19:56:05 -0000 Re: PIC16F877 & USART, Declan Moriarty


Powered by ezmlm-browse 0.20.