数模转化,请问怎样能看到输出的值,是利用引脚接到示...
时间:10-02
整理:3721RD
点击:
//初始化DAC
DAC_InitStruct1.DAC_TrigerMode = DAC_TRIGER_MODE_SOFTWARE;
DAC_InitStruct1.DAC_BufferMode = BUFFER_MODE_NORMAL;
DAC_InitStruct1.DAC_BufferStartPostion = 0;
DAC_InitStruct1.DAC_BufferUpperLimit = 15;
DAC_InitStruct1.DAC_WaterMarkMode = WATER_MODE_4WORD;
DAC_Init(&DAC_InitStruct1);
//赋值DAC测试值
for(i=0;i<16;i++)
{
DAC_DataBuffer = i*100;
}
//设置Buffer
DAC_SetBuffer(DAC0,DAC_DataBuffer,16);
while(1)
{
DAC_SoftwareTrigger(DAC0); //不断触发DAC转化输出
LED1 = !LED1;
DelayMs(300);
}
}
请问怎样能看到输出的值,是利用引脚接到示波器还是怎样?
DAC_InitStruct1.DAC_TrigerMode = DAC_TRIGER_MODE_SOFTWARE;
DAC_InitStruct1.DAC_BufferMode = BUFFER_MODE_NORMAL;
DAC_InitStruct1.DAC_BufferStartPostion = 0;
DAC_InitStruct1.DAC_BufferUpperLimit = 15;
DAC_InitStruct1.DAC_WaterMarkMode = WATER_MODE_4WORD;
DAC_Init(&DAC_InitStruct1);
//赋值DAC测试值
for(i=0;i<16;i++)
{
DAC_DataBuffer = i*100;
}
//设置Buffer
DAC_SetBuffer(DAC0,DAC_DataBuffer,16);
while(1)
{
DAC_SoftwareTrigger(DAC0); //不断触发DAC转化输出
LED1 = !LED1;
DelayMs(300);
}
}
请问怎样能看到输出的值,是利用引脚接到示波器还是怎样?