====================================================================
P0SKIP = 0x02; // Skip P0.1 which is used for IDA0
P0MDIN &= ~0x02; // Configure P0.1 as an analog pin
XBR0 = 0x00;
XBR1 = 0x40; // Enable crossbar and weak pullups
REF0CN = 0x03; // Enable internal VREF generator
IDA0CN = 0xF0; // Enable IDAC0 for 0.5 mA full-scale output; updated on IDA0H Changed;
while(1)
{
IAD0L = 0x00;
IDA0H = Setvalue; //Setvalue 由外部设置
}
===================================================================
上面是程序的一部分,大部分配置参考的官方例程,但是P0.1口电压只能是0V或者3.3V,不是想要的变化值,求路过大神解惑
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
一周热门 更多>