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

Exact match. Not showing close matches.
PICList Thread
'[PIC]: USART overrun problem'
2004\06\09@151838 by Colombain Nicolas

flavicon
face
Hi Martin,
You have to use the interrupt routine to clean the buffer.
Can you post your code ?
Regards,
Nicolas



> Hi all,
> i4m trying to comunicate a PC with a PIC16f874(clock 4 MHZ) , using the
USART asynchronous mode at 9600 bps. The length of each message is  8
>bytes (8bits,Non Parity,1Stop bit). This PIC has a FIFO buffer(Register
RCREG) of two bytes, so the idea is to clean the buffer before the third
byte >reach the buffer, i4ve been triying to improve the code in the PIC to
clean the buffer as fast as possible, but i 4m still having this problem. Is
there any good >code to avoid it? Can it be done adding hardware? Thanks  a
lot

--
http://www.piclist.com hint: To leave the PICList
spam_OUTpiclist-unsubscribe-requestTakeThisOuTspammitvma.mit.edu

2004\06\09@152502 by Fred Hillhouse

picon face
I would recommend clearing out the register any time a byte arrives and
store it. This can be done by monitoring the receive flag RCIF. There will
be 1ms of time to do other processing if necessary. If you take more than
that, you are in trouble.

Maybe you can be interrupted by RCIF and handle it then.

What are you using to write code, assembly, PBP, etc.?



{Original Message removed}

2004\06\09@153744 by Jan-Erik Soderholm

face picon face
> Hi all,
> i4m trying to comunicate a PC with a PIC16f874(clock 4 MHZ)
> using the USART asynchronous mode at 9600 bps. The length of
> each message is 8 bytes (8bits,Non Parity,1Stop bit). This PIC has
> a FIFO  buffer(Register RCREG) of two bytes,
> the buffer before the third byte reach the buffer,

And you should read the incomming byte as fast as possible after
the flag is set (can't remeber the name, but you'll find it...)
There is not need to wait for two bytes in the RCREG FIFO.
Why wait ? You have to read each byte anyway, better do it
at once.

I do not think the "FIFO" was ment to be "used" in that way.

> in the PIC to clean the buffer as fast as possible,

Exactly *how* do you know when to read the incomming bytes(s) ?

> but i 4m still having this problem.
> Is there any good code to avoid it?

Any code but yours, probably :-) :-)

> Can it be done adding  hardware?

That should definitly not be needed at 9600 baud !
Just read each byte as they are received.

Regards,
Jan-Erik.

--
http://www.piclist.com hint: To leave the PICList
.....piclist-unsubscribe-requestKILLspamspam@spam@mitvma.mit.edu

2004\06\09@155041 by Bruce

flavicon
face
MeLabs has an example for the 16F877 @4MHz.

Interrupt-driven, 32 byte buffer, 9600 bps hardware serial using assembly
language interrupt handler.

http://www.microengineeringlabs.com/resources/samples/x1/pbp/serbufAx.bas

Portions are in BASIC, but the USART int/buffer code is all assembly.

Regards,

-Bruce
techspamKILLspamrentron.com
http://www.rentron.com


> Hi all,
> i´m trying to comunicate a PC with a PIC16f874(clock 4 MHZ) , using the USART asynchronous mode at 9600 bps. The length of each
message is  8 bytes (8bits,Non Parity,1Stop bit). This PIC has a FIFO buffer(Register RCREG) of two bytes, so the idea is to clean
the buffer before the third byte reach the buffer, i´ve been triying to improve the code in the PIC to clean the buffer as fast as
possible, but i ´m still having this problem. Is there any good code to avoid it? Can it be done adding hardware? Thanks  a lot
> __________________________________________________

--
http://www.piclist.com hint: To leave the PICList
.....piclist-unsubscribe-requestKILLspamspam.....mitvma.mit.edu

2004\06\09@155911 by Jan-Erik Soderholm
face picon face
And don't forget Olin Lathrop's perfectly working
all-ASM environment. His USART macros with FIFO
(for both send and receive!) worked out-of-the-box first
time for me.

Jan-Erik.
PS.
Has anyone heard from Olin lately ?


Bruce wrote :

> MeLabs has an example for the 16F877 @4MHz.
>
> Interrupt-driven, 32 byte buffer, 9600 bps hardware serial
> using assembly language interrupt handler.
>
> www.microengineeringlabs.com/resources/samples/x1/pbp/s
> erbufAx.bas
>
> Portions are in BASIC, but the USART int/buffer code is all assembly.

--
http://www.piclist.com hint: To leave the PICList
EraseMEpiclist-unsubscribe-requestspam_OUTspamTakeThisOuTmitvma.mit.edu

2004\06\09@161624 by Fred Hillhouse

picon face
Greetings Jan-Erik.

Is this code available somewhere? I would like to check it out.

Thank you.
Fred


{Original Message removed}

2004\06\09@163737 by Jan-Erik Soderholm

face picon face
> Greetings Jan-Erik.
>
> Is this code available somewhere? I would like to check it out.
>
> Thank you.
> Fred
>

Start at http://www.embedinc.com/pic/ and drill down from there.

Note, the actual code (even if not to hard to use) could be a bit
frustrating to "read" if you're not up-to-speed on Olin's
special development environment.
A very good environent anyway, if you ask me...

And yes, nearly forgot, *I* have made a PDF version of
Olins web based docs. You can find that on
http://www.st-anna-data.se/ under the "PIC page"
menu selection. I checked about a month ago, and there
didn't seems to be any (major) changes in Olins pages.


Jan-Erik.

--
http://www.piclist.com hint: To leave the PICList
piclist-unsubscribe-requestspamspam_OUTmitvma.mit.edu

2004\06\09@165231 by Bruce Partridge

flavicon
face
He's alive and well on the Microchip forums, as acerbic as ever.

Bruce Partridge
http://www.rebreather.ca

> {Original Message removed}

2004\06\09@173801 by Mike Hord

picon face
How much time is there between each 8 byte packet?

Could you simply buffer each byte as it arrives in your ISR
and then raise a flag to be dealt with in your main routine
once all 8 bytes have arrived?  Any PIC should be able to
deal with data coming in at 9600 bps...right now, I have
a PIC running at 3.68 MHz which grabs the byte and stuffs
it out via SPI, and it's receiving data at 115.2 kbps, AND
not using interrupts, so it has to be possible.

Mike H.

>Hi all,
>i4m trying to comunicate a PC with a PIC16f874(clock 4 MHZ) , using the
>USART asynchronous mode at 9600 bps. The length of each message is  8 bytes
>(8bits,Non Parity,1Stop bit). This PIC has a FIFO buffer(Register RCREG) of
>two bytes, so the idea is to clean the buffer before the third byte reach
>the buffer, i4ve been triying to improve the code in the PIC to clean the
>buffer as fast as possible, but i 4m still having this problem. Is there
>any good code to avoid it? Can it be done adding hardware? Thanks  a lot

_________________________________________________________________
MSN 9 Dial-up Internet Access fights spam and pop-ups   now 3 months FREE!
http://join.msn.click-url.com/go/onm00200361ave/direct/01/

--
http://www.piclist.com hint: To leave the PICList
@spam@piclist-unsubscribe-requestKILLspamspammitvma.mit.edu

2004\06\10@075945 by Roland

flavicon
face
Have a look at Tom's code 'picuart.asm' for an axample of catching all
those errors;


;                       PICUART.ASM
;                 Microchip MPASM format
;
;                     version 1.04.1
;               Last modified July 24, 2000
;
;                  A Program and Document
;       designed to help others learn how to use the
;                 built-in UART features of
;              the PIC microcontroller family.
;
;The program has been verified on MANY PIC microcontrollers.
;No one has reported any PIC with built-in UART which the
;program does not work with so far.
;
;                      Written by
;                  Fr. Thomas McGahee
;               KILLspamtom_mcgaheeKILLspamspamsigmais.com
;       primary web site http://redrival.com/mcgahee
;     secondary website http://mcgahee.freeservers.com

..............

{Quote hidden}

Regards
Roland Jollivet

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2004\06\10@080947 by Dave Lag

picon face
Those links appear dead ('least here)
try
http://www.pic101.com/mcgahee/index.html
Dave

At 05:33 AM 6/10/04, you wrote:
{Quote hidden}

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2004\06\10@081157 by rixy04

flavicon
face
FYI, one of Tom's authorized archived websites is at:
http://www.pic101.com/mcgahee
Rick

Roland wrote:

{Quote hidden}

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2004\06\11@150147 by M. Adam Davis

flavicon
face
Another archive is here:
http://ubasics.com/mcgahee/

-Adam

Roland wrote:

{Quote hidden}

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

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