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++
12748 Discussions

Problems with UART on NIOS 1

Altera_Forum
Honored Contributor II
1,147 Views

Hi 

 

I have two problems with the NIOS 1 on a APEX 20KE board. 

 

Problem 1 

I want to set a fixed speed on the UART (like changing it to 19200), but after changing the speed of the UARTs in one of the standard layouts (standard_32) and generating the system, the speed is still wrong. Any ideas? 

 

Problem 2 

After adding an additional UART (to pins on JP11) to one of the standard layouts (standard_32) and generating and compiling (and uploading), the NIOS card doesn’t respond to anything more or less (no uploading of code). Any ideas?  

 

Any help would be appreciated.
0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
486 Views

Sounds like a clock speed problem. Make dead sure that the clock as specified in your SOPC matches the one on the board, in your case I think 33.333Mhz. SOPC might default to something higher (50Mhz) or lower(20MHz). 

 

Next, if that still doesn't work send a constant stream of data like hex 0xaa or 0x55. This you must do in assembly, compiled into your GERMS monitor. Check it out on a scope (Tx) and make sure that you see the 01010101 stream coming out. If you don't have a scope then voltage divide the output with a 10k pot (the 3V3 side, not the -+10V from the MAX232), choose a lower baud rate than 19200 (try 300 baud) and plug it into the aux of you hi-fi. You should hear a constant tone and the sound should change as you change the data. This will prove that your UART is sending data.  

 

Do a board level test. Connect Tx to Rx and send data. In case of received data toggle the state of a LED. This will prove that the UART works but that your baud rate does not match the PC's. 

 

If this doesn't work then check the output and inputs of the MAX232 (also reroute you Tx and RX to other pins and short them). The MAX232 uses a charge pump to convert 0-3.3V signals to -10V to +10V and back again. When you measure the Tx pin you should either get +10V or -10V. 

 

Also make sure that the Tx and Rx pins actually go to the MAX232. Make a copy of your project, take the NIOS IP out, create internal stimulus for the Tx and route the Rx input to another LED output. Then short pins 2 and 3 on the connector and test. If this doesn't work then your pins are not connected correctly or some chip is stuffed. 

 

Last, if you are using your own serial cable make sure it is a crossover, ie. the Tx on the NIOS board is connected to the Rx on your PC. 

 

Good luck 

 

VictorS
0 Kudos
Reply