Forum Discussion

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

how to use single byte offset in function IORW?

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

thanks.

4 Replies

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

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

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

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

    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.