Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
15 years ago

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

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

9 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- 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.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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 :(
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

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

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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 :)
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

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