Forum Discussion
Altera_Forum
Honored Contributor
12 years agoInterval timer problem
Hello. I’ve got a problem with simple interrupt from interval timer in uC/OS-II System frequency is 75Mhz. There are PIO and timer. It makes strobe. Duration 10 ms. Here it is:
// glob...
Altera_Forum
Honored Contributor
12 years agoI measure strobe with oscilloscope.
I describe behavior of my code In main function (int foo(void)) I set strob signal in high level byIOWR_ALTERA_AVALON_PIO_DATA(PIO_BASE, 0); //set PIO (cause I has inverter on ouput pin). Then init timer to 10ms, and start it. Enter endless loop and wait for interrupt. I expect it takes 10ms to get interrupt. But it takes much longer because init functions work so slow in uC. In interrupt handler I deactivate srobe and timer. IOWR_ALTERA_AVALON_PIO_DATA(PIO_BASE, 1); timer_exit(); That’s all. Time to exec timer_exit();
err=1; and following instructions doesn’t meters because I measure time between --- Quote Start --- IOWR_ALTERA_AVALON_PIO_DATA(PIO_BASE, 0); --- Quote End --- and --- Quote Start --- IOWR_ALTERA_AVALON_PIO_DATA(PIO_BASE, 1); --- Quote End ---