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 ...
Altera_Forum
Honored Contributor
19 years agohttp://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