Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++

UART Control

Altera_Forum
Honored Contributor II
1,443 Views

Good morning everybody, 

 

I need to find out if it is possible to independantly switch the transmitter or receiver on / off. The reason for this is that I have the TX and RX lines connected through a transistor to be able to chat to a smart card. 

 

It can obviously now be seen that if the receiver is on while trying to transmit, things don't work so well as the UART then transmits to itself. 

 

Any ideas? 

 

Regards, 

Tyrone
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
451 Views

I don't think there is a way to separately control Tx/Rx enables, but you can separately turn the interrupt enables on/off. If you disable Rx interrupts while you are transmitting then you won't see your own reflection. At the end of Tx you can read the Rx register (twice) to empty it then enable the interrupt. Don't forget, when you load the last character of your Tx into the UART it hasn't yet been sent. I hope this might be of some help. 

 

Banx.
0 Kudos
Altera_Forum
Honored Contributor II
451 Views

Hi Tyrone, 

 

> if the receiver is on while trying to transmit, things don't work so well 

 

You can just gate the rxd line while transmitting -- use a PIO to control the gate. 

 

Regards, 

--Scott
0 Kudos
Altera_Forum
Honored Contributor II
451 Views

Hi Scott, 

 

Thanx! I've already done that and it seems to work fine. I use a PIO line along with an OR gate thus just making the RX line follow whenever I need it to.  

 

I have additional hardware to do this that I am sure I'll be able to do inside the FPGA, but I'll try that at a later stage. For now I just need to get this thing going. 

 

Thanx again! 

 

Regards, 

Tyrone 

 

http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/biggrin.gif
0 Kudos
Reply