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++
12604 Discussions

how to use single byte offset in function IORW?

Altera_Forum
Honored Contributor II
1,139 Views

I found the offset is 4 bytes in IOWR, I want to know how to set the offset single byte? 

 

thanks.
0 Kudos
4 Replies
Altera_Forum
Honored Contributor II
418 Views

you can use the IOWR_xxDIRECT() macros instead of IOWR for byte addressing (xx being 8,16 or 32 depending on the access size). 

Using an odd address will only work with IOWR_8DIRECT() though, if I remember correctly.
0 Kudos
Altera_Forum
Honored Contributor II
418 Views

That's correct. This is the alignment you need to use for each: 

 

IOxx_8DIRECT --> any alignment 

IOxx_16DIRECT --> 2 byte alignment 

IOxx_32DIRECT --> 4 byte alignment
0 Kudos
Altera_Forum
Honored Contributor II
418 Views

Hi, 

 

Anyone knows about the IOWR function declaration/definition? 

 

I need to know how the IDE drivers the data to pins of my component in SoPC. 

For example, if I have a LED_PIO with widht 8 bits, I just write IOWR (LED_PIO_BASE, 0, DATA) and I think the DATA will be sent to pins. But, if I have a component as DM9000A Ethernet controller, with 38 pins, where some are data and some are control, how I can set the correct pins to write a word? 

 

And how can I see the information about the order of component pins in IDE?
0 Kudos
Altera_Forum
Honored Contributor II
418 Views

With components other than PIOs, you don't directly control the pins through the IOWR macro. You access registers. All the components have a driver with at least an include file that lists the registers and macros to read/write them. 

I don't have any design with a DM9000A but you should check all the include files that are added in your BSP. There must be one of them with a definition of the chip registers.
0 Kudos
Reply