Forum Discussion

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

altremote_update

http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/wink.gif Issue resolved, i was not holding the control signals long enough for the megafunction.

I have an Altera (stratix) NDK (1s10)

I have instantiated an alt_remote update megafunction using the full_featured reference design as base.

For some strange reason , i am unable to write any parameters into the megafunction, when i try to readback i always get all Ones.

all the output PIOs from the Megafunction are declared as Rising edge in the SOPC builder

and all unused pins are tristated, configuration is set to remote but it still does not work.

Can any of the pros take a look at it and tell me whats wrong?

I have been trying this for a week but cant seem to figure out the problem!

Pretty desperate !!!! Got to submit the code in 2 days

Heres my code

<------------------------------->

IOWR_ALTERA_AVALON_PIO_DATA(READ_PARAM_BASE, 0x0);

IOWR_ALTERA_AVALON_PIO_DATA(PARAM_BASE, 0x2);

IOWR_ALTERA_AVALON_PIO_DATA(DATA_IN_BASE, 0x1);

IOWR_ALTERA_AVALON_PIO_DATA(WRITE_PARAM_BASE, 0x1);

IOWR_ALTERA_AVALON_PIO_DATA(WRITE_PARAM_BASE, 0x0);

busy = IORD_ALTERA_AVALON_PIO_DATA(BUSY_BASE);

while(busy == 1)

{

busy = IORD_ALTERA_AVALON_PIO_DATA(BUSY_BASE);

}

IOWR_ALTERA_AVALON_PIO_DATA(READ_PARAM_BASE, 0x1);

IOWR_ALTERA_AVALON_PIO_DATA(READ_PARAM_BASE, 0x0);

busy = IORD_ALTERA_AVALON_PIO_DATA(BUSY_BASE);

while(busy == 1)

{

busy = IORD_ALTERA_AVALON_PIO_DATA(BUSY_BASE);

}

dataout = IORD_ALTERA_AVALON_PIO_DATA(DATA_OUT_BASE);

IOWR_ALTERA_AVALON_PIO_DATA(LED_PIO_BASE, dataout);

<------------------------------>

regards

Pavan

1 Reply

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

    When I need to have a read/write interface I usually have 1) An lpm_decode (enabled with cs), 2) A MUX (selected with the address bits), 3) registers enabled by the lpm_decode logic.

    This simple mix allows you to do anything a PIO can plus allows you to take the functionality of many PIOs and stick them altogether implemented in their own address range.

    ppk031000 if you like I can send you an example of this (it&#39;s on my home machine so email me if you want it, otherwise I&#39;ll forget).