Pages: [1]   Go Down
Author Topic: UART question  (Read 1910 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 22
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Does anyone know if the UARTS in the Due have hardware buffers/fifos?  Or are they expecting the serial library to do the buffering and defaulting to 64-bytes again?

ta,
chris

[ I, like others, sometimes modify the serial library (especially on a MEGA project I have) to avoid serial overflows when the sketch has to do some length op like send an email.  This extra RAM on this baby would allow me to bump my UART buffers up to 1K or whatever it takes to minimise my serial data loss. ]
Logged

0
Offline Offline
God Member
*****
Karma: 25
Posts: 606
Always making something...
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The datasheet makes no mention of fifos in the UART or USART sections.  They can use DMA, however...

Looking at the source code, in RingBuffer.h:

#define SERIAL_BUFFER_SIZE 64

Also, it looks like buffering is only used for reception, not transmission.  From UARTClass.cpp:

Code:
size_t UARTClass::write( const uint8_t uc_data )
{
  // Check if the transmitter is ready
  while ((_pUart->UART_SR & UART_SR_TXRDY) != UART_SR_TXRDY)
    ;

  // Send character
  _pUart->UART_THR = uc_data;
  return 1;
}

Hopefully this will soon change to buffered transmit like AVR has used since Arduino 1.0.
Logged

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 126
Posts: 8472
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

No hardware FIFOs.

_____
Rob
Logged

Rob Gray aka the GRAYnomad www.robgray.com

0
Offline Offline
Newbie
*
Karma: 0
Posts: 22
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks guys, I couldn't see any mention in the datasheet either but I thought a newer chip like that probably had something.  Still, if I can use the extra RAM to hike up the serial buffers I will be happy.
Logged

Pages: [1]   Go Up
Jump to: