Forum Discussion
SS5
Occasional Contributor
7 years agoThanks for your response.
Please check my NIOS_code. Without FOR LOOP, how should i run the counter module.
#include "sys/alt_stdio.h"
#include "alt_types.h"
#include<io.h>
#include<system.h>
#include<stdio.h>
int main()
{
int result,i;
IOWR(ENABLE_BASE, 0, 0x0); // Enable the counter
alt_printf("Hello from Nios II!\n"); // Send Hello World to the JTAG UART
usleep(100);
for (i=0;i<10000;i++)
{
result=IORD(COUNTER_OUT_BASE, 0);
printf("%d\n",(result+i));
}
// IOWR(ENABLE_BASE, 0, 0x1);
return 0;
}