Searching \ for '[PIC] PIC18F4550 USART Problem' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/ios.htm?key=usart
Search entire site for: 'PIC18F4550 USART Problem'.

Exact match. Not showing close matches.
PICList Thread
'[PIC] PIC18F4550 USART Problem'
2009\06\19@231402 by Jared Sanson

flavicon
face
Hello, when trying to receive data using the PIC18F4550's Hardware
USART, it only receives one byte,

and seems to keep that byte stored so the next read will return the same
byte, even if nothing has been sent.

I have heard RCREG is a 3-level buffer and reading it 3 times will clear
it, but that doesn't work.

Please help me, I am getting really frustrated over this small problem



Jared

2009\06\21@120745 by Vitaliy

flavicon
face
Jared Sanson wrote:
> Please help me, I am getting really frustrated over this small problem

Any luck?


2009\06\21@130548 by solarwind

picon face
On Sat, Jun 20, 2009 at 4:13 AM, Jared Sanson<spam_OUTJaredTakeThisOuTspamidsgt.co.nz> wrote:
> Hello, when trying to receive data using the PIC18F4550's Hardware
> USART, it only receives one byte,
>
> and seems to keep that byte stored so the next read will return the same
> byte, even if nothing has been sent.
>
> I have heard RCREG is a 3-level buffer and reading it 3 times will clear
> it, but that doesn't work.
>
> Please help me, I am getting really frustrated over this small problem

You need to give us more information like what language you're using,
what development board/programmer you are using and so on.

2009\06\21@160854 by Tony Vandiver

flavicon
face
You might also need to check for errors on reception - I seem to
remember something like this that happened to me before on a different
PIC part.  Some errors may need to be cleared explicitly, or may be part
of another register that isn't being read and cleared through access.  
In particular, check for framing and overrun, or parity if you have that
enabled.  Like Vitaliy suggests, it would be helpful to see more of your
code especially the uart initialization and code just after your
blocking read.  And, since this is a blocking read, are you sure that
the watchdog isn't resetting while waiting?  It's usually better if you
can arrange it in a way that doesn't block, but just polls to see if a
character is available, and reacts only when one is.  That way, you can
continue to do other things in the meantime.

Tony


Jared Sanson wrote:
{Quote hidden}

More... (looser matching)
- Last day of these posts
- In 2009 , 2010 only
- Today
- New search...