Forum Discussion
Altera_Forum
Honored Contributor
20 years agoUART with FIFO Buffer
Need to use UART with FIFO Buffer in SOPC Builder Nios II System:
1> The UART RS232 available in SOPC are without FIFO is it possible to add FIFO by modifying the same UART core 2> If not is there any other SOPC ready UART_FIFO core available as free IP 3> If not is it possible to get estimate of - LE utilization without Modem Control logic - Is it necessary to write device driver for the same - Apprx how much design time it will take to design HDL UART, device driver for a single person? Please advice asap. running short of time. Thanks in Advance27 Replies
- Altera_Forum
Honored Contributor
Dear everyone,
Who has used the CAL_UART successfully? Could you please tell me how to use it in uClinux ? Best Regards, Fei Wu - Altera_Forum
Honored Contributor
Hi Edmund,
I have the same problem. Could you pls email the file to... hootsmon1 at hotmail dot com **edited ** Got it now, thanks all - Altera_Forum
Honored Contributor
I have the same problem. Could you pls email the file to me: [email protected] .
thanks. - Altera_Forum
Honored Contributor
Hi all,
for information, the cal_uart is not performant unless you make some modifications. Actually, it works correctly in poll mode, not with interrupts. The reason for this is that the interrupts are not generated correctly, and can freeze the system (I use it mainly under uClinux, I don't know the HAL driver very well). A first fix to this is to change <cal_uart>/uart_pm.pl:l1933:rx_char_ready to rx_not_empty This will generate the IRQ properly (regarding to avalon spec), but will not take advantage of the FIFO (IRQ when 1 byte is in the FIFO, which is not optimized). I changed the VHDL to take full advantage of the FIFO, i.e. generate IRQ when FIFO is half full, or every xx ms if a char is present in FIFO. All this is explained in the "cal_uart(with fifo) + NIOSserial.c" thread in uClinux forum. Hope this helps, Regards, Pierre-Olivier - Altera_Forum
Honored Contributor
These work great! and integrate with SOPC builder very easily (instructions included work great!).
http://forum.niosforum.com/forum/index.php?showtopic=4120 (http://forum.niosforum.com/forum/index.php?showtopic=4120) I have tested it out and find no problems. - Altera_Forum
Honored Contributor
Dear Edmund
Could you give the file ^^ My Email [email protected] thanks for your help^^ - Altera_Forum
Honored Contributor
Hi,pearlt.
I read about the UART with FIFO you requested to Edmund. Did you receive that? Can you send me too? My email is [email protected] Many thanks in advance. - Altera_Forum
Honored Contributor
Try getting it from here (http://www.niosforum.com/pages/project_details.php?p_id=89&t_id=18).
- slacker - Altera_Forum
Honored Contributor
Oh,many thanks Slaker.Now,it's ok.
I hope this will be easy to use as get it through your link http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/laugh.gif - Altera_Forum
Honored Contributor
http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/dry.gif what's wronged in this C file?
I'm using FIFOed_avalon_uart Opencore I can't transmit throught RS232 with this code using instruction fifoed_avalon_uart_write(fp,byte/*Tx Pointer*/,25344); (UART's light is always swithced off) FILE* fp; fp = fopen ("/dev/fifoed_avalon_uart_0", "w+"); // Read && Write int ret; if (fp!=NULL) { printf("\nOpen file"); ret = fflush(fp); if(ret==0) printf("\nFlushed file"); else printf("\nNot flushed file"); //Polling int j=0,k=0,z=0,controllo; k=((ctrl/4)*(multi)); z=((ctrl/4)*(multi+1))-1; for(j=k ;j<z; j++) //fprintf(fp,"%x",byte[j]); check=fifoed_avalon_uart_write(fp,byte/*Puntatore dati da Tx*/,25344); but it seems i can transmit using (UART's light is switched on during TX) fprintf(fp,"%x",byte[j]); ...anyway, the received bytes don't seems the ones transmitted....What's up? Thanks http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/sad.gif