I measure strobe with oscilloscope.
I describe behavior of my code
In main function (
int foo(void)) I set strob signal in high level by
IOWR_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 ---