首页 > 其他 > 详细

发送trim值

时间:2015-02-05 23:11:37      阅读:320      评论:0      收藏:0      [点我收藏+]

  发送寄存器和地址上的所有值

    uart_send(0xa1);
    uart_send(*((char code*)0x2001));
    uart_send(*((char code*)0x2002));
    uart_send(*((char code*)0x2003));
    uart_send(*((char code*)0x2004));
    uart_send(*((char code*)0x2005));
    uart_send(*((char code*)0x2006));
    
    uart_send(0xa2);    
    uart_send(TRMVAL32K);
    uart_send(OPINTEN);
    uart_send(OPOUTFLAG);
    uart_send(LVIINT);
    uart_send(PMUINTEN);
    uart_send(ADCON1);

 

发送寄存器和地址上的指定bit值

    uart_send(0xa8);//nvr读取trim值

    trimValue  =(*((char code*)0x2001))&0x0f;  //32k    bit3-0
    uart_send(trimValue);
    trimValue= ((*((char code*)0x2002))>>3)&0x1f; //ocp       bit7-3
    uart_send(trimValue);
    trimValue= ((*((char code*)0x2003))>>3)&0x1f; //ovp       bit7-3
    uart_send(trimValue);
    trimValue= ((*((char code*)0x2004))>>3)&0x1f; //lvi       bit7-3
    uart_send(trimValue);
    trimValue=    ((*((char code*)0x2005))>>2)&0x1f;//banfgap      bit6-2
    uart_send(trimValue);
    trimValue=     ((*((char code*)0x2006))>>4)&0x0f;//adcRef      bit7-4
    uart_send(trimValue);

uart_send(
0xa9); //寄存器读取trim值 trimValue =TRMVAL32K&0x0f; //32k bit3-0 uart_send(trimValue); trimValue= (OPINTEN&0xf8)>>3; //ocp bit7-3 uart_send(trimValue); trimValue= (OPOUTFLAG&0xf8)>>3; //ovp bit7-3 uart_send(trimValue); trimValue= (LVIINT&0xf8)>>3; //lvi bit7-3 uart_send(trimValue); trimValue= (PMUINTEN&0x7c)>>2;//banfgap bit6-2 uart_send(trimValue); trimValue= (ADCON1&0xf0)>>4;//adcRef bit7-4 uart_send(trimValue);

 

发送trim值

原文:http://www.cnblogs.com/fx427103/p/4276024.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!