Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Valued Contributor III
776 Views

About a custom UART and the JTAG UART

http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/huh.gif  

Hi all, 

 

 

When I try to make a custom UART work on my board(for receiving only), 

 

I set the stdin as the UART, stdout and stderr as the JTAG UART. 

 

I program to make the info the UART receives print on the console(also the output of JTAG UART). 

 

However, I find the UART can only receive a group of info correctly 

 

for *only once*(it can receive a group info for one time,the code length is fixed), 

 

after that,there would come out some  

 

strange code out of order or some code without any meaning in the following loop 

 

of my program. 

 

Fortunately,from the output of the first receiving, I suppose 

 

there seems no lost info or any code of my program. 

 

The info received for the first time is indeed what I want. 

 

 

So I hold several questions here: 

 

1)Becausewhen I change the stdout to Com1(named "Debug_uart" in my design),the 

console can only display several correct code,much less than the quantity it should display. 

I think the reason is due to the unbalance of the 115200 baud rate of the Com1 Uart and the 

9600 baud rate of my custom UART.So I want to ask: 

Is this problem has any relationship with the baud rate of JTAG UART? 

 

2)What is the baud rate of the JTAG UART? 

 

3)I had verified the same code in NiosI, everything was OK then. 

Therefore,here,I wonder is this problem caused by something 

inside the NiosII?  

 

 

Thank you in advance! 

 

Regards, 

 

Don
0 Kudos
1 Reply
Highlighted
Valued Contributor III
1 View

Re: About a custom UART and the JTAG UART

The JTAG UART doesn&#39;t have a baud rate, it runs as fast as necessary to transfer the data. 

 

I think your problem is likely to be related to flow control. The standard UART doesn&#39;t have flow control enabled by default so if its buffer fills up it will lose data. There is an ioctl which you can use to turn on flow control (I can&#39;t remember exactly what, but I think it was something like tcsetattr).
0 Kudos