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++
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
12748 Discussions

how to create a user interface using nios ii , rs232 of DE2 board

Altera_Forum
Honored Contributor II
2,101 Views

hello , i'm working on a student project using the nios ii processor and i need to build a user interface in a PC . i have the DE2 board. i'm a beginner with the nios ii and i really don't know to interface the DE2 board to a PC , how to program the data transmission to get data out at the PC side ? and how to create the user interface , what is the software that i have to use for this ?:confused::confused::confused: 

all that i know that i can use the RS232 module in SOPC but how to use it and program it in assembly :(.  

i really need your help... thank you
0 Kudos
9 Replies
Altera_Forum
Honored Contributor II
719 Views

 

--- Quote Start ---  

 

all that i know that i can use the RS232 module in SOPC but how to use it and program it in assembly 

--- Quote End ---  

 

Why assembly? Almost everyone uses C. Nios dev tools provide the driver for the rs232 module with the basic functions to send/receive data. 

Browse the forum and Altera website: you'll find a lot of code samples. 

On the PC side the simplest solution is using Hyperterminal or a similar program to send commands and receive answers with a ASCII protocol. 

If you need something more complex, like file transfer, you must write a specific client program which manages serial port data according to your needs.
0 Kudos
Altera_Forum
Honored Contributor II
719 Views

assembly because i'm really used to it more than the c language and actually i'm writing my programs in assembly.  

for the hyperterminal; i don't know if we can access it using windows vista ??? i didn't find it :(
0 Kudos
Altera_Forum
Honored Contributor II
719 Views

I mentioned Hyperterminal because this is what is available on Windows systems. You can use any program which can send and receive data to and from the serial port. 

As I said above, you can even write your own terminal program: if you have minimal programming experience, you can write a simple one in less than a hour.
0 Kudos
Altera_Forum
Honored Contributor II
719 Views

thank u very much Cris72 for ur answer :)  

 

my first problem now is how to use the rs232 interface of the DE2 board to send data to the pc , is it sufficiant to instantiate it in the sopc then program it or shall i download an ip module from the internet ? and how to program the interface ?  

i really need any help  

thank u
0 Kudos
Altera_Forum
Honored Contributor II
719 Views

You only have to add the uart module in sopc builder, then you program it like a standard uart controller, by writing and reading its registers. 

You don't need to download anything: the core is included in sopc standard peripherals.
0 Kudos
Altera_Forum
Honored Contributor II
719 Views

Although you are probably better of using 'putty' instead of 'hyperterminal'

0 Kudos
Altera_Forum
Honored Contributor II
719 Views

thank u very much Cris72 and dsl for ur answers .......is this putty equivalent to hyperterminal ? is delphi suitable to implement the user interface from the pc side ? and one more request ..:oops: does anyone have a sample code to program the rs232 uart using nios ii assembly ( preferable) or C languages  

thank u very much for ur help :)
0 Kudos
Altera_Forum
Honored Contributor II
719 Views

Hi univers, 

Yes, putty is equivalent to hyperterminal or to any other terminal emulator. 

I don't know Delphi but I think you can certainly use it to implement pc side application, like any other programming language. 

If you search in the forum you find some examples of C code for uart management.
0 Kudos
Altera_Forum
Honored Contributor II
719 Views

thank u very much Cris72 for ur help i'll try to find a sample code here in the forum ;)

0 Kudos
Reply