我的项目是使用以下套件,使用Digilent Nexys 4板产生警笛声:Vivado和SDK(Eclipse)。我使用usleep命令设法做到了这一点(将一个频率延迟到另一个频率),但是为了获得更好的等级,我需要使用Xilinx FIT计时器(https://www.xilinx.com/support/documentation/ip_documentation/fit_timer/v2_0/pg110-fit-timer.pdf)。 我该如何替换例如以下代码行:
usleep(5000000);
使用FIT计时器吗?
我对VHDL还是很陌生,但是在编码方面,所以请帮助我!
XTmrCtr_Start(&Timer, 0);
XTmrCtr_Start(&Timer, 1);
Frequency = 500;
XTmrCtr_SetResetValue(&Timer, 0, CLK_FREQUENCY_HZ/Frequency);
XTmrCtr_SetResetValue(&Timer, 1, CLK_FREQUENCY_HZ/(2*Frequency));
usleep (5000000);
Frequency = 1000;
XTmrCtr_SetResetValue(&Timer, 0, CLK_FREQUENCY_HZ/Frequency);
XTmrCtr_SetResetValue(&Timer, 1, CLK_FREQUENCY_HZ/(2*Frequency));
usleep (5000000);
XTmrCtr_Stop(&Timer, 0);
XTmrCtr_Stop(&Timer, 1);
CtrlReg = XTmrCtr_GetControlStatusReg(Timer.BaseAddress, 0);
xil_printf ("\r\nTimer 0 Control Reg after start = 0x%0.4X", CtrlReg);
CtrlReg = XTmrCtr_GetControlStatusReg(Timer.BaseAddress, 1);
xil_printf ("\r\nTimer 1 Control Reg after start = 0x%0.4X", CtrlReg);