微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 嵌入式设计讨论 > MCU和单片机设计讨论 > 求AD7799的初始化程序,帮帮忙额,拜谢了!

求AD7799的初始化程序,帮帮忙额,拜谢了!

时间:10-02 整理:3721RD 点击:
求AD7799的初始化程序,帮帮忙额,拜谢了!

void AD7799_INIT(void)   
{   
        WriteByteToAd7799(0x10);   //b0001 0000   
        /* Writes to Communications Register Setting Next Operation as Write to CONFIGURATION Register*/   
        WriteByteToAd7799(0x37);   //B0011 0111
        WriteByteToAd7799(0x30);   //B0011 0000
        /*CONFIGURATION REGISTER[00,BO(0),U/B(0),0(0),G2(1),G1(1),G0(1),0,0,REF_DET(0),BUF(1),0(0),CH2(0),CH1(0),CH0(0)]*/   
       
        WriteByteToAd7799(0x08);   
        //b0000 1000   
        /* Writes to Communications Register Setting Next Operation as Write to Mode Register*/   
        WriteByteToAd7799(0x80);   
        WriteByteToAd7799(0x0A);   
        /* Writes to Mode Register Initiating Internal Zero-Scale Calibration*/   
        //WaiteRDY();
        _delay_ms(5);   
        /* Wait for RDY pin to go low to indicate end of calibration cycle*/   
        WriteByteToAd7799(0x08);   
        /* Writes to Communications Register Setting Next Operation as Write to  Mode Register*/   
        WriteByteToAd7799(0xA0);   
        WriteByteToAd7799(0x0A);   
        /* Writes to Mode Register Initiating Internal Full-Scale Calibration*/   
        //WaiteRDY();   
//        _delay_ms(5);   
        /* Wait for RDY pin to go low to indicate end of calibration cycle*/   
        WriteByteToAd7799(0x08);//b0000 1000   
        /* Writes to Communications Register Setting Next Operation as Write to Mode Register*/   
        WriteByteToAd7799(0x00);   //00010000   
        WriteByteToAd7799(0x0A);   //00001111 (16.7HZ65dB)
        /* Mode Register[MD2(0),MD1(0),MD0(0),PSW(0),0(0),0(0),0(0),0(0),(0),(0),0(0),0(0),FS3(1),FS2(0),FS1(1),FS0(0)]*/   
        /* Continuous-Conversion Mode. Fadc=16.7HZ;*/
}

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top