cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
1,583 Views
Registered: ‎07-23-2019

Increase FIFO size of Uartlite

Jump to solution

Hello,

The defult size of the UARTLite in Vivado is 16 bytes.

Does someone understand why did they choose to make the FIFO size small?

Is there anyway to increase the FIFO size, has someone succeedded and uses the altered uartlite driver in the SDK?

Thanks.

0 Kudos
1 Solution

Accepted Solutions
u4223374
Advisor
Advisor
1,525 Views
Registered: ‎04-26-2015

I would assume that it's 16 bytes because that's how big the 16550 UART buffer is - and people have been using those for decades without problems.

 

As has been said above, UARTs are not fast. At 115200bps (about the maximum you'd normally use), 16 bytes = 160 bits (8 data bits plus start/stop bits) = 1.38ms. A long time, for a CPU.

View solution in original post

7 Replies
drjohnsmith
Teacher
Teacher
1,567 Views
Registered: ‎07-09-2009
At the VERY slow speed RS232 happens, and the much higher speed the processor works at, 16 characters of RS232 is probably billions of CPU instructions,

even allowing for slow interrupts, why you would want a bigger fifo in the UART? It seems just a waste of silicon.



<== If this was helpful, please feel free to give Kudos, and close if it answers your question ==>
0 Kudos
dpaul24
Scholar
Scholar
1,559 Views
Registered: ‎08-07-2014

mijal.kilimajerq@controp.com,

as stated above, 2 bytes is good enough. The read side of the FIFO in  most cases is many times faster than the UART baud rate.

------------FPGA enthusiast------------
Consider giving "Kudos" if you like my answer. Please mark my post "Accept as solution" if my answer has solved your problem
Asking for solutions to problems via PM will be ignored.

0 Kudos
u4223374
Advisor
Advisor
1,526 Views
Registered: ‎04-26-2015

I would assume that it's 16 bytes because that's how big the 16550 UART buffer is - and people have been using those for decades without problems.

 

As has been said above, UARTs are not fast. At 115200bps (about the maximum you'd normally use), 16 bytes = 160 bits (8 data bits plus start/stop bits) = 1.38ms. A long time, for a CPU.

View solution in original post

1,411 Views
Registered: ‎07-23-2019

Thank you all for your kind answer.

I have a unit that sends 128 bytes periodically every 20ms. I've managed to read all the bytes every 20ms. What I cannot understand is that if the size of the uarlite FIFO is 16, where are the remaining bytes stored? Aren't the bytes sent all at once, and the size of FIFO is 16? So where does it hold all the bytes?

The baud rate is 115200, unit issues packets of 128 bytes every 20ms.

 

0 Kudos
1,403 Views
Registered: ‎07-23-2019
I forgot to mention that I use the polling method.
0 Kudos
drjohnsmith
Teacher
Teacher
1,360 Views
Registered: ‎07-09-2009
how often do you poll ?
Once you recognise there is data there, every 100 us or so, another byte is going to be present,
I'm betting your polling faster than that, and your moving the data form the fifo before it has a chance to get full.

<== If this was helpful, please feel free to give Kudos, and close if it answers your question ==>
1,328 Views
Registered: ‎07-23-2019

@drjohnsmith you are right!!

I poll every 0.5 ms and it makes sense now why I am able to read all the bytes.

Thanks!