Forum Discussion

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

Feed in data into PIO, or other Interface

Hi, dear all, I'm new to NIOS.

I have a question: May I feed data into PIO

without writing a nios program to acquire data?

I wish that I write a nios software and flash it to EPCS and run.

And other program feed data in, and change PIO.

How can I do this? Is there any example?

THX

2 Replies

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

    Hello,

    first i like to know what kind of Programm you want to write!

    There are a few posibilities to access a PIO

    - You can write a *.c Project in the NIOS II IDE but it is nessesary that your PIOS are included and generated in your NIOS II SoPC Builder.

    - The other way is to write a Hardware description either in VHDL or Verilog. You have to read and understand the Avalon Bus Specifications because you build a Avalon Bus Slave Component and NIOS acceses to your Component over the Avalon Bus.

    To your Question with the EPCS pleas read the Handbook to the NIOS SDK. You can use the NIOS Shell to generate a *.flash code from your *.edif code. This is nessesary to programm your flash.

    Hope this was helpful.

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

    ^^

    Think about this simple case.

    Here is a project build by SOPC,

    main components in the system are NIOS II and JPEG HW Decoder.

    I write a program to tell nios read data from 8-bits input PIO or read data from SPI slave, and decode input stream as jpeg image with HW JPEG decoder.

    Now there is a full system simulator called Simics. Simics is like VMWare, but more than VMWare.[and weak than VMWare] I can write a C interface with DML, a device modeling language. The c interface is normal without any special API, but should be compiled with host's compiler.[Not altera's one]

    From simics viewpoint, this interface should describe what the device does.

    From NIOS viewpoint, the interface should feed data into PIO or SPI and other signal hint NIOS should start processing data stream.

    Question is I don't connect PIO or SPI to a real master hardware device.

    All I need is write a program in C, and feed data into NIOS by JTAG or other reasonable communication channel.

    How can I do this? Or anything I should read.

    Thank all you again.