uint16 gu16WaveformBuffer[33] = {0};
uint16 gu16SineWaveBuffer[] = {2047,2446,2830,3184,3494,3749,3938,4055,4094,4055,3938,3749,3494,3184,2830,2446,2047,
1648,1264,910,600,345,156,39,0,39,156,345,600,910,1264,1648,2047,0xFFF};
uint16 *pWaveform, *pGenerateData;
void myDelay (INT32U ulTime)
{
INT32U i;
i = 0;
while (ulTime--) {
for (i = 0; i < 2000; i++);
}
}
int main (void)
{
int i,num=2;
INT16U uiVout = 1; /* ¼ÆËãת»»Öµ */
SystemCoreClockUpdate();
uart0Init(9600,0,0,8,1);
printf("DAC generated take SineWave Test ");
dacInit(); /* DAC³õʼ»¯ */
while (1)
{
for(i=0;i<33;i++)
{
gu16WaveformBuffer[i]=gu16SineWaveBuffer[i];
dacTrigger(gu16WaveformBuffer[i]); /* DACÊä³ö */
myDelay(1);
if(i==33) i=0;
}
}
}
|