{ CLK_PeripheralClockConfig(CLK_Peripheral_DAC, ENABLE); RI->IOCMR2 = 0x10; RI->IOSR2 =0x10; DAC_DeInit(); /* Fill DAC Init param DAC_Trigger_None and DAC Channel1 Init */ DAC_Init(DAC_Channel_1, DAC_Trigger_None, DAC_OutputBuffer_Disable); /* Enable DAC Channel1 */ DAC_Cmd(DAC_Channel_1, ENABLE); DAC_SetChannel1Data(DAC_Align_12b_R,2048); } stm8l dac 此程序已经在stm8l152c6t6上面验证过,测PF0可以有正常的输出。但是在STM8l151K6上面测PB5引脚确没有输出。问题会是在哪里?左边为stm8l151.右边为stn8l152 经高人指点要设置routing interface.可是加了 RI->IOCMR2 = 0x10; RI->IOSR2 =0x10;仿真的结果显示这两个寄存器任为0.本人菜鸟。希望大师进一步指点;谢谢!!! |