gnupic: PIC16F877 & USART


Previous by date: 2 Jan 2003 00:02:01 -0000 Re: PIC16F877 & USART, Rick Mann
Next by date: 2 Jan 2003 00:02:01 -0000 Re: PIC16F877 & USART, Snail Instruments
Previous in thread: 2 Jan 2003 00:02:01 -0000 Re: PIC16F877 & USART, Rick Mann
Next in thread: 2 Jan 2003 00:02:01 -0000 Re: PIC16F877 & USART, Snail Instruments

Subject: Re: PIC16F877 & USART
From: Snail Instruments ####@####.####
Date: 2 Jan 2003 00:02:01 -0000
Message-Id: <3.0.6.16.20030101232417.476f589c@pop.iol.cz>

At 13:14 28.12.02 -0800, you wrote:
>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.

If possible check your signals with scope, maybe the problem lies somewhere else.

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

This BRGH=1 bug applied to PIC16C77 (or 74?), not to the 16F877.

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

Check your hardware this way - remove the PIC from its socket, connect the RC6 and RC7 contacts with a piece of wire. Now your terminal program should echo all the characters typed. If this works O.K., try following main loop, which should echo all the characters as well:

;setup serial port
....
     bcf _GIE ;(or don't set it)
main:btfss _RCIF
     goto main
     movf rcreg,w
     movwf txreg
     goto main

Regards,

Josef



Previous by date: 2 Jan 2003 00:02:01 -0000 Re: PIC16F877 & USART, Rick Mann
Next by date: 2 Jan 2003 00:02:01 -0000 Re: PIC16F877 & USART, Snail Instruments
Previous in thread: 2 Jan 2003 00:02:01 -0000 Re: PIC16F877 & USART, Rick Mann
Next in thread: 2 Jan 2003 00:02:01 -0000 Re: PIC16F877 & USART, Snail Instruments


Powered by ezmlm-browse 0.20.