#include<c8051f020.h>
#include"DAC.h"
/********DA初始化*********************/
void DAC_Init(void)
{
REF0CN =0x03; //
DAC0CN =0x86; //利用更新DAC0H寄存器
}
void DAC0_Output(unsigned int val)
{
DAC0L = (unsigned char)val;//送DA值低2位
DAC0H = (unsigned char)(val>>8);//送DA值高8位
}