⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 m128_alky_touch_con1.s

📁 m8做的电压检测
💻 S
📖 第 1 页 / 共 5 页
字号:
	.module M128_ALKY_Touch_CON1.c
	.area text(rom, con, rel)
	.dbfile D:\Program\M128_ALKY_Touch_CON1\M128_ALKY_Touch_CON1.c
	.dbfunc e PIDCalc _PIDCalc fI
	.dbstruct 0 11 PID
	.dbfield 0 SetPoint i
	.dbfield 2 Proportion c
	.dbfield 3 Integral c
	.dbfield 4 Derivative c
	.dbfield 5 LastError I
	.dbfield 7 PrevError I
	.dbfield 9 SumError I
	.dbend
;           TEMP -> <dead>
;         dError -> R10,R11
;          Error -> R12,R13
;      NextPoint -> R10,R11
;             pp -> R20,R21
	.even
_PIDCalc::
	xcall push_xgset303C
	movw R10,R18
	movw R20,R16
	.dbline -1
	.dbline 525
; //ICC-AVR application builder : 2007-10-26 14:46:56
; // Target : M128
; // Crystal: 4.0000Mhz
; // IC:M128,DS1302,LM324
; // 功能:酒精浓度气体发生Hh6232A
; // 说明:酒精浓度检测采用LM324模拟电路
; // 作者:邵伍胜
; // 创作时期:2007年10月
; // 修改时期:2008年01月
; 
; #include <iom128v.h>
; #include <macros.h>
; 
; 
; #define uint unsigned int
; #define uchar unsigned char
; //********************************** main
; //**********************************
; typedef struct PID {
; uint   SetPoint; // 设定目标Desired value
; uchar  Proportion; // 比例常数Proportional Const
; uchar  Integral; // 积分常数Integral Const
; uchar  Derivative; // 微分常数Derivative Const
; int    LastError; // Error[-1]
; 
; int    PrevError; // Error[-2]
; int    SumError; // Sums of Errors
; } PID;
; 
; PID    LD_PID; 
; PID    WD_PID; 
; //LD_PID.Proportion=5;  LD_PID.Integral=1;  LD_PID.Derivative=12;
; //WD_PID.Proportion=20; WD_PID.Integral=2;  WD_PID.Derivative=40;
; //***********************************
; 
; const unsigned char KEY_TZ[16];       
; const unsigned char CON_TAB[240][40];
; const unsigned char START_TAB[240][40];
; const unsigned char L_TAB[240][40];
; const unsigned char ZM_Verdana_fifty[10][51][6];
; const unsigned char ZM_Verdana_nine[12][9];
; const unsigned char ZM_Songti_twelve[12][11];
; const unsigned char ZM_Songti_ten_ChangK[12][4];
; const unsigned char ZM_Songti_ten_DianD[12][4];
; const unsigned char MiMa_TAB[3][8];
; const unsigned char GX_TAB[8];
; const unsigned char SELECT_BDLD_TAB[12][32];
; const unsigned char OK_BDLD_TAB[12][32];
; const unsigned char Succeed_BDLD_TAB[12][32];
; const unsigned char Fail_BDLD_TAB[12][32];
; const unsigned char TOUCH_KEY_TAB[195][28];
; const unsigned char TOUCH_MENU_TAB[195][28];
; const unsigned char TOUCH_KEY_BD[38][7];
; const unsigned char TOUCH_MENU_Message[16][12][25];
; const unsigned char TOUCH_LOCK_TAB[2][16][2];
; //**********************************
; //EEPROM存储结构
; #define EE_Set_LD_AddrL   0x0030  //
; #define EE_Set_LD_AddrH   0x0031  //浓度
; #define EE_Set_FL_AddrL   0x0032  //
; #define EE_Set_FL_AddrH   0x0033  //风量
; #define EE_Set_WD_Addr    0x0034  //温度
; #define EE_MODE_SJ_Addr   0x0035  //时间模式,1:定时控制;2:点动;3:常开
; #define EE_Set_SJ_Addr    0x0036  //时间
; //******
; 
; #define EE_F_WDZQ_Addr    0x0037  //
; #define EE_F_LDZQ_AddrL   0x0038  //
; #define EE_F_LDZQ_AddrH   0x0039  //
; #define EE_F_FSYZ_Addr    0x003A  //换算因子标记  0:2000;1:2100;2:2200
; #define EE_F_YYJB_Addr    0x003B  //
; 
; #define EE_F_MiMa_Addr1   0x003C  //
; #define EE_F_MiMa_Addr2   0x003D  //
; #define EE_F_MiMa_Addr3   0x003E  //
; #define EE_F_MiMa_Addr4   0x003F  //
; #define EE_F_MiMa_Addr5   0x0040  //
; #define EE_F_MiMa_Addr6   0x0041  //用户级
; 
; #define EE_L_MiMa_Addr1   0x0042  //
; #define EE_L_MiMa_Addr2   0x0043  //
; #define EE_L_MiMa_Addr3   0x0044  //
; #define EE_L_MiMa_Addr4   0x0045  //
; #define EE_L_MiMa_Addr5   0x0046  //
; #define EE_L_MiMa_Addr6   0x0047  //工厂级
; 
; #define EE_LDPID_P_Addr    0x0048  //浓度P系数
; #define EE_LDPID_I_Addr    0x0049  //浓度I系数
; #define EE_LDPID_D_Addr    0x004A  //浓度D系数
; #define EE_LDPID_MAX_AddrL 0x004B  //浓度饱和值
; #define EE_LDPID_MAX_AddrH 0x004C  //浓度饱和值
; #define EE_WDPID_P_Addr    0x004D  //温度P系数
; #define EE_WDPID_I_Addr    0x004E  //温度I系数
; #define EE_WDPID_D_Addr    0x004F  //温度D系数
; #define EE_WDPID_MAX_AddrL 0x0050  //温度饱和值
; #define EE_WDPID_MAX_AddrH 0x0051  //温度饱和值
; 
; #define EE_BDLD_052_AddrL  0x0052  
; #define EE_BDLD_052_AddrH  0x0053  
; #define EE_BDLD_130_AddrL  0x0054  
; #define EE_BDLD_130_AddrH  0x0055  
; #define EE_BDLD_208_AddrL  0x0056  
; #define EE_BDLD_208_AddrH  0x0057  
; #define EE_BDLD_300_AddrL  0x0058  
; #define EE_BDLD_300_AddrH  0x0059  
; #define EE_BDLD_520_AddrL  0x005A  
; #define EE_BDLD_520_AddrH  0x005B  
; #define EE_BDLD_780_AddrL  0x005C  
; #define EE_BDLD_780_AddrH  0x005D  
; 
; #define EE_LD_CLR_Addr     0x0060
; 
; #define EE_BD_Year_Addr    0x0061
; #define EE_BD_Month_Addr   0x0062
; #define EE_BD_Date_Addr    0x0063
; 
; //0x0070-0x00BF为十组参数记忆
; //**********************************
; #define SELECT_BDLD_1      0x01
; #define OK_BDLD_2          0x02
; #define Succeed_BDLD_3     0x03
; #define Fail_BDLD_4        0x04
; 
; #define Year   DataTime[0]
; #define Month  DataTime[1]
; #define Date   DataTime[2]
; #define Hour   DataTime[3]
; #define Minute DataTime[4]
; #define Second DataTime[5]
; 
; #define BDLD_052  BDLD_DianYa[0]
; #define BDLD_130  BDLD_DianYa[1]
; #define BDLD_208  BDLD_DianYa[2]
; #define BDLD_300  BDLD_DianYa[3]
; #define BDLD_520  BDLD_DianYa[4]
; #define BDLD_780  BDLD_DianYa[5]
; 
; unsigned char DataTime[6];
; 
; unsigned int  BDLD_DianYa[6];
; 
; unsigned char BD_Year;
; unsigned char BD_Month;
; unsigned char BD_Date;
; unsigned char BD_Succeed_Flag;
; 
; unsigned char MENU_NUM;
; unsigned char Last_Key;
; unsigned char Time_Change_Enable; //时间改变使能
; unsigned char Time_Change_Flag;   //时间改变标志1-10
; unsigned char Flag_500ms;         //半秒闪烁标志
; 
; unsigned char Set_Change_Enable;  //设定值改变使能
; unsigned char Set_Change_Flag1;    //设定值改变标志1-4
; unsigned char Set_Change_Flag2;    //
; unsigned char PID_Change_Flag1;    //
; unsigned char PID_Change_Flag2;    //
; 
; unsigned char L_Change_Enable;
; unsigned char L_PID_Change_Enable;
; unsigned char F_Change_Enable;
; unsigned char F_FLAG1;            //
; unsigned char F_FLAG2;            //
; unsigned char Button_FLAG;            //
; 
; unsigned char L_FLAG1;            //
; unsigned char L_FLAG2;            //
; unsigned char BDLD_FLAG;            //
; unsigned char LD_CLR_FLAG;
; 
; unsigned char BDLD_YN_FLAG052;   
; unsigned char BDLD_YN_FLAG130;     
; unsigned char BDLD_YN_FLAG208;     
; unsigned char BDLD_YN_FLAG300;     
; unsigned char BDLD_YN_FLAG520;     
; 
; 
; unsigned char MiMa_TEMP[6];
; unsigned char KEY_TEMP[6];
; unsigned char P_OK;
; 
; unsigned char Count_50ms;
; 
; unsigned char Count_5S;
; 
; //*********
; unsigned int  DQ_LD_Value;         //当前浓度值
; unsigned int  Set_LD_Value;        //设定浓度值
; unsigned int  Set_LiuLiang_Value;  //设定流量值
; unsigned char Set_WenDu_Value;     //设定温度值
; unsigned char Set_ShiJian_Value;   //设定时间值
; unsigned char Set_ShiJian_MODE;    //时间模式,1:定时控制;2:点动;3:常开
; float         DQ_WenDu_Value;      //当前温度值
; unsigned char DQ_ShiDu_Value;      //当前湿度值
; float         ZhuQi_WenDu_Value;   //注气温度值
; unsigned int  DQ_LiuLiang_Value;   //当前流量值
; unsigned char DaoJiShi_Value;      //倒计时间值
; float         DQ_mgl_Value;        //当前mgl值
; float         DQ_BAC_Value;        //当前BAC值
; //****************
; unsigned char F_WDZQ_Value;        //设定温度周期值
; unsigned int  F_LDZQ_Value;        //设定浓度周期值
; unsigned char F_FSYZ_FLAG;         //换算因子标记  0:2000;1:2100;2:2200
; unsigned char F_YYJB_Value;        //设定原液加补值
; unsigned int  YYJB_DJS_Value;      //原液加补倒计时间值
; 
; unsigned int  DQ_LD_XianShi_TOT;
; unsigned int  DQ_LD_Value_XianShi;
; unsigned int  DQ_WenDu_TOT;        //当前温度值之和
; unsigned int  ZhuQi_WenDu_TOT;     //注气温度值之和
; unsigned int  DQ_ShiDu_TOT;        //当前湿度值之和
; unsigned long int ADC_data_T;
; unsigned int  BDLD_AD_Value;        //标定时浓度AD值
; unsigned int  ICR1_TEMP;
; unsigned int  ICR3_TEMP;
; 
; unsigned char LOCK_Count;
; 
; unsigned int  LD_CLR_Count;
; unsigned char LD_CLR_Value;
; 
; unsigned int  LDPID_MAX;           //浓度PID饱和值
; unsigned int  WDPID_MAX;           //温度PID饱和值
; 
; unsigned int  LDPWM_Value_XianShi;         //
; uchar FLAG;
; //*********FLAG*********** 
;      #define TOUCH_KEY_DISP_F      0x07
;      #define TOUCH_MENU_DISP_F      0x06
;      #define TOUCH_LOCK_F      0x05
;     
;      
;      #define Set_TOUCH_KEY_DISP_F()     FLAG|=1<<TOUCH_KEY_DISP_F
;      #define Clr_TOUCH_KEY_DISP_F()     FLAG&=~(1<<TOUCH_KEY_DISP_F)
;      #define YN_TOUCH_KEY_DISP_F        (FLAG&(1<<TOUCH_KEY_DISP_F))
;      
;      #define Set_TOUCH_MENU_DISP_F()     FLAG|=1<<TOUCH_MENU_DISP_F
;      #define Clr_TOUCH_MENU_DISP_F()     FLAG&=~(1<<TOUCH_MENU_DISP_F)
;      #define YN_TOUCH_MENU_DISP_F        (FLAG&(1<<TOUCH_MENU_DISP_F))
;      
;      #define Set_TOUCH_LOCK_F()     FLAG|=1<<TOUCH_LOCK_F
;      #define Clr_TOUCH_LOCK_F()     FLAG&=~(1<<TOUCH_LOCK_F)
;      #define YN_TOUCH_LOCK_F        (FLAG&(1<<TOUCH_LOCK_F))
; //**********************************
; #define  F_WDZQ_Addr    0x47B9     //
; #define  F_LDZQ_Addr    0x4BC9     //
; #define  F_FSYZ_Addr    0x4FB1     // 
; 
; #define  F_Year_Addr    0x53E9     //
; #define  F_Month_Addr   0x53EE     //
; #define  F_Date_Addr    0x53F2     //
; #define  F_Hour_Addr    0x53F7     //
; #define  F_Minute_Addr  0x53FA     //
; #define  F_Second_Addr  0x53FD     //
; 
; #define  F_YYJB_Addr    0x57A9     //
; #define  F_MiMa_Addr    0x5BEA     //
; //**********************************
; #define DQ_LD_Addr        0x494C  //当前浓度
; #define Set_LD_Addr       0x47B2  //(49*40)+(80/8)浓度
; #define Set_LiuLiang_Addr 0x4BC2  //(75*40)+(80/8)流量
; #define Set_WenDu_Addr    0x4FD2  //(101*40)+(80/8)温度
; #define Set_ShiJian_Addr  0x53E2  //(127*40)+(80/8)时间
; #define DQ_WenDu_Addr     0x57F2  //(153*40)+(80/8)当前温度
; #define DQ_ShiDu_Addr     0x5B8A  //(176*40)+(80/8)当前湿度
; #define ZhuQi_WenDu_Addr  0x5F70  //(201*40)+(64/8)注气温度
; #define DQ_LiuLiang_Addr  0x5F7B  //(201*40)+(152/8)流量
; #define DaoJiShi_Addr     0x5F8B  //(201*40)+(280/8)倒计时间
; #define mgl_Addr          0x57FE 
; #define BAC_Addr          0x5808
; //**********************************
; //#define DQ_WenDu_ADC      0x02  //当前温度 ADMUX select adc input 2
; //#define DQ_ShiDu_ADC      0x03  //当前湿度 ADMUX select adc input 3
; //#define ZhuQi_WenDu_ADC   0x01  //注气温度 ADMUX select adc input 1
; //#define DQ_LD_ADC         0x00  //当前浓度 ADMUX select adc input 0
; 
; #define DQ_WenDu_ADC      0x00  //当前温度 ADMUX select adc input 0
; #define DQ_ShiDu_ADC      0x01  //当前湿度 ADMUX select adc input 1
; #define ZhuQi_WenDu_ADC   0x04  //注气温度 ADMUX select adc input 4
; #define DQ_LD_ADC         0x06  //当前浓度 ADMUX select adc input 6
; //**********************************
; #define SOUND_PORT     PORTB
; #define SOUND          0x03   //portb3    
; #define Set_SOUND()    SOUND_PORT|=1<<SOUND    
; #define Clr_SOUND()    SOUND_PORT&=~(1<<SOUND)    
; //**********************************
; #define Set_FA_OUT()   PORTB|=1<<7
; #define Clr_FA_OUT()   PORTB&=~(1<<7)
; #define Cpl_FA_OUT()   PORTB^=1<<7
; //***********
; //#define Set_BENG_CON()   PORTB|=1<<6
; //#define Clr_BENG_CON()   PORTB&=~(1<<6)
; #define Set_BENG_CON()   PORTB|=1<<5
; #define Clr_BENG_CON()   PORTB&=~(1<<5)
; //**********************************
; #define LCD_WR_PORT    PORTD
; #define LCD_RD_PORT    PORTD 
; #define LCD_CS_PORT    PORTG 
; #define LCD_RS_PORT    PORTG
; 
; #define LCD_DATA_PORT  PORTC 
; 
; #define LCD_WR         0x40   //portd6        out 
; #define LCD_RD         0x80   //portd7        out 
; #define LCD_CS         0x01   //portg0        out 
; #define LCD_RS         0x02   //portg1        out 注意置位的格式
; //**********************************
; //**********************************
; #define ads1100_writeaddr             0x90
; #define ads1100_readaddr               0x91
; 
; #define ADS1100_data 1 //pd1				  ads1100的第4脚
; #define ADS1100_scl  0 //pd0				  ads1100的第3脚
; 
; #define IN_ADS1100_data() DDRD&=~(1<<ADS1100_data)
; #define OUT_ADS1100_data() DDRD|=1<<ADS1100_data
; 
; #define Set_ADS1100_data() PORTD|=1<<ADS1100_data
; #define Clr_ADS1100_data() PORTD&=~(1<<ADS1100_data)
; #define Set_ADS1100_scl() PORTD|=1<<ADS1100_scl
; #define Clr_ADS1100_scl() PORTD&=~(1<<ADS1100_scl)
; //***********************
; //*****************气室浓度读取*****************
; #define QS_ADS1100_data 5 //pd5				  ads1100的第4脚
; #define QS_ADS1100_scl  4 //pd4				  ads1100的第3脚
; 
; #define IN_QS_ADS1100_data() DDRD&=~(1<<QS_ADS1100_data)
; #define OUT_QS_ADS1100_data() DDRD|=1<<QS_ADS1100_data
; 
; #define Set_QS_ADS1100_data() PORTD|=1<<QS_ADS1100_data
; #define Clr_QS_ADS1100_data() PORTD&=~(1<<QS_ADS1100_data)
; #define Set_QS_ADS1100_scl() PORTD|=1<<QS_ADS1100_scl
; #define Clr_QS_ADS1100_scl() PORTD&=~(1<<QS_ADS1100_scl)
; 
; //**********************************
; //**********************************
; //*****************触摸屏ADS7846*****************
; #define ADS7846_DCLK 2  //PE2
; #define ADS7846_CS   3  //PE3
; #define ADS7846_DIN  5  //PE5
; //#define ADS7846_BUSY 5  //PE5
; #define ADS7846_DOUT 6  //PE6
; #define ADS7846_INT  7  //PE7
; 
; #define ADS7846_DOUT_PIN  PINE
; #define ADS7846_BUSY_PIN  PINE
; 
; #define Set_ADS7846_DCLK() PORTE|=1<<ADS7846_DCLK
; #define Clr_ADS7846_DCLK() PORTE&=~(1<<ADS7846_DCLK)
; 
; #define Set_ADS7846_CS() PORTE|=1<<ADS7846_CS
; #define Clr_ADS7846_CS() PORTE&=~(1<<ADS7846_CS)
; 
; #define Set_ADS7846_DIN() PORTE|=1<<ADS7846_DIN
; #define Clr_ADS7846_DIN() PORTE&=~(1<<ADS7846_DIN)
; 
; //**********************************
; //**********************************
; #define DS1302_RST 2 //pb2
; #define DS1302_SDA 1 //pb1
; #define DS1302_SCLK 0 //pb0
; //ds1302相关
; //DS1302_RST=1
; #define Set_DS1302_RST() PORTB|=1<<DS1302_RST
; //DS1302_RST=0
; #define Clr_DS1302_RST() PORTB&=~(1<<DS1302_RST)
; //DS1302_SDA=1
; #define Set_DS1302_SDA() PORTB|=1<<DS1302_SDA
; //DS1302_SDA=0
; #define Clr_DS1302_SDA() PORTB&=~(1<<DS1302_SDA)
; //DS1302_SCLK=1
; #define Set_DS1302_SCLK() PORTB|=1<<DS1302_SCLK
; //DS1302_SCLK=0
; #define Clr_DS1302_SCLK() PORTB&=~(1<<DS1302_SCLK)
; 
; //DS1302的SDA置为输出脚
; #define Set_DS1302_DDRSDA() DDRB|=1<<DS1302_SDA
; //DS1302的SDA置为输入脚
; #define Clr_DS1302_DDRSDA() DDRB&=~(1<<DS1302_SDA)
; #define DS1302_SEC_Reg 0x80
; #define DS1302_MIN_Reg 0x82
; #define DS1302_HR_Reg 0x84
; #define DS1302_DATE_Reg 0x86
; #define DS1302_MONTH_Reg 0x88
; #define DS1302_DAY_Reg 0x8a
; #define DS1302_YEAR_Reg 0x8c
; #define DS1302_CONTROL_Reg 0x8e
; #define DS1302_CHARGER_Reg 0x90
; #define DS1302_CLKBURST_Reg 0xbe
; #define DS1302_Flag 0xc0
; //**********************************
; //**********************************
; //**********************************
; 
; void delay_nus        (unsigned int n); 
; void delay_nms        (unsigned int n); 
; void Sound_delay_nms  (unsigned int n);
; void delay_1us(void);                 //1us延时函数 
; void delay_1ms(void);                 //1us延时函数 
; void LCD_init(void);       //液晶初始化 
; void OUT_LCM (unsigned char n);
; void init_devices(void);
; void port_init(void);
; void Disp_DQ_LD(unsigned char PN,unsigned int addr,unsigned int n); 
; void Disp_Set_LD(unsigned char flag,unsigned int addr,unsigned int n); 
; void Disp_Set_TWO(unsigned char flag,unsigned int addr,unsigned char n);
; void Disp_Set_FOUR(unsigned char flag,unsigned int addr,unsigned int n);
; void Disp_mgl(unsigned int n,float f); 
; void Disp_dot(unsigned int addr,float f); 
; void Disp_Set_LD111(unsigned int addr,unsigned int n); 
; void Display_Time(unsigned char n);
; void Display_Time_CLR(void);
; 
; void DS1302_Write(uchar reg,uchar data);
; uchar DS1302_Read(uchar reg);
; uchar Check_DS1302(void); 
; void DS1302_Init(void);  
; void ReadTime(void);
; 
; void delay_us(unsigned int n);
; 
; void Sound_Nms(unsigned int n);
; 
; //*********
; void   ads1100_start(void);                           /*i2c start */
; void   ads1100_stop(void);                           /*i2c stop*/
; uchar   ackby_ads1100(void);                           /*ads1100应答*/
; void   ackby_master(void);                           /*主机应答*/
; void   send_frame(uchar framedata);                     /*send 8bit to ads1100*/
; uchar   read_frame(void);                             /*read bbit from ads1100*/
; void   ads1100_write(unsigned char addr,unsigned char command);   /*write a command to the ads1100*/ 
; unsigned int   ads1100_read(unsigned char addr);             /*read a convert data from ads1100*/
; 
; void   QS_ads1100_start(void);                           /*i2c start */
; void   QS_ads1100_stop(void);                           /*i2c stop*/
; uchar   QS_ackby_ads1100(void);                           /*ads1100应答*/
; void   QS_ackby_master(void);                           /*主机应答*/
; void   QS_send_frame(uchar framedata);                     /*send 8bit to ads1100*/
; uchar   QS_read_frame(void);                             /*read bbit from ads1100*/
; void   QS_ads1100_write(unsigned char addr,unsigned char command);   /*write a command to the ads1100*/ 
; unsigned int   QS_ads1100_read(unsigned char addr);             /*read a convert data from ads1100*/
; 
; void   FL_ads1100_start(void);                           /*i2c start */
; void   FL_ads1100_stop(void);                           /*i2c stop*/
; uchar   FL_ackby_ads1100(void);                           /*ads1100应答*/
; void   FL_ackby_master(void);                           /*主机应答*/
; void   FL_send_frame(uchar framedata);                     /*send 8bit to ads1100*/
; uchar   FL_read_frame(void);                             /*read bbit from ads1100*/
; void   FL_ads1100_write(unsigned char addr,unsigned char command);   /*write a command to the ads1100*/ 
; unsigned int   FL_ads1100_read(unsigned char addr);             /*read a convert data from ads1100*/
; 
; void   BENG_ads1100_start(void);                           /*i2c start */
; void   BENG_ads1100_stop(void);                           /*i2c stop*/
; uchar   BENG_ackby_ads1100(void);                           /*ads1100应答*/
; void   BENG_ackby_master(void);                           /*主机应答*/
; void   BENG_send_frame(uchar framedata);                     /*send 8bit to ads1100*/
; uchar   BENG_read_frame(void);                             /*read bbit from ads1100*/
; void   BENG_ads1100_write(unsigned char addr,unsigned char command);   /*write a command to the ads1100*/ 
; unsigned int   BENG_ads1100_read(unsigned char addr);             /*read a convert data from ads1100*/
; //*********
; 
; void Disp_Start_donghua(unsigned int addr,unsigned char n); 
; uchar keboard(void); 
; 
; void EEPROM_write(unsigned int uiAddress, unsigned char ucData);
; unsigned char EEPROM_read(unsigned int uiAddress);
; void EEPROM_init(void);
; void Read_EE_10(unsigned char n);
; void Write_EE_10(unsigned char n);
; 
; uint SYS_ADC(unsigned char n);
; int PIDCalc( PID *pp,  uint NextPoint);
; int PIDCalc_WD( PID *pp, uint NextPoint);
; void PIDInit (PID *pp);
; float WENDU_TZ(uint ad_v);
; void  Display_Start_donghua320240(void);
; void  Display_CON320240(void);
; void  Display_CLR(void);
; void  CON_Value_XIANSHI(void);
; void  F_Value_XIANSHI(void);
; void  L_LDBD_XIANSHI(void);
; void  PID_Value_XIANSHI(void);
; void XG_CON_Set(unsigned char kkk);
; void XG_PID_Set(unsigned char kkk);
; void L_LDBD_Set(unsigned char kkk);
; unsigned char P_I_D_SUB1(unsigned char XX,unsigned char k);
; unsigned int P_I_D_SUB2(unsigned int XX,unsigned char k);
; void XG_F_Set(unsigned char kkk);
; 
; void  Display_F320240(void);
; void  Display_L320240(void);
; void  Display_L_PID320240(void);
; void  Display_TOUCH_KEY(void);
; void  Display_TOUCH_KEY_VAL(void);
; void  Display_TOUCH_MENU(void);
; void Disp_SJ_MODE_CLR(void);
; void Disp_SJ_MODE_DianD(void);
; void Disp_SJ_MODE_ChangK(void);
; void Disp_Select_BDLD(unsigned int addr);
; void Disp_Select_BDLD_Clr(unsigned int addr);
; void Disp_MiMa(unsigned char flag,unsigned int addr);
; void MiMa_TEMP_Clr(void);
; void Button_YN(void);
; void Disp_Message(uchar n,unsigned int addr);
; void  Display_TOUCH_Message(unsigned char n);
; void  Display_TOUCH_LOCK(unsigned char n);
; void  Display_TOUCH_KEY_BD(void);
; void LD_JiSuan(void);
; 
; uchar keyboard(void);
; uint ReadFromCharFrom7846(void);
; void WriteCharTo7846(unsigned char num);
; void ADS7846_start(void);
; //******************************************
; //******************************************
; //******************************************
; //******************************************
; //******************************************
; //******************************************
; //******************************************
; //******************************************
; //******************************************
; //=============================PID计算部分==============================================
; int PIDCalc( PID *pp, uint NextPoint)
; {
	.dbline 527
; int dError,Error,TEMP;
; Error = pp->SetPoint - NextPoint; // 偏差
	movw R30,R20
	ldd R12,z+0
	ldd R13,z+1
	sub R12,R10
	sbc R13,R11
	.dbline 528
; pp->SumError += Error; // 积分
	movw R24,R30
	adiw R24,9
	movw R30,R24
	ldd R2,z+0
	ldd R3,z+1
	add R2,R12
	adc R3,R13
	std z+1,R3
	std z+0,R2
	.dbline 529
;   if(pp->SumError > 20000)
	ldi R24,20000
	ldi R25,78
	movw R30,R20
	ldd R2,z+9
	ldd R3,z+10
	cp R24,R2
	cpc R25,R3
	brge L2
X0:
	.dbline 530
;    {pp->SumError = 20000;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -