• 发送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);
  • 相关阅读:
    超级简单:一步一步教你创建一小型的asp.net mvc 应用程序
    asp.net AJAX 验证用户名是否存在 Jquery
    生成缩略图、为图片添加文字水印、图片水印的类
    图Graph
    [转]Implementing a Generic Binary Tree in C#
    .net C#数据结构
    Why HTML5 is worth your time
    跳跃表SkipList
    C# LockFreeStack类
    [转]泛型弱引用
  • 原文地址:https://www.cnblogs.com/fx427103/p/4276024.html
Copyright © 2020-2023  润新知