Wednesday, February 23, 2011

Using RS232 on NiosII processor

Prerequisite Knowledge
This tutorial requires the following hardware and software:
1.      A PC running the XP operating systems.
2.      QuartusII sotware version 7.2 sp3.
3.      NiosII EDS version 7.2 sp3.
4.      MegaCore IP Library version 7.2 sp3.
5.      A Cyclone II DE2 NiosII Develepmont Board.
This tutorial assumes that you are familiar with Quartus II software, Nios II Development Board device and peripherals, NiosII SOPC Builder and fundamental of C programming.
Create the SOPC Builder with the following components.


With these setting parameters:
SDRAM controller:


Cpu:

And copy the Top_Level.v

Open NIOSII IDE and create these following setting.
For main.c


Set the system library properties as


and set the target connection like

Open HyperTerminal , define your own port settings based on computer hardware.

So Run your program and the hyperterminal screen will display. Make sure all RS232 cable already connected into board and computer.
You can key in test characters via keyboard or sending a file.
Click TransferàSend Text File

Browse any file .txt from any folder. They will display all those sample content character in .txt file.


Congratulation!

3 comments:

  1. Hi, I want to try this program but unfortunately i don't have MegaCore IP Library. And how will I be able to instantiate the PLL at the top level module of your codes. Is it really necessary?

    ReplyDelete
  2. hy i want to write c code of uart for niosII processor.
    what i do for ths??

    ReplyDelete