Altera_Forum
Honored Contributor
15 years agoProblem about interval timer
Hi guys
now i want to use the interval timer as interrupt to send a 40khz sine wave to i/o port.but when i set the interval timer as 1us which equals the sampling frequecy of ad5547(1mhz),it does'nt work.then i set the interval timer as 10us(then the fs is 100khz),the result is 4khz not my wanted.i find the reason a long time,but got nothing.The cpu clock is 20MHz.:p Have you got this problem?I need your advise.Thanks a lot! PS: my control code as the list IOWR_ALTERA_AVALON_PIO_DATA(DACONTROL_BASE,0x00); if(j>=24) j=0; else j++; timer_counter =sin_vector[j]; IOWR_ALTERA_AVALON_PIO_DATA(PIO_BASE,timer_counter); IOWR_ALTERA_AVALON_PIO_DATA(DACONTROL_BASE,0x01); IOWR_ALTERA_AVALON_PIO_DATA(DACONTROL_BASE,0x03);