Forum Discussion

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

Problem with the IOWR and IORD

in an Ethernet program developed by IDE

I do a test , writing:

IOWR ( DM9000A_Base, 1, data);

tmp=IORD ( DM9000A_Base ,1);

Should not the tmp be the same with the data?

the result is not , and whatever data is , the result tmp=ff00,

will anyone tell me why?

1 Reply

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

    It looks like you are trying to write to the DM900A ethernet chip status register, which is read-only (writing to it only clears status bits). A quick glance at the data sheet shows register 1 (the offset in your IOWR statement) is 00h at reset, so this is why you read 00h in the lower 8 bits. Upper bits are undefined if you are reading a byte.

    Hope this helps.

    Tim