Sign in

username:

password:



Not a member?

Search piclist



Search tips

Subscribe to piclist



piclist by Keywords

12F675 | 16F628 | 16F84 | 16f877 | 16F877A | 16F88 | 18F458 | ADC | AVR | Bootloader | CAN | CCS | CRC | EAGLE | EEPROM | ICD | ICSP | IDE | JDM | LED | Macros | Microchip | MPLAB | PCB-CAD | PIC10F | Pic12f675 | PIC16F84 | PIC16F84A | PIC16F877 | PIC18 | PIC18F452 | PicBasic | PICC | PICSTART | PWM | RS-485 | RS232 | SMT | SPI | UART | USART | USB | Wireless | Wisp628 | Xilinx

Ads

Discussion Groups

Discussion Groups | Piclist | 16F877 UART problems

A discussion group for the PICMicro microcontroller. Also called the Microchip PIC, this list is dedicated to the use and abuse of this fine, simple, microcontroller. Close to topic posts are welcome, ie. general electronics.

16F877 UART problems - stdf23173 - Oct 24 12:35:00 2003


Hello All,

I have written/copied some routines from c2c examples and used these
to get the uart on the 877 working. (No commercial stuff just DIY).

Instead of using the TRMT to determine whether the buffer is empty i
use the TXIF flag. The first 20-30 tranmissions go fine
(complete "Hello world" strings !) . Than it stops ! Any one an idea ? grtz

Simon






(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )


Re: 16F877 UART problems - stdf23173 - Oct 24 15:38:00 2003


Even worse now.
It does think the buffer (TXREG) is not empty and will not jump out
of the loop.

void sendchar(char x)
{
while(!TXIF);
TXREG=x;
}

aaarggh.

grtz

Simon





(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )

Re: Re: 16F877 UART problems - Chad Russel - Oct 25 13:18:00 2003

We can wag (wild ass guess) all day. Why don't you post the
initialization part for UART and applicable code segments.

Chad

--- stdf23173 <> wrote:
>
> Even worse now.
> It does think the buffer (TXREG) is not empty and will not jump out
> of the loop.
>
> void sendchar(char x)
> {
> while(!TXIF);
> TXREG=x;
> }
>
> aaarggh.
>
> grtz
>
> Simon >

__________________________________






(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )

Re: 16F877 UART problems - stdf23173 - Oct 26 5:26:00 2003


I am ashamed to admit , blush, that i forgot to switch on TXEN.
I used to init every single bit in TXSTA. Later on i replaced it by
configuring TXSTA in one go ! I stared and stared at it and could not
find it.(at first instance)

grtz

Simon
--- In , Chad Russel <chadrussel@y...> wrote:
> We can wag (wild ass guess) all day. Why don't you post the
> initialization part for UART and applicable code segments.
>
> Chad
>
> --- stdf23173 <stdf23173@y...> wrote:
> >
> > Even worse now.
> > It does think the buffer (TXREG) is not empty and will not jump
out
> > of the loop.
> >
> > void sendchar(char x)
> > {
> > while(!TXIF);
> > TXREG=x;
> > }
> >
> > aaarggh.
> >
> > grtz
> >
> > Simon
> >
> >
> >
>
> __________________________________





(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )

Re: Re: 16F877 UART problems - Chad Russel - Oct 26 11:03:00 2003

We have all done the same thing. ***blush***

--- stdf23173 <> wrote:
>
> I am ashamed to admit , blush, that i forgot to switch on TXEN.
> I used to init every single bit in TXSTA. Later on i replaced it by
> configuring TXSTA in one go ! I stared and stared at it and could not

> find it.(at first instance)
>
> grtz
>
> Simon
>
<<*** snip ***>>

__________________________________





(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )