Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

USART overrun for PIC19F4520

Status
Not open for further replies.

gumboguy

New Member
The question is, at a baud rate of 19200, what is the minimum time for overrun to happen in the USART. The device is the PIC19F4520.

The RCREG has two locations and the Receiver Shift Register (RSR) can hold 1 byte.

My thinking was that the minimum time would be 3/19200 because that's the time it takes to transfer 3 bits, and 3 bits fill the RCREG and RSR. If you had 4 bits in that time period it would exceed the locations and cause overrun error.

Some background is on page 266 of the book "Microprocessors: from Assembly Language to C using the PIC19Fxx2" by Robert Reese. It's available on google books.
 
Each byte consists of 10 bits, usually. There is a start bit, a stop bit and 8 data bits. That can vary as the numbers of those bits can vary, but let's leave it at 10 bits for now.

The RCREG buffer is 2 bytes deep. However, the Receiver Shift Register (RSR) can't really be counted because it might be almost full when you check if there is data, so the first byte could arrive the moment after you check it.

That leaves the 2 byte buffer. So the time is 2 * 10 / 19200 = 1.04 ms
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top