I may be wrong, but shouldn't you send data to Uart from whithin the while loop ?
Code:
while(1) {
ans = IORD(COUNTER_INTERFACE_0_BASE,0);
printf("%d",ans);
}
Add:
I'm assuming you're using as template some of the Hello World examples took from the Nios2 IDE that prints to the Jtag Uart, on which you could insert your code.
hi,
thanks for the replay andre_teprom,
you are exactly right, i dont have any experience before in qsys, this is my first time, thats why i used the code from demo program.
i will sure try your suggestion
As belike you, I'm also newbie on this area, and the only thing I could help with would be at the programming scope. By the way, I could not see the counter at the above picture, shouldn't be there ?
i declared it as a custom component, which is jtag_count1 in qsys system.
any way thanks much for your suggestion on c code. it helped me for being close to my target