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 code

Altera_Forum
Honored Contributor II
1,173 Views

What does the following code do? 

 

case(SW[3:0]) 

4'b0000: UART_TXD = RS422_1_TX; 

4'b0001: UART_TXD = RS422_2_TX; 

4'b0010: UART_TXD = RS422_3_TX; 

4'b0011: UART_TXD = RS422_3_TX; 

... 

verilog challenged:oops:
0 Kudos
4 Replies
Altera_Forum
Honored Contributor II
332 Views

Hi: 

This is an 16 to 1 multiplexer or mux. Based on the 4-bit selection term SW, the output is connected to the input where SW matches the case term 4'b0000, 4'b0001 etc. 

So if SW = 4'b0010, the output UART_TXD = input RS422_3_TX.
0 Kudos
Altera_Forum
Honored Contributor II
332 Views

Thank you very much!

0 Kudos
Altera_Forum
Honored Contributor II
332 Views

I am using an eval board. I am trying to communicate with a PC via the RS232.  

Can I just use the switches to send an 8 bit signal? It doesn't let me just assign the switches as an array to the UART TX?  

What am I doing wrong?  

Thanks,
0 Kudos
Altera_Forum
Honored Contributor II
332 Views

I'm trying to build a vhdl uart too. I think that the TX is only one bit long because it is a signal you have to modify according to your baudrate.

0 Kudos
Reply