zoukankan      html  css  js  c++  java
  • 发送trim值

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

        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);
  • 相关阅读:
    一个分页的存储过程
    自己动手:修改crx文件制作自己的Chrome Apps
    SQLSERVER 过滤所有权的代码
    在ASP.NET中实现多文件上传
    引用 TimeSpan简介
    xml
    常用的正则表达式小结
    ASP.NET事务处理
    创建可在网页下载安装的ActiveX控件(通过Setup.exe安装)
    ASP.NET验证控件应用实例与详解
  • 原文地址:https://www.cnblogs.com/fx427103/p/4276024.html
Copyright © 2011-2022 走看看