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

access the custom logic

Altera_Forum
Honored Contributor II
1,058 Views

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 ?
0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
375 Views

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.
0 Kudos
Reply