- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, Im new to nios ii software programming.I need to implement a hardware on an fpga.But as there are no sufficient pins availabile on the board,i thought of using a nios 2 processor to give external inputs to the fpga.As im new to nios ii im not able to program the PIOs of the nios ii properly.Can anyone help me by giving some sample codes for this....
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Adding extra nios cpu won't magically generate extra IO pins!
Your best hope is to add external logic to multiplex/demultiplex the information, these days that would typically be done in a small fpga!- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
PIO ports are memory mapped.
For a PIO input you check the bits corresponding to the input you want to test. For a PIO output you change the bits. Nios tools provide some macros to easily work with PIOs. Say PIO_BASE is base address (assigned in sopc builder) of a 16 wide PIO output port; this will set high outputs 2,5,6,7,8,12 of a 16 IOWR_ALTERA_AVALON_PIO_DATA(PIO_BASE, 0x10F2); Similar for an input port. This will test if input 6 is high: if (IORD_ALTERA_AVALON_PIO_DATA(PIO_BASE) & 0x0040) ....- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This was indeed very helpful.Now im able to program my nios IOs.Thankyou.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page