Forum Discussion

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

access the custom logic

FOr nios I

I have created a custome logic pwm for my project...SOPC assignes me address of 4A0 - 4AF

address 00 - duty cycle

address 01 - clock divide

is it correct is program it in C such this way ?

int *duty_cycle = (int *) 0x000004A0; //

int *clock_divide = (int *) 0x000004A4; //

int w = 10;

int z = 1000;

//assigned value to the inputs.

*clock_divide = z;

*duty_cycle = w;

---------------------------------------------------------------------------------

i have tried this but htere is no output...any suggestions ?

1 Reply

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

    You should better consider using the IORD() and IOWR() macros from the <io.h> for accessing your IP registers, or you might experience arratic behaviours due to data cache operations and compiler optimizations.

    If you have tested your component outside of the NIOS-II system (in a simulation only separate project) and the results were as expected, and you&#39;re still having problems, you could "signaltap" your entire design.