diff --git a/main.LST b/main.LST index a375800..3545b66 100644 --- a/main.LST +++ b/main.LST @@ -1,4 +1,4 @@ -C51 COMPILER V9.56.0.0 MAIN 05/01/2022 13:19:20 PAGE 1 +C51 COMPILER V9.56.0.0 MAIN 05/05/2022 19:42:13 PAGE 1 C51 COMPILER V9.56.0.0, COMPILATION OF MODULE MAIN @@ -62,22 +62,21 @@ line level source 53 }; 54 55 struct UserInfo userInfo; -C51 COMPILER V9.56.0.0 MAIN 05/01/2022 13:19:20 PAGE 2 +C51 COMPILER V9.56.0.0 MAIN 05/05/2022 19:42:13 PAGE 2 56 57 void LcdDisplay(); 58 void LcdDisplay1(); 59 void Delay10ms(void); 60 - 61 #define SlaveAddress 0x46 //¶¨ÒåÆ÷¼þÔÚIIC×ÜÏßÖеĴӵØÖ·,¸ù¾ÝALT ADDRESSµ - -ØÖ·Òý½Å²»Í¬ÐÞ¸Ä - 62 //ALT ADDRESSÒý½Å½ÓµØʱµØַΪ0x46£¬½ÓµçԴʱµØÖ - -·Îª0xB8 + 61 #define SlaveAddress 0x46 //定义器件在IIC总线中的从地址,根据ALT ADDRESS地址引脚不 + -修改 + 62 //ALT ADDRESS引脚接地时地址为0x46,接电源时地址为0xB8 63 typedef unsigned char BYTE; 64 typedef unsigned short WORD; 65 - 66 BYTE BUF[8]; //½ÓÊÕÊý¾Ý»º´æÇø - 67 int dis_data; //±äÁ¿ + 66 BYTE BUF[8]; //接收数据缓存区 + 67 int dis_data; //变量 68 69 void delay_nms(unsigned int k); 70 void InitLcd(); @@ -88,22 +87,21 @@ line level source 75 void DisplayOneChar(uchar X,uchar Y,uchar DData); 76 void conversion(uint temp_data); 77 - 78 void Single_Write_BH1750(uchar REG_Address); //µ¥¸öдÈëÊý¾Ý - 79 uchar Single_Read_BH1750(uchar REG_Address); //µ¥¸ö¶ÁÈ¡ÄÚ²¿¼Ä´æÆ÷Êý¾Ý - 80 void Multiple_Read_BH1750(); //Á¬ÐøµÄ¶ÁÈ¡ÄÚ²¿¼Ä´æÆ÷Êý - -¾Ý + 78 void Single_Write_BH1750(uchar REG_Address); //单个写入数据 + 79 uchar Single_Read_BH1750(uchar REG_Address); //单个读取内部寄存器数据 + 80 void Multiple_Read_BH1750(); //连续的读取内部寄存器数据 81 //------------------------------------ 82 void Delay5us(); 83 void Delay5ms(); - 84 void BH1750_Start(); //ÆðʼÐźŠ- 85 void BH1750_Stop(); //Í£Ö¹ÐźŠ- 86 void BH1750_SendACK(bit ack); //Ó¦´ðACK - 87 bit BH1750_RecvACK(); //¶Áack - 88 void BH1750_SendByte(BYTE dat); //IICµ¥¸ö×Ö½Úд - 89 BYTE BH1750_RecvByte(); //IICµ¥¸ö×Ö½Ú¶Á + 84 void BH1750_Start(); //起始信号 + 85 void BH1750_Stop(); //停止信号 + 86 void BH1750_SendACK(bit ack); //应答ACK + 87 bit BH1750_RecvACK(); //读ack + 88 void BH1750_SendByte(BYTE dat); //IIC单个字节写 + 89 BYTE BH1750_RecvByte(); //IIC单个字节读 90 91 - 92 //ºÁÃëÑÓʱ************************** + 92 //毫秒延时************************** 93 void delay_nms(unsigned int k) 94 { 95 1 unsigned int i,j; @@ -126,100 +124,100 @@ line level source 112 1 WORD n = 560; 113 1 114 1 while (n--); -C51 COMPILER V9.56.0.0 MAIN 05/01/2022 13:19:20 PAGE 3 - 115 1 } 116 +C51 COMPILER V9.56.0.0 MAIN 05/05/2022 19:42:13 PAGE 3 + 117 /************************************** - 118 ÆðʼÐźŠ+ 118 起始信号 119 **************************************/ 120 void BH1750_Start() 121 { - 122 1 SDA1 = 1; //À¸ßÊý¾ÝÏß - 123 1 SCL1 = 1; //À¸ßʱÖÓÏß - 124 1 Delay5us(); //ÑÓʱ - 125 1 SDA1 = 0; //²úÉúϽµÑØ - 126 1 Delay5us(); //ÑÓʱ - 127 1 SCL1 = 0; //ÀµÍʱÖÓÏß + 122 1 SDA1 = 1; //拉高数据线 + 123 1 SCL1 = 1; //拉高时钟线 + 124 1 Delay5us(); //延时 + 125 1 SDA1 = 0; //产生下降沿 + 126 1 Delay5us(); //延时 + 127 1 SCL1 = 0; //拉低时钟线 128 1 } 129 130 /************************************** - 131 Í£Ö¹ÐźŠ+ 131 停止信号 132 **************************************/ 133 void BH1750_Stop() 134 { - 135 1 SDA1 = 0; //ÀµÍÊý¾ÝÏß - 136 1 SCL1 = 1; //À¸ßʱÖÓÏß - 137 1 Delay5us(); //ÑÓʱ - 138 1 SDA1 = 1; //²úÉúÉÏÉýÑØ - 139 1 Delay5us(); //ÑÓʱ + 135 1 SDA1 = 0; //拉低数据线 + 136 1 SCL1 = 1; //拉高时钟线 + 137 1 Delay5us(); //延时 + 138 1 SDA1 = 1; //产生上升沿 + 139 1 Delay5us(); //延时 140 1 } 141 142 /************************************** - 143 ·¢ËÍÓ¦´ðÐźŠ- 144 Èë¿Ú²ÎÊý:ack (0:ACK 1:NAK) + 143 发送应答信号 + 144 入口参数:ack (0:ACK 1:NAK) 145 **************************************/ 146 void BH1750_SendACK(bit ack) 147 { - 148 1 SDA1 = ack; //дӦ´ðÐźŠ- 149 1 SCL1 = 1; //À¸ßʱÖÓÏß - 150 1 Delay5us(); //ÑÓʱ - 151 1 SCL1 = 0; //ÀµÍʱÖÓÏß - 152 1 Delay5us(); //ÑÓʱ + 148 1 SDA = ack; //写应答信号 + 149 1 SCL = 1; //拉高时钟线 + 150 1 Delay5us(); //延时 + 151 1 SCL = 0; //拉低时钟线 + 152 1 Delay5us(); //延时 153 1 } 154 155 /************************************** - 156 ½ÓÊÕÓ¦´ðÐźŠ+ 156 接收应答信号 157 **************************************/ 158 bit BH1750_RecvACK() 159 { - 160 1 SCL1 = 1; //À¸ßʱÖÓÏß - 161 1 Delay5us(); //ÑÓʱ - 162 1 CY = SDA1; //¶ÁÓ¦´ðÐźŠ- 163 1 SCL1 = 0; //ÀµÍʱÖÓÏß - 164 1 Delay5us(); //ÑÓʱ + 160 1 SCL = 1; //拉高时钟线 + 161 1 Delay5us(); //延时 + 162 1 CY = SDA; //读应答信号 + 163 1 SCL = 0; //拉低时钟线 + 164 1 Delay5us(); //延时 165 1 166 1 return CY; 167 1 } 168 169 /************************************** - 170 ÏòIIC×ÜÏß·¢ËÍÒ»¸ö×Ö½ÚÊý¾Ý + 170 向IIC总线发送一个字节数据 171 **************************************/ 172 void BH1750_SendByte(BYTE dat) 173 { 174 1 BYTE i; 175 1 - 176 1 for (i=0; i<8; i++) //8λ¼ÆÊýÆ÷ -C51 COMPILER V9.56.0.0 MAIN 05/01/2022 13:19:20 PAGE 4 - + 176 1 for (i=0; i<8; i++) //8位计数器 177 1 { - 178 2 dat <<= 1; //ÒƳöÊý¾ÝµÄ×î¸ßλ - 179 2 SDA1 = CY; //ËÍÊý¾Ý¿Ú - 180 2 SCL1 = 1; //À¸ßʱÖÓÏß - 181 2 Delay5us(); //ÑÓʱ - 182 2 SCL1 = 0; //ÀµÍʱÖÓÏß - 183 2 Delay5us(); //ÑÓʱ + 178 2 dat <<= 1; //移出数据的最高位 +C51 COMPILER V9.56.0.0 MAIN 05/05/2022 19:42:13 PAGE 4 + + 179 2 SDA = CY; //送数据口 + 180 2 SCL = 1; //拉高时钟线 + 181 2 Delay5us(); //延时 + 182 2 SCL = 0; //拉低时钟线 + 183 2 Delay5us(); //延时 184 2 } 185 1 BH1750_RecvACK(); 186 1 } 187 188 /************************************** - 189 ´ÓIIC×ÜÏß½ÓÊÕÒ»¸ö×Ö½ÚÊý¾Ý + 189 从IIC总线接收一个字节数据 190 **************************************/ 191 BYTE BH1750_RecvByte() 192 { 193 1 BYTE i; 194 1 BYTE dat = 0; 195 1 - 196 1 SDA1 = 1; //ʹÄÜÄÚ²¿ÉÏÀ,×¼±¸¶ÁÈ¡Êý¾Ý, - 197 1 for (i=0; i<8; i++) //8λ¼ÆÊýÆ÷ + 196 1 SDA = 1; //使能内部上拉,准备读取数据, + 197 1 for (i=0; i<8; i++) //8位计数器 198 1 { 199 2 dat <<= 1; - 200 2 SCL1 = 1; //À¸ßʱÖÓÏß - 201 2 Delay5us(); //ÑÓʱ - 202 2 dat |= SDA1; //¶ÁÊý¾Ý - 203 2 SCL1 = 0; //ÀµÍʱÖÓÏß - 204 2 Delay5us(); //ÑÓʱ + 200 2 SCL = 1; //拉高时钟线 + 201 2 Delay5us(); //延时 + 202 2 dat |= SDA; //读数据 + 203 2 SCL = 0; //拉低时钟线 + 204 2 Delay5us(); //延时 205 2 } 206 1 return dat; 207 1 } @@ -228,390 +226,390 @@ line level source 210 211 void Single_Write_BH1750(uchar REG_Address) 212 { - 213 1 BH1750_Start(); //ÆðʼÐźŠ- 214 1 BH1750_SendByte(SlaveAddress); //·¢ËÍÉ豸µØÖ·+дÐźŠ- 215 1 BH1750_SendByte(REG_Address); //ÄÚ²¿¼Ä´æÆ÷µØÖ·£¬ - 216 1 // BH1750_SendByte(REG_data); //ÄÚ²¿¼Ä´æÆ÷Êý¾Ý£¬ - 217 1 BH1750_Stop(); //·¢ËÍÍ£Ö¹ÐźŠ+ 213 1 BH1750_Start(); //起始信号 + 214 1 BH1750_SendByte(SlaveAddress); //发送设备地址+写信号 + 215 1 BH1750_SendByte(REG_Address); //内部寄存器地址, + 216 1 // BH1750_SendByte(REG_data); //内部寄存器数据, + 217 1 BH1750_Stop(); //发送停止信号 218 1 } 219 - 220 //********µ¥×Ö½Ú¶ÁÈ¡***************************************** - 221 /* - 222 uchar Single_Read_BH1750(uchar REG_Address) - 223 { uchar REG_data; - 224 BH1750_Start(); //ÆðʼÐźŠ- 225 BH1750_SendByte(SlaveAddress); //·¢ËÍÉ豸µØÖ·+дÐźŠ- 226 BH1750_SendByte(REG_Address); //·¢ËÍ´æ´¢µ¥ÔªµØÖ·£¬´Ó0¿ªÊ¼ - 227 BH1750_Start(); //ÆðʼÐźŠ- 228 BH1750_SendByte(SlaveAddress+1); //·¢ËÍÉ豸µØÖ·+¶ÁÐźŠ- 229 REG_data=BH1750_RecvByte(); //¶Á³ö¼Ä´æÆ÷Êý¾Ý - 230 BH1750_SendACK(1); - 231 BH1750_Stop(); //Í£Ö¹ÐźŠ- 232 return REG_data; - 233 } - 234 */ - 235 //********************************************************* - 236 // - 237 //Á¬Ðø¶Á³öBH1750ÄÚ²¿Êý¾Ý - 238 // -C51 COMPILER V9.56.0.0 MAIN 05/01/2022 13:19:20 PAGE 5 + 220 + 221 + 222 //********************************************************* + 223 // + 224 //连续读出BH1750内部数据 + 225 // + 226 //********************************************************* + 227 void Multiple_read_BH1750(void) + 228 + 229 { uchar i; + 230 1 BH1750_Start(); //起始信号 + 231 1 BH1750_SendByte(SlaveAddress+1); //发送设备地址+读信号 + 232 1 + 233 1 for (i=0; i<3; i++) //连续读取2个地址数据,存储中BUF + 234 1 { + 235 2 BUF[i] = BH1750_RecvByte(); //BUF[0]存储0x32地址中的数据 + 236 2 if (i == 3) + 237 2 { + 238 3 + 239 3 BH1750_SendACK(1); //最后一个数据需要回NOACK + 240 3 } +C51 COMPILER V9.56.0.0 MAIN 05/05/2022 19:42:13 PAGE 5 - 239 //********************************************************* - 240 void Multiple_read_BH1750(void) - 241 - 242 { uchar i; - 243 1 BH1750_Start(); //ÆðʼÐźŠ- 244 1 BH1750_SendByte(SlaveAddress+1); //·¢ËÍÉ豸µØÖ·+¶ÁÐźŠ- 245 1 - 246 1 for (i=0; i<3; i++) //Á¬Ðø¶ÁÈ¡2¸öµØÖ·Êý¾Ý£¬´æ´¢ÖÐBUF - 247 1 { - 248 2 BUF[i] = BH1750_RecvByte(); //BUF[0]´æ´¢0x32µØÖ·ÖеÄÊý¾Ý - 249 2 if (i == 3) - 250 2 { - 251 3 - 252 3 BH1750_SendACK(1); //×îºóÒ»¸öÊý¾ÝÐèÒª»ØNOACK - 253 3 } - 254 2 else - 255 2 { - 256 3 BH1750_SendACK(0); //»ØÓ¦ACK - 257 3 } - 258 2 } - 259 1 - 260 1 BH1750_Stop(); //Í£Ö¹ÐźŠ- 261 1 Delay5ms(); - 262 1 } - 263 - 264 - 265 //³õʼ»¯BH1750£¬¸ù¾ÝÐèÒªÇë²Î¿¼pdf½øÐÐÐÞ¸Ä**** - 266 void Init_BH1750() - 267 { - 268 1 Single_Write_BH1750(0x01); - 269 1 + 241 2 else + 242 2 { + 243 3 BH1750_SendACK(0); //回应ACK + 244 3 } + 245 2 } + 246 1 + 247 1 BH1750_Stop(); //停止信号 + 248 1 Delay5ms(); + 249 1 } + 250 + 251 + 252 //初始化BH1750 + 253 void Init_BH1750() + 254 { + 255 1 Single_Write_BH1750(0x01); + 256 1 + 257 1 } + 258 + 259 // 串口初始化 + 260 void Uart_Init() + 261 { + 262 1 TMOD = 0x20 | 0x01; + 263 1 SCON = 0x50; + 264 1 TH1 = 0xFD; + 265 1 TL1 = TH1; + 266 1 PCON = 0x00; + 267 1 EA = 1; + 268 1 ES = 1; + 269 1 TR1 = 1; 270 1 } 271 - 272 void Uart_Init() + 272 void us_delay(uchar t) 273 { - 274 1 TMOD = 0x20 | 0x01; - 275 1 SCON = 0x50; - 276 1 TH1 = 0xFD; - 277 1 TL1 = TH1; - 278 1 PCON = 0x00; - 279 1 EA = 1; - 280 1 ES = 1; - 281 1 TR1 = 1; - 282 1 } - 283 - 284 void us_delay(uchar t) - 285 { - 286 1 while(t--); - 287 1 } - 288 - 289 void Send_Uart(uchar value) - 290 { - 291 1 ES=0; - 292 1 TI=0; - 293 1 SBUF=value; - 294 1 while(TI==0); - 295 1 TI=0; - 296 1 ES=1; - 297 1 } - 298 - 299 void Bluetooth_Set(uchar *puf) - 300 { -C51 COMPILER V9.56.0.0 MAIN 05/01/2022 13:19:20 PAGE 6 + 274 1 while(t--); + 275 1 } + 276 + 277 void Send_Uart(uchar value) + 278 { + 279 1 ES=0; + 280 1 TI=0; + 281 1 SBUF=value; + 282 1 while(TI==0); + 283 1 TI=0; + 284 1 ES=1; + 285 1 } + 286 + 287 void Bluetooth_Set(uchar *puf) + 288 { + 289 1 while(*puf!='\0') + 290 1 { + 291 2 Send_Uart(*puf); + 292 2 us_delay(5); + 293 2 puf++; + 294 2 } + 295 1 } + 296 + 297 + 298 // 获取数据 + 299 void Detection() + 300 { + 301 1 static int num = 0; + 302 1 int i = 0; +C51 COMPILER V9.56.0.0 MAIN 05/05/2022 19:42:13 PAGE 6 - 301 1 while(*puf!='\0') - 302 1 { - 303 2 Send_Uart(*puf); - 304 2 us_delay(5); - 305 2 puf++; - 306 2 } - 307 1 } - 308 - 309 void Detection() - 310 { - 311 1 static int num = 0; - 312 1 int i = 0; - 313 1 Single_Write_BH1750(0x01); - 314 1 Single_Write_BH1750(0x10); - 315 1 delay_nms(180); - 316 1 Multiple_Read_BH1750(); - 317 1 dis_data=BUF[0]; - 318 1 dis_data=(dis_data<<8)+BUF[1]; - 319 1 userInfo.Light = (float)dis_data/1.2; - 320 1 - 321 1 userInfo.temp = Temper_change(); - 322 1 userInfo.temp /= 100; - 323 1 if(key1==0) - 324 1 { - 325 2 Delay10ms(); - 326 2 if(key1==0){ - 327 3 if(userInfo.set == 0){ - 328 4 if(userInfo.model == 0) userInfo.model = 1; - 329 4 else userInfo.model = 0; - 330 4 if(userInfo.model == 1) LED4 = 1, LED5 = 0; - 331 4 else LED4 = 0, LED5 = 1; - 332 4 } - 333 3 } - 334 2 while((i<50)&&(key1==0)){ - 335 3 Delay10ms(); - 336 3 i++; - 337 3 } - 338 2 i=0; - 339 2 } - 340 1 - 341 1 if(key2==0) - 342 1 { - 343 2 Delay10ms(); - 344 2 if(key2==0){ - 345 3 if(userInfo.model){ - 346 4 led_num++; - 347 4 if(led_num >= 5) led_num = 0; - 348 4 }else{ - 349 4 if(userInfo.set == 0) userInfo.set = 1; - 350 4 else userInfo.set = 0; - 351 4 cut = 0; - 352 4 } - 353 3 LcdWriteCom(0x01); //清屏 - 354 3 } - 355 2 while((i<50)&&(key2==0)){ - 356 3 Delay10ms(); - 357 3 i++; - 358 3 } - 359 2 i=0; - 360 2 } - 361 1 - 362 1 if(IN==0) -C51 COMPILER V9.56.0.0 MAIN 05/01/2022 13:19:20 PAGE 7 + 303 1 Single_Write_BH1750(0x01); + 304 1 Single_Write_BH1750(0x10); + 305 1 delay_nms(180); + 306 1 Multiple_Read_BH1750(); + 307 1 dis_data=BUF[0]; + 308 1 dis_data=(dis_data<<8)+BUF[1]; + 309 1 userInfo.Light = (float)dis_data/1.2; // 获取光照值 + 310 1 + 311 1 userInfo.temp = Temper_change(); + 312 1 userInfo.temp /= 100; // 获取温度,去除小数部分 + 313 1 + 314 1 // 按键一 + 315 1 if(key1==0) + 316 1 { + 317 2 Delay10ms(); + 318 2 if(key1==0){ + 319 3 if(userInfo.set == 0){ + 320 4 if(userInfo.model == 0) userInfo.model = 1; + 321 4 else userInfo.model = 0; + 322 4 if(userInfo.model == 1) LED4 = 1, LED5 = 0; + 323 4 else LED4 = 0, LED5 = 1; + 324 4 } + 325 3 } + 326 2 while((i<50)&&(key1==0)){ + 327 3 Delay10ms(); + 328 3 i++; + 329 3 } + 330 2 i=0; + 331 2 } + 332 1 + 333 1 // 按键二 + 334 1 if(key2==0) + 335 1 { + 336 2 Delay10ms(); + 337 2 if(key2==0){ + 338 3 if(userInfo.model){ + 339 4 led_num++; + 340 4 if(led_num >= 5) led_num = 0; + 341 4 }else{ + 342 4 if(userInfo.set == 0) userInfo.set = 1; + 343 4 else userInfo.set = 0; + 344 4 cut = 0; + 345 4 } + 346 3 LcdWriteCom(0x01); //清屏 + 347 3 } + 348 2 while((i<50)&&(key2==0)){ + 349 3 Delay10ms(); + 350 3 i++; + 351 3 } + 352 2 i=0; + 353 2 } + 354 1 + 355 1 if(IN==0) // 光电门 进 + 356 1 { + 357 2 Delay10ms(); + 358 2 if(IN==0){ // 去抖 + 359 3 userInfo.num++; + 360 3 if(userInfo.num > 99) userInfo.num = 99; + 361 3 } + 362 2 while((i<50)&&(IN==0)){ + 363 3 Delay10ms(); + 364 3 i++; +C51 COMPILER V9.56.0.0 MAIN 05/05/2022 19:42:13 PAGE 7 - 363 1 { - 364 2 Delay10ms(); - 365 2 if(IN==0){ - 366 3 userInfo.num++; - 367 3 if(userInfo.num > 99) userInfo.num = 99; - 368 3 } - 369 2 while((i<50)&&(IN==0)){ - 370 3 Delay10ms(); - 371 3 i++; - 372 3 } - 373 2 i=0; - 374 2 } - 375 1 - 376 1 if(OUT==0) //��ⰴ��K1�Ƿ��� - 377 1 { - 378 2 Delay10ms(); //�������� - 379 2 if(OUT==0){ - 380 3 userInfo.num--; - 381 3 if(userInfo.num < 0) userInfo.num = 0; - 382 3 } - 383 2 while((i<50)&&(OUT==0)){ - 384 3 Delay10ms(); - 385 3 i++; - 386 3 } - 387 2 i=0; - 388 2 } - 389 1 - 390 1 if(key3==0) //��ⰴ��K1�Ƿ��� - 391 1 { - 392 2 Delay10ms(); //�������� - 393 2 if(key3==0){ - 394 3 cut++; - 395 3 if(cut >= 4) cut = 0; - 396 3 } - 397 2 while((i<50)&&(key3==0)){ - 398 3 Delay10ms(); - 399 3 i++; - 400 3 } - 401 2 i=0; - 402 2 } - 403 1 - 404 1 if(key4==0) //��ⰴ��K1�Ƿ��� - 405 1 { - 406 2 Delay10ms(); //�������� - 407 2 if(key4==0){ - 408 3 if(cut == 0){ - 409 4 userInfo.time[0].hour++; - 410 4 if(userInfo.time[0].hour >= 24) userInfo.time[0].hour = 0; - 411 4 }else if(cut == 1){ - 412 4 userInfo.time[0].min++; - 413 4 if(userInfo.time[0].min >= 59) userInfo.time[0].min = 0; - 414 4 }else if(cut == 2){ - 415 4 userInfo.time[1].hour++; - 416 4 if(userInfo.time[1].hour >= 24) userInfo.time[1].hour = 0; - 417 4 }else if(cut == 3){ - 418 4 userInfo.time[1].min++; - 419 4 if(userInfo.time[1].min >= 59) userInfo.time[1].min = 0; - 420 4 } - 421 3 while((i<50)&&(key4==0)){ - 422 4 Delay10ms(); - 423 4 i++; - 424 4 } -C51 COMPILER V9.56.0.0 MAIN 05/01/2022 13:19:20 PAGE 8 + 365 3 } + 366 2 i=0; + 367 2 } + 368 1 + 369 1 + 370 1 if(OUT==0) // 光电门 出 + 371 1 { + 372 2 Delay10ms(); + 373 2 if(OUT==0){ // 去抖 + 374 3 userInfo.num--; + 375 3 if(userInfo.num < 0) userInfo.num = 0; + 376 3 } + 377 2 while((i<50)&&(OUT==0)){ + 378 3 Delay10ms(); + 379 3 i++; + 380 3 } + 381 2 i=0; + 382 2 } + 383 1 + 384 1 + 385 1 if(key3==0) // 按键3 + 386 1 { + 387 2 Delay10ms(); + 388 2 if(key3==0){ + 389 3 cut++; + 390 3 if(cut >= 4) cut = 0; // 切换修改的对象 + 391 3 } + 392 2 while((i<50)&&(key3==0)){ + 393 3 Delay10ms(); + 394 3 i++; + 395 3 } + 396 2 i=0; + 397 2 } + 398 1 + 399 1 // 按键四 + 400 1 if(key4==0) + 401 1 { + 402 2 Delay10ms(); + 403 2 if(key4==0){ + 404 3 // 根据cut的值,修改不同的对象 + 405 3 if(cut == 0){ + 406 4 userInfo.time[0].hour++; + 407 4 if(userInfo.time[0].hour >= 24) userInfo.time[0].hour = 0; + 408 4 }else if(cut == 1){ + 409 4 userInfo.time[0].min++; + 410 4 if(userInfo.time[0].min >= 59) userInfo.time[0].min = 0; + 411 4 }else if(cut == 2){ + 412 4 userInfo.time[1].hour++; + 413 4 if(userInfo.time[1].hour >= 24) userInfo.time[1].hour = 0; + 414 4 }else if(cut == 3){ + 415 4 userInfo.time[1].min++; + 416 4 if(userInfo.time[1].min >= 59) userInfo.time[1].min = 0; + 417 4 } + 418 3 while((i<50)&&(key4==0)){ + 419 4 Delay10ms(); + 420 4 i++; + 421 4 } + 422 3 i=0; + 423 3 } + 424 2 } + 425 1 } +*** WARNING C280 IN LINE 301 OF main.c: 'num': unreferenced local variable +C51 COMPILER V9.56.0.0 MAIN 05/05/2022 19:42:13 PAGE 8 - 425 3 i=0; - 426 3 } - 427 2 } - 428 1 } -*** WARNING C280 IN LINE 311 OF main.c: 'num': unreferenced local variable - 429 - 430 - 431 int getTimeResult() - 432 { - 433 1 int result = 1; - 434 1 struct Time Nowtime; - 435 1 - 436 1 Nowtime.hour = TIME[2]/16 * 10 + (TIME[2]&0x0f); - 437 1 Nowtime.min = TIME[1]/16 * 10 + (TIME[1]&0x0f); - 438 1 - 439 1 if(Nowtime.hour < userInfo.time[0].hour || Nowtime.hour > userInfo.time[1].hour) return 0; - 440 1 if(Nowtime.hour == userInfo.time[0].hour && Nowtime.min < userInfo.time[0].min) return 0; - 441 1 if(Nowtime.hour == userInfo.time[1].hour && Nowtime.min > userInfo.time[1].min) return 0; - 442 1 - 443 1 return result; - 444 1 } - 445 - 446 - 447 void Dispose() - 448 { - 449 1 - 450 1 if(userInfo.model == 0){ - 451 2 if(getTimeResult() && userInfo.Light < 100){ - 452 3 if(userInfo.num < 10 && userInfo.num > 0) LED0 = 0, LED1 = 0, LED2 = 0 ,LED3 = 1; - 453 3 else if(userInfo.num >= 10 && userInfo.num < 20) LED0 = 0, LED1 = 0, LED2 = 1 ,LED3 = 1; - 454 3 else if(userInfo.num >= 20 && userInfo.num < 30) LED0 = 0, LED1 = 1, LED2 = 1 ,LED3 = 1; - 455 3 else if(userInfo.num >= 30) LED0 = 1, LED1 = 1, LED2 = 1 ,LED3 = 1; - 456 3 else LED0 = 0, LED1 = 0, LED2 = 0 ,LED3 = 0; - 457 3 }else{ - 458 3 LED0 = 0, LED1 = 0, LED2 = 0 ,LED3 = 0; - 459 3 } - 460 2 }else{ - 461 2 if(led_num){ - 462 3 if(led_num == 1) LED0 = 0, LED1 = 0, LED2 = 0 ,LED3 = 1; - 463 3 else if(led_num == 2) LED0 = 0, LED1 = 0, LED2 = 1 ,LED3 = 1; - 464 3 else if(led_num == 3) LED0 = 0, LED1 = 1, LED2 = 1 ,LED3 = 1; - 465 3 else if(led_num == 4) LED0 = 1, LED1 = 1, LED2 = 1 ,LED3 = 1; - 466 3 }else{ - 467 3 LED0 = 0, LED1 = 0, LED2 = 0 ,LED3 = 0; - 468 3 } - 469 2 } - 470 1 LED4 = userInfo.model; - 471 1 } - 472 + 426 + 427 + 428 // 获取时间是否达到 返回1为定时时间到 + 429 int getTimeResult() + 430 { + 431 1 int result = 1; + 432 1 struct Time Nowtime; + 433 1 + 434 1 Nowtime.hour = TIME[2]/16 * 10 + (TIME[2]&0x0f); + 435 1 Nowtime.min = TIME[1]/16 * 10 + (TIME[1]&0x0f); + 436 1 + 437 1 if(Nowtime.hour < userInfo.time[0].hour || Nowtime.hour > userInfo.time[1].hour) return 0; + 438 1 if(Nowtime.hour == userInfo.time[0].hour && Nowtime.min < userInfo.time[0].min) return 0; + 439 1 if(Nowtime.hour == userInfo.time[1].hour && Nowtime.min > userInfo.time[1].min) return 0; + 440 1 + 441 1 return result; + 442 1 } + 443 + 444 + 445 // 点灯 + 446 void Dispose() + 447 { + 448 1 + 449 1 if(userInfo.model == 0){ + 450 2 if(getTimeResult() && userInfo.Light < 100){ + 451 3 if(userInfo.num < 10 && userInfo.num > 0) LED0 = 0, LED1 = 0, LED2 = 0 ,LED3 = 1; + 452 3 else if(userInfo.num >= 10 && userInfo.num < 20) LED0 = 0, LED1 = 0, LED2 = 1 ,LED3 = 1; + 453 3 else if(userInfo.num >= 20 && userInfo.num < 30) LED0 = 0, LED1 = 1, LED2 = 1 ,LED3 = 1; + 454 3 else if(userInfo.num >= 30) LED0 = 1, LED1 = 1, LED2 = 1 ,LED3 = 1; + 455 3 else LED0 = 0, LED1 = 0, LED2 = 0 ,LED3 = 0; + 456 3 }else{ + 457 3 LED0 = 0, LED1 = 0, LED2 = 0 ,LED3 = 0; + 458 3 } + 459 2 }else{ + 460 2 if(led_num){ + 461 3 if(led_num == 1) LED0 = 0, LED1 = 0, LED2 = 0 ,LED3 = 1; + 462 3 else if(led_num == 2) LED0 = 0, LED1 = 0, LED2 = 1 ,LED3 = 1; + 463 3 else if(led_num == 3) LED0 = 0, LED1 = 1, LED2 = 1 ,LED3 = 1; + 464 3 else if(led_num == 4) LED0 = 1, LED1 = 1, LED2 = 1 ,LED3 = 1; + 465 3 }else{ + 466 3 LED0 = 0, LED1 = 0, LED2 = 0 ,LED3 = 0; + 467 3 } + 468 2 } + 469 1 LED4 = userInfo.model; + 470 1 } + 471 + 472 // main 473 void main() 474 { 475 1 int i = 0; 476 1 uchar str[10]; - 477 1 Ds1302Init(); + 477 1 Ds1302Init(); // 时钟初始化 478 1 Uart_Init(); - 479 1 LcdInit(); + 479 1 LcdInit(); // lcd初始化 480 1 481 1 userInfo.time[0].hour = 18; 482 1 userInfo.time[0].min = 0; 483 1 userInfo.time[0].sec = 0; 484 1 485 1 userInfo.time[1].hour = 23; -C51 COMPILER V9.56.0.0 MAIN 05/01/2022 13:19:20 PAGE 9 - 486 1 userInfo.time[1].min = 30; 487 1 userInfo.time[1].sec = 0; +C51 COMPILER V9.56.0.0 MAIN 05/05/2022 19:42:13 PAGE 9 + 488 1 489 1 while(1) 490 1 { - 491 2 Ds1302ReadTime(); + 491 2 Ds1302ReadTime(); // 读取时间 492 2 LcdDisplay(); 493 2 Detection(); 494 2 Dispose(); - 495 2 sprintf(str, "%d\r\n", userInfo.temp); - 496 2 Bluetooth_Set(str); - 497 2 } - 498 1 } - 499 - 500 void LcdDisplay() - 501 { - 502 1 uint temp_data; - 503 1 if(userInfo.set == 0){ - 504 2 // TODO 显示时间 - 505 2 LcdWriteCom(0x80); - 506 2 LcdWriteData('0'+TIME[4]/16); //月 - 507 2 LcdWriteData('0'+(TIME[4]&0x0f)); - 508 2 LcdWriteData('-'); - 509 2 LcdWriteData('0'+TIME[3]/16); //日 - 510 2 LcdWriteData('0'+(TIME[3]&0x0f)); - 511 2 LcdWriteData(' '); - 512 2 - 513 2 LcdWriteData('0'+TIME[2]/16); //时 - 514 2 LcdWriteData('0'+(TIME[2]&0x0f)); - 515 2 LcdWriteData(':'); - 516 2 LcdWriteData('0'+TIME[1]/16); //分 - 517 2 LcdWriteData('0'+(TIME[1]&0x0f)); - 518 2 LcdWriteData(':'); - 519 2 LcdWriteData('0'+TIME[0]/16); //秒 - 520 2 LcdWriteData('0'+(TIME[0]&0x0f)); - 521 2 - 522 2 LcdWriteData(' '); - 523 2 LcdWriteData('0'+(TIME[5]&0x0f)); - 524 2 - 525 2 LcdWriteCom(0x80 + 0x40); - 526 2 temp_data = userInfo.Light; - 527 2 temp_data=temp_data%10000; - 528 2 LcdWriteData(temp_data/1000+0x30); - 529 2 temp_data=temp_data%1000; - 530 2 LcdWriteData(temp_data/100+0x30); - 531 2 temp_data=temp_data%100; - 532 2 LcdWriteData(temp_data/10+0x30); - 533 2 temp_data=temp_data%10; - 534 2 LcdWriteData(temp_data+0x30); - 535 2 LcdWriteData('L'); - 536 2 LcdWriteData('x'); - 537 2 LcdWriteData(' '); - 538 2 LcdWriteData(userInfo.temp / 10 + 0x30); - 539 2 LcdWriteData(userInfo.temp % 10 + 0x30); - 540 2 LcdWriteData('C'); - 541 2 - 542 2 LcdWriteData(' '); - 543 2 LcdWriteData(userInfo.num / 10 % 10 + 0x30); - 544 2 LcdWriteData(userInfo.num % 10 + 0x30); - 545 2 }else{ - 546 2 LcdWriteCom(0x80); - 547 2 LcdWriteData('0'+ userInfo.time[0].hour/10); //时 -C51 COMPILER V9.56.0.0 MAIN 05/01/2022 13:19:20 PAGE 10 + 495 2 } + 496 1 } +*** WARNING C280 IN LINE 476 OF main.c: 'str': unreferenced local variable + 497 + 498 // 显示 + 499 void LcdDisplay() + 500 { + 501 1 uint temp_data; + 502 1 if(userInfo.set == 0){ + 503 2 // TODO 显示时间 + 504 2 LcdWriteCom(0x80); + 505 2 LcdWriteData('0'+TIME[4]/16); //月 + 506 2 LcdWriteData('0'+(TIME[4]&0x0f)); + 507 2 LcdWriteData('-'); + 508 2 LcdWriteData('0'+TIME[3]/16); //日 + 509 2 LcdWriteData('0'+(TIME[3]&0x0f)); + 510 2 LcdWriteData(' '); + 511 2 + 512 2 LcdWriteData('0'+TIME[2]/16); //时 + 513 2 LcdWriteData('0'+(TIME[2]&0x0f)); + 514 2 LcdWriteData(':'); + 515 2 LcdWriteData('0'+TIME[1]/16); //分 + 516 2 LcdWriteData('0'+(TIME[1]&0x0f)); + 517 2 LcdWriteData(':'); + 518 2 LcdWriteData('0'+TIME[0]/16); //秒 + 519 2 LcdWriteData('0'+(TIME[0]&0x0f)); + 520 2 + 521 2 LcdWriteData(' '); + 522 2 LcdWriteData('0'+(TIME[5]&0x0f)); + 523 2 + 524 2 LcdWriteCom(0x80 + 0x40); + 525 2 temp_data = userInfo.Light; + 526 2 temp_data=temp_data%10000; + 527 2 LcdWriteData(temp_data/1000+0x30); + 528 2 temp_data=temp_data%1000; + 529 2 LcdWriteData(temp_data/100+0x30); + 530 2 temp_data=temp_data%100; + 531 2 LcdWriteData(temp_data/10+0x30); + 532 2 temp_data=temp_data%10; + 533 2 LcdWriteData(temp_data+0x30); + 534 2 LcdWriteData('L'); + 535 2 LcdWriteData('x'); + 536 2 LcdWriteData(' '); + 537 2 LcdWriteData(userInfo.temp / 10 + 0x30); + 538 2 LcdWriteData(userInfo.temp % 10 + 0x30); + 539 2 LcdWriteData('C'); + 540 2 + 541 2 LcdWriteData(' '); + 542 2 LcdWriteData(userInfo.num / 10 % 10 + 0x30); + 543 2 LcdWriteData(userInfo.num % 10 + 0x30); + 544 2 }else{ + 545 2 LcdWriteCom(0x80); + 546 2 LcdWriteData('0'+ userInfo.time[0].hour/10); //时 + 547 2 LcdWriteData('0'+ userInfo.time[0].hour% 10); + 548 2 LcdWriteData(':'); +C51 COMPILER V9.56.0.0 MAIN 05/05/2022 19:42:13 PAGE 10 - 548 2 LcdWriteData('0'+ userInfo.time[0].hour% 10); - 549 2 LcdWriteData(':'); - 550 2 LcdWriteData('0'+userInfo.time[0].min/10); //分 - 551 2 LcdWriteData('0'+ userInfo.time[0].min % 10); - 552 2 LcdWriteData(':'); - 553 2 LcdWriteData('0'+userInfo.time[0].sec / 10); //秒 - 554 2 LcdWriteData('0'+userInfo.time[0].sec % 10); - 555 2 LcdWriteData(' '); - 556 2 - 557 2 LcdWriteData('0'+cut); - 558 2 - 559 2 LcdWriteCom(0x80 + 0x40); - 560 2 LcdWriteData('0'+ userInfo.time[1].hour/10); //时 - 561 2 LcdWriteData('0'+ userInfo.time[1].hour% 10); - 562 2 LcdWriteData(':'); - 563 2 LcdWriteData('0'+userInfo.time[1].min/10); //分 - 564 2 LcdWriteData('0'+ userInfo.time[1].min % 10); - 565 2 LcdWriteData(':'); - 566 2 LcdWriteData('0'+userInfo.time[1].sec / 10); //秒 - 567 2 LcdWriteData('0'+userInfo.time[1].sec % 10); - 568 2 } - 569 1 } + 549 2 LcdWriteData('0'+userInfo.time[0].min/10); //分 + 550 2 LcdWriteData('0'+ userInfo.time[0].min % 10); + 551 2 LcdWriteData(':'); + 552 2 LcdWriteData('0'+userInfo.time[0].sec / 10); //秒 + 553 2 LcdWriteData('0'+userInfo.time[0].sec % 10); + 554 2 LcdWriteData(' '); + 555 2 + 556 2 LcdWriteData('0'+cut); + 557 2 + 558 2 LcdWriteCom(0x80 + 0x40); + 559 2 LcdWriteData('0'+ userInfo.time[1].hour/10); //时 + 560 2 LcdWriteData('0'+ userInfo.time[1].hour% 10); + 561 2 LcdWriteData(':'); + 562 2 LcdWriteData('0'+userInfo.time[1].min/10); //分 + 563 2 LcdWriteData('0'+ userInfo.time[1].min % 10); + 564 2 LcdWriteData(':'); + 565 2 LcdWriteData('0'+userInfo.time[1].sec / 10); //秒 + 566 2 LcdWriteData('0'+userInfo.time[1].sec % 10); + 567 2 } + 568 1 } + 569 570 - 571 - 572 void Delay10ms(void) //��� 0us - 573 { - 574 1 unsigned char a,b,c; - 575 1 for(c=1;c>0;c--) - 576 1 for(b=38;b>0;b--) - 577 1 for(a=130;a>0;a--); - 578 1 } + 571 void Delay10ms(void) //��� 0us + 572 { + 573 1 unsigned char a,b,c; + 574 1 for(c=1;c>0;c--) + 575 1 for(b=38;b>0;b--) + 576 1 for(a=130;a>0;a--); + 577 1 } MODULE INFORMATION: STATIC OVERLAYABLE - CODE SIZE = 2082 ---- - CONSTANT SIZE = 5 ---- + CODE SIZE = 2049 ---- + CONSTANT SIZE = ---- ---- XDATA SIZE = ---- ---- PDATA SIZE = ---- ---- DATA SIZE = 42 22 @@ -620,4 +618,4 @@ MODULE INFORMATION: STATIC OVERLAYABLE END OF MODULE INFORMATION. -C51 COMPILATION COMPLETE. 1 WARNING(S), 0 ERROR(S) +C51 COMPILATION COMPLETE. 2 WARNING(S), 0 ERROR(S) diff --git a/main.OBJ b/main.OBJ index 53c78a3..ad4fd61 100644 Binary files a/main.OBJ and b/main.OBJ differ diff --git a/main.c b/main.c index d0a8b15..71971f5 100644 --- a/main.c +++ b/main.c @@ -58,13 +58,13 @@ void LcdDisplay(); void LcdDisplay1(); void Delay10ms(void); -#define SlaveAddress 0x46 //¶¨ÒåÆ÷¼þÔÚIIC×ÜÏßÖеĴӵØÖ·,¸ù¾ÝALT ADDRESSµØÖ·Òý½Å²»Í¬ÐÞ¸Ä - //ALT ADDRESSÒý½Å½ÓµØʱµØַΪ0x46£¬½ÓµçԴʱµØַΪ0xB8 +#define SlaveAddress 0x46 //定义器件在IIC总线中的从地址,根据ALT ADDRESS地址引脚不同修改 + //ALT ADDRESS引脚接地时地址为0x46,接电源时地址为0xB8 typedef unsigned char BYTE; typedef unsigned short WORD; -BYTE BUF[8]; //½ÓÊÕÊý¾Ý»º´æÇø -int dis_data; //±äÁ¿ +BYTE BUF[8]; //接收数据缓存区 +int dis_data; //变量 void delay_nms(unsigned int k); void InitLcd(); @@ -75,21 +75,21 @@ void WriteCommandLCM(uchar CMD,uchar Attribc); void DisplayOneChar(uchar X,uchar Y,uchar DData); void conversion(uint temp_data); -void Single_Write_BH1750(uchar REG_Address); //µ¥¸öдÈëÊý¾Ý -uchar Single_Read_BH1750(uchar REG_Address); //µ¥¸ö¶ÁÈ¡ÄÚ²¿¼Ä´æÆ÷Êý¾Ý -void Multiple_Read_BH1750(); //Á¬ÐøµÄ¶ÁÈ¡ÄÚ²¿¼Ä´æÆ÷Êý¾Ý +void Single_Write_BH1750(uchar REG_Address); //单个写入数据 +uchar Single_Read_BH1750(uchar REG_Address); //单个读取内部寄存器数据 +void Multiple_Read_BH1750(); //连续的读取内部寄存器数据 //------------------------------------ void Delay5us(); void Delay5ms(); -void BH1750_Start(); //ÆðʼÐźŠ-void BH1750_Stop(); //Í£Ö¹ÐźŠ-void BH1750_SendACK(bit ack); //Ó¦´ðACK -bit BH1750_RecvACK(); //¶Áack -void BH1750_SendByte(BYTE dat); //IICµ¥¸ö×Ö½Úд -BYTE BH1750_RecvByte(); //IICµ¥¸ö×Ö½Ú¶Á +void BH1750_Start(); //起始信号 +void BH1750_Stop(); //停止信号 +void BH1750_SendACK(bit ack); //应答ACK +bit BH1750_RecvACK(); //读ack +void BH1750_SendByte(BYTE dat); //IIC单个字节写 +BYTE BH1750_RecvByte(); //IIC单个字节读 -//ºÁÃëÑÓʱ************************** +//毫秒延时************************** void delay_nms(unsigned int k) { unsigned int i,j; @@ -115,93 +115,93 @@ void Delay5ms() } /************************************** -ÆðʼÐźŠ+起始信号 **************************************/ void BH1750_Start() { - SDA1 = 1; //À¸ßÊý¾ÝÏß - SCL1 = 1; //À¸ßʱÖÓÏß - Delay5us(); //ÑÓʱ - SDA1 = 0; //²úÉúϽµÑØ - Delay5us(); //ÑÓʱ - SCL1 = 0; //ÀµÍʱÖÓÏß + SDA1 = 1; //拉高数据线 + SCL1 = 1; //拉高时钟线 + Delay5us(); //延时 + SDA1 = 0; //产生下降沿 + Delay5us(); //延时 + SCL1 = 0; //拉低时钟线 } /************************************** -Í£Ö¹ÐźŠ+停止信号 **************************************/ void BH1750_Stop() { - SDA1 = 0; //ÀµÍÊý¾ÝÏß - SCL1 = 1; //À¸ßʱÖÓÏß - Delay5us(); //ÑÓʱ - SDA1 = 1; //²úÉúÉÏÉýÑØ - Delay5us(); //ÑÓʱ + SDA1 = 0; //拉低数据线 + SCL1 = 1; //拉高时钟线 + Delay5us(); //延时 + SDA1 = 1; //产生上升沿 + Delay5us(); //延时 } /************************************** -·¢ËÍÓ¦´ðÐźŠ-Èë¿Ú²ÎÊý:ack (0:ACK 1:NAK) +发送应答信号 +入口参数:ack (0:ACK 1:NAK) **************************************/ void BH1750_SendACK(bit ack) { - SDA1 = ack; //дӦ´ðÐźŠ- SCL1 = 1; //À¸ßʱÖÓÏß - Delay5us(); //ÑÓʱ - SCL1 = 0; //ÀµÍʱÖÓÏß - Delay5us(); //ÑÓʱ + SDA = ack; //写应答信号 + SCL = 1; //拉高时钟线 + Delay5us(); //延时 + SCL = 0; //拉低时钟线 + Delay5us(); //延时 } /************************************** -½ÓÊÕÓ¦´ðÐźŠ+接收应答信号 **************************************/ bit BH1750_RecvACK() { - SCL1 = 1; //À¸ßʱÖÓÏß - Delay5us(); //ÑÓʱ - CY = SDA1; //¶ÁÓ¦´ðÐźŠ- SCL1 = 0; //ÀµÍʱÖÓÏß - Delay5us(); //ÑÓʱ + SCL = 1; //拉高时钟线 + Delay5us(); //延时 + CY = SDA; //读应答信号 + SCL = 0; //拉低时钟线 + Delay5us(); //延时 return CY; } /************************************** -ÏòIIC×ÜÏß·¢ËÍÒ»¸ö×Ö½ÚÊý¾Ý +向IIC总线发送一个字节数据 **************************************/ void BH1750_SendByte(BYTE dat) { BYTE i; - for (i=0; i<8; i++) //8λ¼ÆÊýÆ÷ + for (i=0; i<8; i++) //8位计数器 { - dat <<= 1; //ÒƳöÊý¾ÝµÄ×î¸ßλ - SDA1 = CY; //ËÍÊý¾Ý¿Ú - SCL1 = 1; //À¸ßʱÖÓÏß - Delay5us(); //ÑÓʱ - SCL1 = 0; //ÀµÍʱÖÓÏß - Delay5us(); //ÑÓʱ + dat <<= 1; //移出数据的最高位 + SDA = CY; //送数据口 + SCL = 1; //拉高时钟线 + Delay5us(); //延时 + SCL = 0; //拉低时钟线 + Delay5us(); //延时 } BH1750_RecvACK(); } /************************************** -´ÓIIC×ÜÏß½ÓÊÕÒ»¸ö×Ö½ÚÊý¾Ý +从IIC总线接收一个字节数据 **************************************/ BYTE BH1750_RecvByte() { BYTE i; BYTE dat = 0; - SDA1 = 1; //ʹÄÜÄÚ²¿ÉÏÀ,×¼±¸¶ÁÈ¡Êý¾Ý, - for (i=0; i<8; i++) //8λ¼ÆÊýÆ÷ + SDA = 1; //使能内部上拉,准备读取数据, + for (i=0; i<8; i++) //8位计数器 { dat <<= 1; - SCL1 = 1; //À¸ßʱÖÓÏß - Delay5us(); //ÑÓʱ - dat |= SDA1; //¶ÁÊý¾Ý - SCL1 = 0; //ÀµÍʱÖÓÏß - Delay5us(); //ÑÓʱ + SCL = 1; //拉高时钟线 + Delay5us(); //延时 + dat |= SDA; //读数据 + SCL = 0; //拉低时钟线 + Delay5us(); //延时 } return dat; } @@ -210,65 +210,53 @@ BYTE BH1750_RecvByte() void Single_Write_BH1750(uchar REG_Address) { - BH1750_Start(); //ÆðʼÐźŠ- BH1750_SendByte(SlaveAddress); //·¢ËÍÉ豸µØÖ·+дÐźŠ- BH1750_SendByte(REG_Address); //ÄÚ²¿¼Ä´æÆ÷µØÖ·£¬ - // BH1750_SendByte(REG_data); //ÄÚ²¿¼Ä´æÆ÷Êý¾Ý£¬ - BH1750_Stop(); //·¢ËÍÍ£Ö¹ÐźŠ+ BH1750_Start(); //起始信号 + BH1750_SendByte(SlaveAddress); //发送设备地址+写信号 + BH1750_SendByte(REG_Address); //内部寄存器地址, + // BH1750_SendByte(REG_data); //内部寄存器数据, + BH1750_Stop(); //发送停止信号 } -//********µ¥×Ö½Ú¶ÁÈ¡***************************************** -/* -uchar Single_Read_BH1750(uchar REG_Address) -{ uchar REG_data; - BH1750_Start(); //ÆðʼÐźŠ- BH1750_SendByte(SlaveAddress); //·¢ËÍÉ豸µØÖ·+дÐźŠ- BH1750_SendByte(REG_Address); //·¢ËÍ´æ´¢µ¥ÔªµØÖ·£¬´Ó0¿ªÊ¼ - BH1750_Start(); //ÆðʼÐźŠ- BH1750_SendByte(SlaveAddress+1); //·¢ËÍÉ豸µØÖ·+¶ÁÐźŠ- REG_data=BH1750_RecvByte(); //¶Á³ö¼Ä´æÆ÷Êý¾Ý - BH1750_SendACK(1); - BH1750_Stop(); //Í£Ö¹ÐźŠ- return REG_data; -} -*/ + + //********************************************************* // -//Á¬Ðø¶Á³öBH1750ÄÚ²¿Êý¾Ý +//连续读出BH1750内部数据 // //********************************************************* void Multiple_read_BH1750(void) { uchar i; - BH1750_Start(); //ÆðʼÐźŠ- BH1750_SendByte(SlaveAddress+1); //·¢ËÍÉ豸µØÖ·+¶ÁÐźŠ+ BH1750_Start(); //起始信号 + BH1750_SendByte(SlaveAddress+1); //发送设备地址+读信号 - for (i=0; i<3; i++) //Á¬Ðø¶ÁÈ¡2¸öµØÖ·Êý¾Ý£¬´æ´¢ÖÐBUF + for (i=0; i<3; i++) //连续读取2个地址数据,存储中BUF { - BUF[i] = BH1750_RecvByte(); //BUF[0]´æ´¢0x32µØÖ·ÖеÄÊý¾Ý + BUF[i] = BH1750_RecvByte(); //BUF[0]存储0x32地址中的数据 if (i == 3) { - BH1750_SendACK(1); //×îºóÒ»¸öÊý¾ÝÐèÒª»ØNOACK + BH1750_SendACK(1); //最后一个数据需要回NOACK } else { - BH1750_SendACK(0); //»ØÓ¦ACK + BH1750_SendACK(0); //回应ACK } } - BH1750_Stop(); //Í£Ö¹ÐźŠ+ BH1750_Stop(); //停止信号 Delay5ms(); } -//³õʼ»¯BH1750£¬¸ù¾ÝÐèÒªÇë²Î¿¼pdf½øÐÐÐÞ¸Ä**** +//初始化BH1750 void Init_BH1750() { Single_Write_BH1750(0x01); } +// 串口初始化 void Uart_Init() { TMOD = 0x20 | 0x01; @@ -306,6 +294,8 @@ void Bluetooth_Set(uchar *puf) } } + +// 获取数据 void Detection() { static int num = 0; @@ -316,10 +306,12 @@ void Detection() Multiple_Read_BH1750(); dis_data=BUF[0]; dis_data=(dis_data<<8)+BUF[1]; - userInfo.Light = (float)dis_data/1.2; + userInfo.Light = (float)dis_data/1.2; // 获取光照值 userInfo.temp = Temper_change(); - userInfo.temp /= 100; + userInfo.temp /= 100; // 获取温度,去除小数部分 + + // 按键一 if(key1==0) { Delay10ms(); @@ -338,6 +330,7 @@ void Detection() i=0; } + // 按键二 if(key2==0) { Delay10ms(); @@ -359,10 +352,10 @@ void Detection() i=0; } - if(IN==0) + if(IN==0) // 光电门 进 { - Delay10ms(); - if(IN==0){ + Delay10ms(); + if(IN==0){ // 去抖 userInfo.num++; if(userInfo.num > 99) userInfo.num = 99; } @@ -373,10 +366,11 @@ void Detection() i=0; } - if(OUT==0) //��ⰴ��K1�Ƿ��� + + if(OUT==0) // 光电门 出 { - Delay10ms(); //�������� - if(OUT==0){ + Delay10ms(); + if(OUT==0){ // 去抖 userInfo.num--; if(userInfo.num < 0) userInfo.num = 0; } @@ -387,12 +381,13 @@ void Detection() i=0; } - if(key3==0) //��ⰴ��K1�Ƿ��� + + if(key3==0) // 按键3 { - Delay10ms(); //�������� + Delay10ms(); if(key3==0){ cut++; - if(cut >= 4) cut = 0; + if(cut >= 4) cut = 0; // 切换修改的对象 } while((i<50)&&(key3==0)){ Delay10ms(); @@ -401,10 +396,12 @@ void Detection() i=0; } - if(key4==0) //��ⰴ��K1�Ƿ��� + // 按键四 + if(key4==0) { - Delay10ms(); //�������� + Delay10ms(); if(key4==0){ + // 根据cut的值,修改不同的对象 if(cut == 0){ userInfo.time[0].hour++; if(userInfo.time[0].hour >= 24) userInfo.time[0].hour = 0; @@ -418,16 +415,17 @@ void Detection() userInfo.time[1].min++; if(userInfo.time[1].min >= 59) userInfo.time[1].min = 0; } - while((i<50)&&(key4==0)){ - Delay10ms(); - i++; - } - i=0; - } + while((i<50)&&(key4==0)){ + Delay10ms(); + i++; + } + i=0; + } } } +// 获取时间是否达到 返回1为定时时间到 int getTimeResult() { int result = 1; @@ -444,6 +442,7 @@ int getTimeResult() } +// 点灯 void Dispose() { @@ -470,13 +469,14 @@ void Dispose() LED4 = userInfo.model; } +// main void main() { int i = 0; uchar str[10]; - Ds1302Init(); + Ds1302Init(); // 时钟初始化 Uart_Init(); - LcdInit(); + LcdInit(); // lcd初始化 userInfo.time[0].hour = 18; userInfo.time[0].min = 0; @@ -488,15 +488,14 @@ void main() while(1) { - Ds1302ReadTime(); + Ds1302ReadTime(); // 读取时间 LcdDisplay(); Detection(); Dispose(); - sprintf(str, "%d\r\n", userInfo.temp); - Bluetooth_Set(str); } } +// 显示 void LcdDisplay() { uint temp_data; diff --git a/pro b/pro index 6ca440f..593fbb0 100644 Binary files a/pro and b/pro differ diff --git a/pro.M51 b/pro.M51 index ca8e1b1..a6bf139 100644 --- a/pro.M51 +++ b/pro.M51 @@ -1,4 +1,4 @@ -BL51 BANKED LINKER/LOCATER V6.22 05/01/2022 13:48:31 PAGE 1 +BL51 BANKED LINKER/LOCATER V6.22 05/05/2022 19:42:13 PAGE 1 BL51 BANKED LINKER/LOCATER V6.22, INVOKED BY: @@ -20,21 +20,12 @@ INPUT MODULES INCLUDED: D:\KEIL_V5\C51\LIB\C51FPS.LIB (?C?FPCMP) D:\KEIL_V5\C51\LIB\C51FPS.LIB (?C?FCAST) D:\KEIL_V5\C51\LIB\C51FPS.LIB (?C?CASTF) - D:\KEIL_V5\C51\LIB\C51FPS.LIB (PRINTF) D:\KEIL_V5\C51\LIB\C51FPS.LIB (?C?FPGETOPN) - D:\KEIL_V5\C51\LIB\C51FPS.LIB (?C?FPROUND) - D:\KEIL_V5\C51\LIB\C51FPS.LIB (?C?FPCONVERT) - D:\KEIL_V5\C51\LIB\C51FPS.LIB (?C?FTNPWR) D:\KEIL_V5\C51\LIB\C51S.LIB (?C_STARTUP) D:\KEIL_V5\C51\LIB\C51S.LIB (?C?CLDPTR) - D:\KEIL_V5\C51\LIB\C51S.LIB (?C?CLDOPTR) - D:\KEIL_V5\C51\LIB\C51S.LIB (?C?CSTPTR) D:\KEIL_V5\C51\LIB\C51S.LIB (?C?UIDIV) D:\KEIL_V5\C51\LIB\C51S.LIB (?C?SIDIV) D:\KEIL_V5\C51\LIB\C51S.LIB (?C?LNEG) - D:\KEIL_V5\C51\LIB\C51S.LIB (?C?PLDIIDATA) - D:\KEIL_V5\C51\LIB\C51S.LIB (?C?CCASE) - D:\KEIL_V5\C51\LIB\C51S.LIB (PUTCHAR) D:\KEIL_V5\C51\LIB\C51S.LIB (?C_INIT) @@ -46,69 +37,66 @@ LINK MAP OF MODULE: pro (MAIN) * * * * * * * D A T A M E M O R Y * * * * * * * REG 0000H 0008H ABSOLUTE "REG BANK 0" - DATA 0008H 0007H UNIT ?DT?DS1302 - 000FH 0011H *** GAP *** - BIT 0020H.0 0001H.1 UNIT _BIT_GROUP_ - 0021H.1 0000H.7 *** GAP *** - DATA 0022H 002AH UNIT ?DT?MAIN - DATA 004CH 0028H UNIT _DATA_GROUP_ - IDATA 0074H 0001H UNIT ?STACK + DATA 0008H 0015H UNIT _DATA_GROUP_ + 001DH 0003H *** GAP *** + BIT 0020H.0 0000H.1 UNIT _BIT_GROUP_ + 0020H.1 0000H.7 *** GAP *** + DATA 0021H 002AH UNIT ?DT?MAIN + DATA 004BH 0007H UNIT ?DT?DS1302 + IDATA 0052H 0001H UNIT ?STACK * * * * * * * C O D E M E M O R Y * * * * * * * CODE 0000H 0003H ABSOLUTE - CODE 0003H 069FH UNIT ?C?LIB_CODE - CODE 06A2H 046FH UNIT ?PR?PRINTF?PRINTF - CODE 0B11H 0292H UNIT ?PR?DETECTION?MAIN -BL51 BANKED LINKER/LOCATER V6.22 05/01/2022 13:48:31 PAGE 2 - - - CODE 0DA3H 0283H UNIT ?PR?LCDDISPLAY?MAIN - CODE 1026H 00DDH UNIT ?PR?DISPOSE?MAIN - CODE 1103H 0099H UNIT ?PR?GETTIMERESULT?MAIN - CODE 119CH 008CH UNIT ?C_C51STARTUP - CODE 1228H 005AH UNIT ?PR?MAIN?MAIN - CODE 1282H 004FH UNIT ?PR?TEMPER_CHANGE?DS18B20 - CODE 12D1H 004AH UNIT ?PR?_DS1302READ?DS1302 - CODE 131BH 0042H UNIT ?PR?_DS18B20_WRITEBYTE?DS18B20 - CODE 135DH 0041H UNIT ?PR?_I2CSENDBYTE?I2C - CODE 139EH 003EH UNIT ?PR?DS18B20_READBYTE?DS18B20 - CODE 13DCH 0035H UNIT ?PR?_DS1302WRITE?DS1302 - CODE 1411H 002AH UNIT ?PR?_LCD1602_DELAY1MS?LCD - CODE 143BH 0029H UNIT ?PR?MULTIPLE_READ_BH1750?MAIN - CODE 1464H 0027H UNIT ?PR?PUTCHAR?PUTCHAR - CODE 148BH 0026H UNIT ?PR?I2CREADBYTE?I2C - CODE 14B1H 0025H UNIT ?PR?DS18B20_INIT?DS18B20 - CODE 14D6H 0022H UNIT ?PR?_AT24C02READ?I2C - CODE 14F8H 0021H UNIT ?PR?DS18B20_READTEMP?DS18B20 - CODE 1519H 0020H UNIT ?PR?_DELAY_NMS?MAIN - CODE 1539H 001EH UNIT ?PR?BH1750_RECVBYTE?MAIN - CODE 1557H 001EH UNIT ?PR?_DELAY_MS?DS18B20 - CODE 1575H 0019H UNIT ?PR?_BH1750_SENDBYTE?MAIN - CODE 158EH 0019H UNIT ?PR?LCDINIT?LCD - CODE 15A7H 0019H UNIT ?PR?_AT24C02WRITE?I2C - CODE 15C0H 0018H UNIT ?PR?_BLUETOOTH_SET?MAIN - CODE 15D8H 0016H UNIT ?PR?UART_INIT?MAIN - CODE 15EEH 0016H UNIT ?C_INITSEG - CODE 1604H 0016H UNIT ?PR?DS1302READTIME?DS1302 - CODE 161AH 0014H UNIT ?PR?DS1302INIT?DS1302 - CODE 162EH 0012H UNIT ?PR?_SINGLE_WRITE_BH1750?MAIN - CODE 1640H 0011H UNIT ?PR?DELAY5US?MAIN - CODE 1651H 000FH UNIT ?PR?DELAY5MS?MAIN - CODE 1660H 000FH UNIT ?PR?BH1750_START?MAIN - CODE 166FH 000FH UNIT ?PR?I2CSTART?I2C - CODE 167EH 000EH UNIT ?PR?BH1750_SENDACK?MAIN - CODE 168CH 000EH UNIT ?PR?_SEND_UART?MAIN - CODE 169AH 000EH UNIT ?CO?DS1302 - CODE 16A8H 000EH UNIT ?PR?DELAY10US?I2C - CODE 16B6H 000DH UNIT ?PR?BH1750_RECVACK?MAIN - CODE 16C3H 000DH UNIT ?PR?DELAY10MS?MAIN - CODE 16D0H 000CH UNIT ?PR?BH1750_STOP?MAIN - CODE 16DCH 000AH UNIT ?PR?_LCDWRITECOM?LCD - CODE 16E6H 000AH UNIT ?PR?_LCDWRITEDATA?LCD - CODE 16F0H 000AH UNIT ?PR?I2CSTOP?I2C - CODE 16FAH 0007H UNIT ?PR?_US_DELAY?MAIN - CODE 1701H 0005H UNIT ?PR?INIT_BH1750?MAIN - CODE 1706H 0005H UNIT ?CO?MAIN + CODE 0003H 0488H UNIT ?C?LIB_CODE + CODE 048BH 0292H UNIT ?PR?DETECTION?MAIN + CODE 071DH 0283H UNIT ?PR?LCDDISPLAY?MAIN + CODE 09A0H 00DDH UNIT ?PR?DISPOSE?MAIN + CODE 0A7DH 0099H UNIT ?PR?GETTIMERESULT?MAIN + CODE 0B16H 008CH UNIT ?C_C51STARTUP + CODE 0BA2H 004FH UNIT ?PR?TEMPER_CHANGE?DS18B20 + CODE 0BF1H 004AH UNIT ?PR?_DS1302READ?DS1302 + CODE 0C3BH 0042H UNIT ?PR?_DS18B20_WRITEBYTE?DS18B20 + CODE 0C7DH 0041H UNIT ?PR?_I2CSENDBYTE?I2C + CODE 0CBEH 003EH UNIT ?PR?DS18B20_READBYTE?DS18B20 + CODE 0CFCH 0039H UNIT ?PR?MAIN?MAIN +BL51 BANKED LINKER/LOCATER V6.22 05/05/2022 19:42:13 PAGE 2 + + + CODE 0D35H 0035H UNIT ?PR?_DS1302WRITE?DS1302 + CODE 0D6AH 002AH UNIT ?PR?_LCD1602_DELAY1MS?LCD + CODE 0D94H 0029H UNIT ?PR?MULTIPLE_READ_BH1750?MAIN + CODE 0DBDH 0026H UNIT ?PR?I2CREADBYTE?I2C + CODE 0DE3H 0025H UNIT ?PR?DS18B20_INIT?DS18B20 + CODE 0E08H 0022H UNIT ?PR?_AT24C02READ?I2C + CODE 0E2AH 0021H UNIT ?PR?DS18B20_READTEMP?DS18B20 + CODE 0E4BH 0020H UNIT ?PR?_DELAY_NMS?MAIN + CODE 0E6BH 001EH UNIT ?PR?BH1750_RECVBYTE?MAIN + CODE 0E89H 001EH UNIT ?PR?_DELAY_MS?DS18B20 + CODE 0EA7H 0019H UNIT ?PR?_BH1750_SENDBYTE?MAIN + CODE 0EC0H 0019H UNIT ?PR?LCDINIT?LCD + CODE 0ED9H 0019H UNIT ?PR?_AT24C02WRITE?I2C + CODE 0EF2H 0018H UNIT ?PR?_BLUETOOTH_SET?MAIN + CODE 0F0AH 0016H UNIT ?PR?UART_INIT?MAIN + CODE 0F20H 0016H UNIT ?C_INITSEG + CODE 0F36H 0016H UNIT ?PR?DS1302READTIME?DS1302 + CODE 0F4CH 0014H UNIT ?PR?DS1302INIT?DS1302 + CODE 0F60H 0012H UNIT ?PR?_SINGLE_WRITE_BH1750?MAIN + CODE 0F72H 0011H UNIT ?PR?DELAY5US?MAIN + CODE 0F83H 000FH UNIT ?PR?DELAY5MS?MAIN + CODE 0F92H 000FH UNIT ?PR?BH1750_START?MAIN + CODE 0FA1H 000FH UNIT ?PR?I2CSTART?I2C + CODE 0FB0H 000EH UNIT ?PR?BH1750_SENDACK?MAIN + CODE 0FBEH 000EH UNIT ?PR?_SEND_UART?MAIN + CODE 0FCCH 000EH UNIT ?CO?DS1302 + CODE 0FDAH 000EH UNIT ?PR?DELAY10US?I2C + CODE 0FE8H 000DH UNIT ?PR?BH1750_RECVACK?MAIN + CODE 0FF5H 000DH UNIT ?PR?DELAY10MS?MAIN + CODE 1002H 000CH UNIT ?PR?BH1750_STOP?MAIN + CODE 100EH 000AH UNIT ?PR?_LCDWRITECOM?LCD + CODE 1018H 000AH UNIT ?PR?_LCDWRITEDATA?LCD + CODE 1022H 000AH UNIT ?PR?I2CSTOP?I2C + CODE 102CH 0007H UNIT ?PR?_US_DELAY?MAIN + CODE 1033H 0005H UNIT ?PR?INIT_BH1750?MAIN @@ -119,13 +107,10 @@ SEGMENT BIT_GROUP DATA_GROUP +--> CALLED SEGMENT START LENGTH START LENGTH -------------------------------------------------------------------------- ?C_C51STARTUP ----- ----- ----- ----- -BL51 BANKED LINKER/LOCATER V6.22 05/01/2022 13:48:31 PAGE 3 - - +--> ?PR?MAIN?MAIN +--> ?C_INITSEG -?PR?MAIN?MAIN ----- ----- 004CH 000CH +?PR?MAIN?MAIN ----- ----- 0008H 000CH +--> ?PR?DS1302INIT?DS1302 +--> ?PR?UART_INIT?MAIN +--> ?PR?LCDINIT?LCD @@ -133,9 +118,9 @@ SEGMENT BIT_GROUP DATA_GROUP +--> ?PR?LCDDISPLAY?MAIN +--> ?PR?DETECTION?MAIN +--> ?PR?DISPOSE?MAIN - +--> ?CO?MAIN - +--> ?PR?PRINTF?PRINTF - +--> ?PR?_BLUETOOTH_SET?MAIN + +BL51 BANKED LINKER/LOCATER V6.22 05/05/2022 19:42:13 PAGE 3 + ?PR?DS1302INIT?DS1302 ----- ----- ----- ----- +--> ?PR?_DS1302WRITE?DS1302 @@ -150,14 +135,14 @@ SEGMENT BIT_GROUP DATA_GROUP +--> ?CO?DS1302 +--> ?PR?_DS1302READ?DS1302 -?PR?LCDDISPLAY?MAIN ----- ----- 0058H 0002H +?PR?LCDDISPLAY?MAIN ----- ----- 0014H 0002H +--> ?PR?_LCDWRITECOM?LCD +--> ?PR?_LCDWRITEDATA?LCD ?PR?_LCDWRITEDATA?LCD ----- ----- ----- ----- +--> ?PR?_LCD1602_DELAY1MS?LCD -?PR?DETECTION?MAIN ----- ----- 0058H 0002H +?PR?DETECTION?MAIN ----- ----- 0014H 0002H +--> ?PR?_SINGLE_WRITE_BH1750?MAIN +--> ?PR?_DELAY_NMS?MAIN +--> ?PR?MULTIPLE_READ_BH1750?MAIN @@ -179,9 +164,6 @@ SEGMENT BIT_GROUP DATA_GROUP ?PR?BH1750_RECVACK?MAIN ----- ----- ----- ----- +--> ?PR?DELAY5US?MAIN -BL51 BANKED LINKER/LOCATER V6.22 05/01/2022 13:48:31 PAGE 4 - - ?PR?BH1750_STOP?MAIN ----- ----- ----- ----- +--> ?PR?DELAY5US?MAIN @@ -197,17 +179,20 @@ SEGMENT BIT_GROUP DATA_GROUP ?PR?BH1750_RECVBYTE?MAIN ----- ----- ----- ----- +--> ?PR?DELAY5US?MAIN +BL51 BANKED LINKER/LOCATER V6.22 05/05/2022 19:42:13 PAGE 4 + + ?PR?BH1750_SENDACK?MAIN 0020H.0 0000H.1 ----- ----- +--> ?PR?DELAY5US?MAIN -?PR?TEMPER_CHANGE?DS18B20 ----- ----- 005AH 0004H +?PR?TEMPER_CHANGE?DS18B20 ----- ----- 0016H 0004H +--> ?PR?DS18B20_READTEMP?DS18B20 -?PR?DS18B20_READTEMP?DS18B20 ----- ----- 005EH 0001H +?PR?DS18B20_READTEMP?DS18B20 ----- ----- 001AH 0001H +--> ?PR?_DS18B20_WRITEBYTE?DS18B20 +--> ?PR?DS18B20_READBYTE?DS18B20 -?PR?_DS18B20_WRITEBYTE?DS18B20 ----- ----- 005FH 0002H +?PR?_DS18B20_WRITEBYTE?DS18B20 ----- ----- 001BH 0002H +--> ?PR?DS18B20_INIT?DS18B20 +--> ?PR?_DELAY_MS?DS18B20 @@ -217,14 +202,7 @@ SEGMENT BIT_GROUP DATA_GROUP ?PR?DISPOSE?MAIN ----- ----- ----- ----- +--> ?PR?GETTIMERESULT?MAIN -?PR?GETTIMERESULT?MAIN ----- ----- 0058H 0006H - -?PR?PRINTF?PRINTF 0020H.0 0001H.1 0058H 001CH - +--> ?PR?PUTCHAR?PUTCHAR - -?PR?_BLUETOOTH_SET?MAIN ----- ----- ----- ----- - +--> ?PR?_SEND_UART?MAIN - +--> ?PR?_US_DELAY?MAIN +?PR?GETTIMERESULT?MAIN ----- ----- 0014H 0006H @@ -239,56 +217,58 @@ SYMBOL TABLE OF MODULE: pro (MAIN) D:0090H PUBLIC P1 D:00A0H PUBLIC P2 D:00B0H PUBLIC P3 -BL51 BANKED LINKER/LOCATER V6.22 05/01/2022 13:48:31 PAGE 5 - - B:00A0H.5 PUBLIC LED0 B:00A8H.7 PUBLIC EA B:00A0H.6 PUBLIC LED1 B:00A0H.1 PUBLIC LED2 - C:1651H PUBLIC Delay5ms + C:0F83H PUBLIC Delay5ms B:00A0H.4 PUBLIC LED3 - C:143BH PUBLIC Multiple_read_BH1750 + C:0D94H PUBLIC Multiple_read_BH1750 B:0090H.0 PUBLIC SDA1 B:00A0H.3 PUBLIC LED4 - C:168CH PUBLIC _Send_Uart + C:0FBEH PUBLIC _Send_Uart B:0090H.7 PUBLIC LED5 - C:162EH PUBLIC _Single_Write_BH1750 - C:1640H PUBLIC Delay5us + C:0F60H PUBLIC _Single_Write_BH1750 + C:0F72H PUBLIC Delay5us B:0090H.1 PUBLIC SCL1 - C:15D8H PUBLIC Uart_Init - C:167EH PUBLIC BH1750_SendACK + C:0F0AH PUBLIC Uart_Init + C:0FB0H PUBLIC BH1750_SendACK B:00B0H.7 PUBLIC IN B:00A8H.4 PUBLIC ES - C:16B6H PUBLIC BH1750_RecvACK + C:0FE8H PUBLIC BH1750_RecvACK B:00D0H.7 PUBLIC CY B:0098H.1 PUBLIC TI - C:0B11H PUBLIC Detection - C:1228H PUBLIC main + C:048BH PUBLIC Detection +BL51 BANKED LINKER/LOCATER V6.22 05/05/2022 19:42:13 PAGE 5 + + + C:0CFCH PUBLIC main D:0099H PUBLIC SBUF D:0087H PUBLIC PCON D:0098H PUBLIC SCON - C:16C3H PUBLIC Delay10ms + C:0FF5H PUBLIC Delay10ms D:0089H PUBLIC TMOD - D:0024H PUBLIC dis_data - C:1519H PUBLIC _delay_nms - C:15C0H PUBLIC _Bluetooth_Set - C:1660H PUBLIC BH1750_Start - D:0026H PUBLIC cut + D:0023H PUBLIC dis_data + C:0E4BH PUBLIC _delay_nms + C:0EF2H PUBLIC _Bluetooth_Set + C:0F92H PUBLIC BH1750_Start + D:0025H PUBLIC cut D:008DH PUBLIC TH1 - C:1701H PUBLIC Init_BH1750 - D:0028H PUBLIC userInfo + C:1033H PUBLIC Init_BH1750 + D:0027H PUBLIC userInfo D:008BH PUBLIC TL1 - C:1103H PUBLIC getTimeResult + C:0A7DH PUBLIC getTimeResult B:0088H.6 PUBLIC TR1 - C:1026H PUBLIC Dispose - C:16FAH PUBLIC _us_delay - C:1575H PUBLIC _BH1750_SendByte - D:0042H PUBLIC BUF - C:16D0H PUBLIC BH1750_Stop - C:1539H PUBLIC BH1750_RecvByte - D:004AH PUBLIC led_num - C:0DA3H PUBLIC LcdDisplay + B:00A0H.0 PUBLIC SDA + C:09A0H PUBLIC Dispose + C:102CH PUBLIC _us_delay + C:0EA7H PUBLIC _BH1750_SendByte + D:0041H PUBLIC BUF + C:1002H PUBLIC BH1750_Stop + C:0E6BH PUBLIC BH1750_RecvByte + B:00A0H.1 PUBLIC SCL + D:0049H PUBLIC led_num + C:071DH PUBLIC LcdDisplay B:00B0H.6 PUBLIC OUT B:0090H.2 PUBLIC key1 B:0090H.3 PUBLIC key2 @@ -299,469 +279,467 @@ SYMBOL TABLE OF MODULE: pro (MAIN) D:0004H SYMBOL i D:0002H SYMBOL j ------- ENDDO -BL51 BANKED LINKER/LOCATER V6.22 05/01/2022 13:48:31 PAGE 6 - - - C:1519H LINE# 93 - C:1519H LINE# 94 - C:1519H LINE# 96 - C:1523H LINE# 97 - C:1523H LINE# 98 - C:1526H LINE# 99 - C:1538H LINE# 100 + C:0E4BH LINE# 93 + C:0E4BH LINE# 94 + C:0E4BH LINE# 96 + C:0E55H LINE# 97 + C:0E55H LINE# 98 + C:0E58H LINE# 99 + C:0E6AH LINE# 100 ------- ENDPROC _DELAY_NMS ------- PROC DELAY5US - C:1640H LINE# 102 - C:1640H LINE# 103 - C:1640H LINE# 104 - C:1644H LINE# 105 - C:1648H LINE# 106 - C:164CH LINE# 107 - C:1650H LINE# 108 + C:0F72H LINE# 102 + C:0F72H LINE# 103 + C:0F72H LINE# 104 + C:0F76H LINE# 105 + C:0F7AH LINE# 106 + C:0F7EH LINE# 107 + C:0F82H LINE# 108 ------- ENDPROC DELAY5US ------- PROC DELAY5MS ------- DO D:0006H SYMBOL n +BL51 BANKED LINKER/LOCATER V6.22 05/05/2022 19:42:13 PAGE 6 + + ------- ENDDO - C:1651H LINE# 110 - C:1651H LINE# 111 - C:1651H LINE# 112 - C:1655H LINE# 114 - C:165FH LINE# 115 + C:0F83H LINE# 110 + C:0F83H LINE# 111 + C:0F83H LINE# 112 + C:0F87H LINE# 114 + C:0F91H LINE# 115 ------- ENDPROC DELAY5MS ------- PROC BH1750_START - C:1660H LINE# 120 - C:1660H LINE# 121 - C:1660H LINE# 122 - C:1662H LINE# 123 - C:1664H LINE# 124 - C:1667H LINE# 125 - C:1669H LINE# 126 - C:166CH LINE# 127 - C:166EH LINE# 128 + C:0F92H LINE# 120 + C:0F92H LINE# 121 + C:0F92H LINE# 122 + C:0F94H LINE# 123 + C:0F96H LINE# 124 + C:0F99H LINE# 125 + C:0F9BH LINE# 126 + C:0F9EH LINE# 127 + C:0FA0H LINE# 128 ------- ENDPROC BH1750_START ------- PROC BH1750_STOP - C:16D0H LINE# 133 - C:16D0H LINE# 134 - C:16D0H LINE# 135 - C:16D2H LINE# 136 - C:16D4H LINE# 137 - C:16D7H LINE# 138 - C:16D9H LINE# 139 + C:1002H LINE# 133 + C:1002H LINE# 134 + C:1002H LINE# 135 + C:1004H LINE# 136 + C:1006H LINE# 137 + C:1009H LINE# 138 + C:100BH LINE# 139 ------- ENDPROC BH1750_STOP ------- PROC BH1750_SENDACK B:0020H.0 SYMBOL ack - C:167EH LINE# 146 - C:167EH LINE# 147 - C:167EH LINE# 148 - C:1682H LINE# 149 - C:1684H LINE# 150 - C:1687H LINE# 151 - C:1689H LINE# 152 + C:0FB0H LINE# 146 + C:0FB0H LINE# 147 + C:0FB0H LINE# 148 + C:0FB4H LINE# 149 + C:0FB6H LINE# 150 + C:0FB9H LINE# 151 + C:0FBBH LINE# 152 ------- ENDPROC BH1750_SENDACK -BL51 BANKED LINKER/LOCATER V6.22 05/01/2022 13:48:31 PAGE 7 - - ------- PROC BH1750_RECVACK - C:16B6H LINE# 158 - C:16B6H LINE# 159 - C:16B6H LINE# 160 - C:16B8H LINE# 161 - C:16BBH LINE# 162 - C:16BDH LINE# 163 - C:16BFH LINE# 164 - C:16C2H LINE# 166 - C:16C2H LINE# 167 + C:0FE8H LINE# 158 + C:0FE8H LINE# 159 + C:0FE8H LINE# 160 + C:0FEAH LINE# 161 + C:0FEDH LINE# 162 + C:0FEFH LINE# 163 + C:0FF1H LINE# 164 + C:0FF4H LINE# 166 + C:0FF4H LINE# 167 ------- ENDPROC BH1750_RECVACK ------- PROC _BH1750_SENDBYTE D:0007H SYMBOL dat ------- DO D:0006H SYMBOL i ------- ENDDO - C:1575H LINE# 172 - C:1575H LINE# 173 - C:1575H LINE# 176 - C:1577H LINE# 177 - C:1577H LINE# 178 - C:157BH LINE# 179 - C:157DH LINE# 180 - C:157FH LINE# 181 - C:1582H LINE# 182 - C:1584H LINE# 183 - C:1587H LINE# 184 - C:158BH LINE# 185 + C:0EA7H LINE# 172 + C:0EA7H LINE# 173 + C:0EA7H LINE# 176 + C:0EA9H LINE# 177 +BL51 BANKED LINKER/LOCATER V6.22 05/05/2022 19:42:13 PAGE 7 + + + C:0EA9H LINE# 178 + C:0EADH LINE# 179 + C:0EAFH LINE# 180 + C:0EB1H LINE# 181 + C:0EB4H LINE# 182 + C:0EB6H LINE# 183 + C:0EB9H LINE# 184 + C:0EBDH LINE# 185 ------- ENDPROC _BH1750_SENDBYTE ------- PROC BH1750_RECVBYTE ------- DO D:0006H SYMBOL i D:0007H SYMBOL dat ------- ENDDO - C:1539H LINE# 191 - C:1539H LINE# 192 - C:1539H LINE# 194 - C:153BH LINE# 196 - C:153DH LINE# 197 - C:153EH LINE# 198 - C:153EH LINE# 199 - C:1542H LINE# 200 - C:1544H LINE# 201 - C:1547H LINE# 202 - C:154DH LINE# 203 - C:154FH LINE# 204 - C:1552H LINE# 205 - C:1556H LINE# 206 - C:1556H LINE# 207 + C:0E6BH LINE# 191 + C:0E6BH LINE# 192 + C:0E6BH LINE# 194 + C:0E6DH LINE# 196 + C:0E6FH LINE# 197 + C:0E70H LINE# 198 + C:0E70H LINE# 199 + C:0E74H LINE# 200 + C:0E76H LINE# 201 + C:0E79H LINE# 202 + C:0E7FH LINE# 203 + C:0E81H LINE# 204 + C:0E84H LINE# 205 + C:0E88H LINE# 206 + C:0E88H LINE# 207 ------- ENDPROC BH1750_RECVBYTE ------- PROC _SINGLE_WRITE_BH1750 D:0005H SYMBOL REG_Address - C:162EH LINE# 211 - C:1630H LINE# 212 - C:1630H LINE# 213 - C:1633H LINE# 214 - C:1638H LINE# 215 -BL51 BANKED LINKER/LOCATER V6.22 05/01/2022 13:48:31 PAGE 8 - - - C:163DH LINE# 217 + C:0F60H LINE# 211 + C:0F62H LINE# 212 + C:0F62H LINE# 213 + C:0F65H LINE# 214 + C:0F6AH LINE# 215 + C:0F6FH LINE# 217 ------- ENDPROC _SINGLE_WRITE_BH1750 ------- PROC MULTIPLE_READ_BH1750 ------- DO D:0005H SYMBOL i ------- ENDDO - C:143BH LINE# 240 - C:143BH LINE# 242 - C:143BH LINE# 243 - C:143EH LINE# 244 - C:1443H LINE# 246 - C:1445H LINE# 247 - C:1445H LINE# 248 - C:144EH LINE# 249 - C:1451H LINE# 250 - C:1451H LINE# 252 - C:1453H LINE# 253 - C:1455H LINE# 255 - C:1455H LINE# 256 - C:145AH LINE# 257 - C:145AH LINE# 258 - C:145EH LINE# 260 - C:1461H LINE# 261 + C:0D94H LINE# 227 + C:0D94H LINE# 229 + C:0D94H LINE# 230 + C:0D97H LINE# 231 + C:0D9CH LINE# 233 + C:0D9EH LINE# 234 + C:0D9EH LINE# 235 + C:0DA7H LINE# 236 + C:0DAAH LINE# 237 + C:0DAAH LINE# 239 + C:0DACH LINE# 240 + C:0DAEH LINE# 242 + C:0DAEH LINE# 243 + C:0DB3H LINE# 244 +BL51 BANKED LINKER/LOCATER V6.22 05/05/2022 19:42:13 PAGE 8 + + + C:0DB3H LINE# 245 + C:0DB7H LINE# 247 + C:0DBAH LINE# 248 ------- ENDPROC MULTIPLE_READ_BH1750 ------- PROC INIT_BH1750 - C:1701H LINE# 266 - C:1701H LINE# 267 - C:1701H LINE# 268 + C:1033H LINE# 253 + C:1033H LINE# 254 + C:1033H LINE# 255 ------- ENDPROC INIT_BH1750 ------- PROC UART_INIT - C:15D8H LINE# 272 - C:15D8H LINE# 273 - C:15D8H LINE# 274 - C:15DBH LINE# 275 - C:15DEH LINE# 276 - C:15E1H LINE# 277 - C:15E4H LINE# 278 - C:15E7H LINE# 279 - C:15E9H LINE# 280 - C:15EBH LINE# 281 - C:15EDH LINE# 282 + C:0F0AH LINE# 260 + C:0F0AH LINE# 261 + C:0F0AH LINE# 262 + C:0F0DH LINE# 263 + C:0F10H LINE# 264 + C:0F13H LINE# 265 + C:0F16H LINE# 266 + C:0F19H LINE# 267 + C:0F1BH LINE# 268 + C:0F1DH LINE# 269 + C:0F1FH LINE# 270 ------- ENDPROC UART_INIT ------- PROC _US_DELAY D:0007H SYMBOL t - C:16FAH LINE# 284 - C:16FAH LINE# 285 - C:16FAH LINE# 286 - C:1700H LINE# 287 + C:102CH LINE# 272 + C:102CH LINE# 273 + C:102CH LINE# 274 + C:1032H LINE# 275 ------- ENDPROC _US_DELAY ------- PROC _SEND_UART D:0007H SYMBOL value - C:168CH LINE# 289 - C:168CH LINE# 290 - C:168CH LINE# 291 - C:168EH LINE# 292 - C:1690H LINE# 293 - C:1692H LINE# 294 -BL51 BANKED LINKER/LOCATER V6.22 05/01/2022 13:48:31 PAGE 9 - - - C:1695H LINE# 295 - C:1697H LINE# 296 - C:1699H LINE# 297 + C:0FBEH LINE# 277 + C:0FBEH LINE# 278 + C:0FBEH LINE# 279 + C:0FC0H LINE# 280 + C:0FC2H LINE# 281 + C:0FC4H LINE# 282 + C:0FC7H LINE# 283 + C:0FC9H LINE# 284 + C:0FCBH LINE# 285 ------- ENDPROC _SEND_UART ------- PROC _BLUETOOTH_SET D:0001H SYMBOL puf - C:15C0H LINE# 299 - C:15C0H LINE# 300 - C:15C0H LINE# 301 - C:15C6H LINE# 302 - C:15C6H LINE# 303 - C:15C9H LINE# 304 - C:15CEH LINE# 305 - C:15D5H LINE# 306 - C:15D7H LINE# 307 + C:0EF2H LINE# 287 + C:0EF2H LINE# 288 + C:0EF2H LINE# 289 + C:0EF8H LINE# 290 + C:0EF8H LINE# 291 + C:0EFBH LINE# 292 + C:0F00H LINE# 293 + C:0F07H LINE# 294 + C:0F09H LINE# 295 ------- ENDPROC _BLUETOOTH_SET ------- PROC DETECTION ------- DO - D:0022H SYMBOL num - D:0058H SYMBOL i + D:0021H SYMBOL num + D:0014H SYMBOL i +BL51 BANKED LINKER/LOCATER V6.22 05/05/2022 19:42:13 PAGE 9 + + ------- ENDDO - C:0B11H LINE# 309 - C:0B11H LINE# 310 - C:0B11H LINE# 312 - C:0B16H LINE# 313 - C:0B1BH LINE# 314 - C:0B20H LINE# 315 - C:0B27H LINE# 316 - C:0B2AH LINE# 317 - C:0B30H LINE# 318 - C:0B3EH LINE# 319 - C:0B57H LINE# 321 - C:0B5EH LINE# 322 - C:0B69H LINE# 323 - C:0B6CH LINE# 324 - C:0B6CH LINE# 325 - C:0B6FH LINE# 326 - C:0B72H LINE# 327 - C:0B78H LINE# 328 - C:0B85H LINE# 329 - C:0B8AH LINE# 330 - C:0B98H LINE# 331 - C:0B9CH LINE# 332 - C:0B9CH LINE# 333 - C:0B9CH LINE# 334 - C:0BACH LINE# 335 - C:0BAFH LINE# 336 - C:0BB7H LINE# 337 - C:0BB9H LINE# 338 - C:0BBEH LINE# 339 - C:0BBEH LINE# 341 - C:0BC1H LINE# 342 - C:0BC1H LINE# 343 - C:0BC4H LINE# 344 - C:0BC7H LINE# 345 - C:0BCDH LINE# 346 - C:0BD5H LINE# 347 -BL51 BANKED LINKER/LOCATER V6.22 05/01/2022 13:48:31 PAGE 10 - - - C:0BE5H LINE# 348 - C:0BE7H LINE# 349 - C:0BF4H LINE# 350 - C:0BF9H LINE# 351 - C:0BFEH LINE# 352 - C:0BFEH LINE# 353 - C:0C03H LINE# 354 - C:0C03H LINE# 355 - C:0C13H LINE# 356 - C:0C16H LINE# 357 - C:0C1EH LINE# 358 - C:0C20H LINE# 359 - C:0C25H LINE# 360 - C:0C25H LINE# 362 - C:0C28H LINE# 363 - C:0C28H LINE# 364 - C:0C2BH LINE# 365 - C:0C2EH LINE# 366 - C:0C36H LINE# 367 - C:0C47H LINE# 368 - C:0C47H LINE# 369 - C:0C57H LINE# 370 - C:0C5AH LINE# 371 - C:0C62H LINE# 372 - C:0C64H LINE# 373 - C:0C69H LINE# 374 - C:0C69H LINE# 376 - C:0C6CH LINE# 377 - C:0C6CH LINE# 378 - C:0C6FH LINE# 379 - C:0C72H LINE# 380 - C:0C7AH LINE# 381 - C:0C88H LINE# 382 - C:0C88H LINE# 383 - C:0C98H LINE# 384 - C:0C9BH LINE# 385 - C:0CA3H LINE# 386 - C:0CA5H LINE# 387 - C:0CAAH LINE# 388 - C:0CAAH LINE# 390 - C:0CADH LINE# 391 - C:0CADH LINE# 392 - C:0CB0H LINE# 393 - C:0CB3H LINE# 394 - C:0CBBH LINE# 395 - C:0CCBH LINE# 396 - C:0CCBH LINE# 397 - C:0CDBH LINE# 398 - C:0CDEH LINE# 399 - C:0CE6H LINE# 400 - C:0CE8H LINE# 401 - C:0CEDH LINE# 402 - C:0CEDH LINE# 404 - C:0CF3H LINE# 405 - C:0CF3H LINE# 406 - C:0CF6H LINE# 407 - C:0CFCH LINE# 408 -BL51 BANKED LINKER/LOCATER V6.22 05/01/2022 13:48:31 PAGE 11 - - - C:0D02H LINE# 409 - C:0D0AH LINE# 410 - C:0D1AH LINE# 411 - C:0D24H LINE# 412 - C:0D2CH LINE# 413 - C:0D3CH LINE# 414 - C:0D46H LINE# 415 - C:0D4EH LINE# 416 - C:0D5EH LINE# 417 - C:0D68H LINE# 418 - C:0D70H LINE# 419 - C:0D80H LINE# 420 - C:0D80H LINE# 421 - C:0D90H LINE# 422 - C:0D93H LINE# 423 - C:0D9BH LINE# 424 - C:0D9DH LINE# 425 - C:0DA2H LINE# 426 - C:0DA2H LINE# 427 - C:0DA2H LINE# 428 + C:048BH LINE# 299 + C:048BH LINE# 300 + C:048BH LINE# 302 + C:0490H LINE# 303 + C:0495H LINE# 304 + C:049AH LINE# 305 + C:04A1H LINE# 306 + C:04A4H LINE# 307 + C:04AAH LINE# 308 + C:04B8H LINE# 309 + C:04D1H LINE# 311 + C:04D8H LINE# 312 + C:04E3H LINE# 315 + C:04E6H LINE# 316 + C:04E6H LINE# 317 + C:04E9H LINE# 318 + C:04ECH LINE# 319 + C:04F2H LINE# 320 + C:04FFH LINE# 321 + C:0504H LINE# 322 + C:0512H LINE# 323 + C:0516H LINE# 324 + C:0516H LINE# 325 + C:0516H LINE# 326 + C:0526H LINE# 327 + C:0529H LINE# 328 + C:0531H LINE# 329 + C:0533H LINE# 330 + C:0538H LINE# 331 + C:0538H LINE# 334 + C:053BH LINE# 335 + C:053BH LINE# 336 + C:053EH LINE# 337 + C:0541H LINE# 338 + C:0547H LINE# 339 + C:054FH LINE# 340 + C:055FH LINE# 341 + C:0561H LINE# 342 + C:056EH LINE# 343 + C:0573H LINE# 344 + C:0578H LINE# 345 + C:0578H LINE# 346 + C:057DH LINE# 347 + C:057DH LINE# 348 + C:058DH LINE# 349 + C:0590H LINE# 350 + C:0598H LINE# 351 + C:059AH LINE# 352 + C:059FH LINE# 353 + C:059FH LINE# 355 + C:05A2H LINE# 356 + C:05A2H LINE# 357 + C:05A5H LINE# 358 + C:05A8H LINE# 359 + C:05B0H LINE# 360 + C:05C1H LINE# 361 +BL51 BANKED LINKER/LOCATER V6.22 05/05/2022 19:42:13 PAGE 10 + + + C:05C1H LINE# 362 + C:05D1H LINE# 363 + C:05D4H LINE# 364 + C:05DCH LINE# 365 + C:05DEH LINE# 366 + C:05E3H LINE# 367 + C:05E3H LINE# 370 + C:05E6H LINE# 371 + C:05E6H LINE# 372 + C:05E9H LINE# 373 + C:05ECH LINE# 374 + C:05F4H LINE# 375 + C:0602H LINE# 376 + C:0602H LINE# 377 + C:0612H LINE# 378 + C:0615H LINE# 379 + C:061DH LINE# 380 + C:061FH LINE# 381 + C:0624H LINE# 382 + C:0624H LINE# 385 + C:0627H LINE# 386 + C:0627H LINE# 387 + C:062AH LINE# 388 + C:062DH LINE# 389 + C:0635H LINE# 390 + C:0645H LINE# 391 + C:0645H LINE# 392 + C:0655H LINE# 393 + C:0658H LINE# 394 + C:0660H LINE# 395 + C:0662H LINE# 396 + C:0667H LINE# 397 + C:0667H LINE# 400 + C:066DH LINE# 401 + C:066DH LINE# 402 + C:0670H LINE# 403 + C:0676H LINE# 405 + C:067CH LINE# 406 + C:0684H LINE# 407 + C:0694H LINE# 408 + C:069EH LINE# 409 + C:06A6H LINE# 410 + C:06B6H LINE# 411 + C:06C0H LINE# 412 + C:06C8H LINE# 413 + C:06D8H LINE# 414 + C:06E2H LINE# 415 + C:06EAH LINE# 416 + C:06FAH LINE# 417 + C:06FAH LINE# 418 + C:070AH LINE# 419 + C:070DH LINE# 420 + C:0715H LINE# 421 + C:0717H LINE# 422 + C:071CH LINE# 423 + C:071CH LINE# 424 + C:071CH LINE# 425 +BL51 BANKED LINKER/LOCATER V6.22 05/05/2022 19:42:13 PAGE 11 + + ------- ENDPROC DETECTION ------- PROC GETTIMERESULT ------- DO D:0004H SYMBOL result - D:0058H SYMBOL Nowtime + D:0014H SYMBOL Nowtime ------- ENDDO - C:1103H LINE# 431 - C:1103H LINE# 432 - C:1103H LINE# 433 - C:1107H LINE# 436 - C:1120H LINE# 437 - C:1137H LINE# 439 - C:115BH LINE# 440 - C:1178H LINE# 441 - C:1197H LINE# 443 - C:119BH LINE# 444 + C:0A7DH LINE# 429 + C:0A7DH LINE# 430 + C:0A7DH LINE# 431 + C:0A81H LINE# 434 + C:0A9AH LINE# 435 + C:0AB1H LINE# 437 + C:0AD5H LINE# 438 + C:0AF2H LINE# 439 + C:0B11H LINE# 441 + C:0B15H LINE# 442 ------- ENDPROC GETTIMERESULT ------- PROC DISPOSE - C:1026H LINE# 447 - C:1026H LINE# 448 - C:1026H LINE# 450 - C:102FH LINE# 451 - C:104AH LINE# 452 - C:1065H LINE# 453 - C:1080H LINE# 454 - C:109BH LINE# 455 - C:10AAH LINE# 458 - C:10AAH LINE# 459 - C:10AAH LINE# 460 - C:10ACH LINE# 461 - C:10B2H LINE# 462 - C:10C4H LINE# 463 - C:10D2H LINE# 464 - C:10E0H LINE# 465 - C:10F0H LINE# 466 - C:10F2H LINE# 467 - C:10FAH LINE# 468 -BL51 BANKED LINKER/LOCATER V6.22 05/01/2022 13:48:31 PAGE 12 - - - C:10FAH LINE# 469 - C:10FAH LINE# 470 - C:1102H LINE# 471 + C:09A0H LINE# 446 + C:09A0H LINE# 447 + C:09A0H LINE# 449 + C:09A9H LINE# 450 + C:09C4H LINE# 451 + C:09DFH LINE# 452 + C:09FAH LINE# 453 + C:0A15H LINE# 454 + C:0A24H LINE# 457 + C:0A24H LINE# 458 + C:0A24H LINE# 459 + C:0A26H LINE# 460 + C:0A2CH LINE# 461 + C:0A3EH LINE# 462 + C:0A4CH LINE# 463 + C:0A5AH LINE# 464 + C:0A6AH LINE# 465 + C:0A6CH LINE# 466 + C:0A74H LINE# 467 + C:0A74H LINE# 468 + C:0A74H LINE# 469 + C:0A7CH LINE# 470 ------- ENDPROC DISPOSE ------- PROC MAIN ------- DO - D:004CH SYMBOL i - D:004EH SYMBOL str + D:0008H SYMBOL i + D:000AH SYMBOL str ------- ENDDO - C:1228H LINE# 473 - C:1228H LINE# 474 - C:1228H LINE# 475 - C:122DH LINE# 477 - C:1230H LINE# 478 - C:1233H LINE# 479 - C:1236H LINE# 481 - C:123CH LINE# 482 - C:1241H LINE# 483 - C:1245H LINE# 485 - C:124AH LINE# 486 - C:124FH LINE# 487 - C:1253H LINE# 489 - C:1253H LINE# 490 - C:1253H LINE# 491 - C:1256H LINE# 492 - C:1259H LINE# 493 - C:125CH LINE# 494 - C:125FH LINE# 495 - C:1277H LINE# 496 - C:1280H LINE# 497 + C:0CFCH LINE# 473 + C:0CFCH LINE# 474 + C:0CFCH LINE# 475 + C:0D01H LINE# 477 + C:0D04H LINE# 478 + C:0D07H LINE# 479 + C:0D0AH LINE# 481 + C:0D10H LINE# 482 + C:0D15H LINE# 483 + C:0D19H LINE# 485 + C:0D1EH LINE# 486 +BL51 BANKED LINKER/LOCATER V6.22 05/05/2022 19:42:13 PAGE 12 + + + C:0D23H LINE# 487 + C:0D27H LINE# 489 + C:0D27H LINE# 490 + C:0D27H LINE# 491 + C:0D2AH LINE# 492 + C:0D2DH LINE# 493 + C:0D30H LINE# 494 + C:0D33H LINE# 495 ------- ENDPROC MAIN ------- PROC LCDDISPLAY ------- DO - D:0058H SYMBOL temp_data + D:0014H SYMBOL temp_data ------- ENDDO - C:0DA3H LINE# 500 - C:0DA3H LINE# 501 - C:0DA3H LINE# 503 - C:0DAEH LINE# 505 - C:0DB1H LINE# 506 - C:0DBCH LINE# 507 - C:0DC6H LINE# 508 - C:0DCBH LINE# 509 - C:0DD6H LINE# 510 - C:0DE0H LINE# 511 - C:0DE5H LINE# 513 - C:0DF0H LINE# 514 - C:0DFAH LINE# 515 - C:0DFFH LINE# 516 - C:0E0AH LINE# 517 - C:0E14H LINE# 518 - C:0E19H LINE# 519 - C:0E24H LINE# 520 - C:0E2EH LINE# 522 - C:0E33H LINE# 523 - C:0E3DH LINE# 525 - C:0E42H LINE# 526 -BL51 BANKED LINKER/LOCATER V6.22 05/01/2022 13:48:31 PAGE 13 - - - C:0E51H LINE# 527 - C:0E5CH LINE# 528 - C:0E6EH LINE# 529 - C:0E7DH LINE# 530 - C:0E8FH LINE# 531 - C:0E9EH LINE# 532 - C:0EB0H LINE# 533 - C:0EBFH LINE# 534 - C:0EC7H LINE# 535 - C:0ECCH LINE# 536 - C:0ED1H LINE# 537 - C:0ED6H LINE# 538 - C:0EE8H LINE# 539 - C:0EFAH LINE# 540 - C:0EFFH LINE# 542 - C:0F04H LINE# 543 - C:0F1DH LINE# 544 - C:0F21H LINE# 545 - C:0F24H LINE# 546 - C:0F27H LINE# 547 - C:0F39H LINE# 548 - C:0F4BH LINE# 549 - C:0F50H LINE# 550 - C:0F62H LINE# 551 - C:0F74H LINE# 552 - C:0F79H LINE# 553 - C:0F8BH LINE# 554 - C:0F9DH LINE# 555 - C:0FA2H LINE# 557 - C:0FAAH LINE# 559 - C:0FAFH LINE# 560 - C:0FC1H LINE# 561 - C:0FD3H LINE# 562 - C:0FD8H LINE# 563 - C:0FEAH LINE# 564 - C:0FFCH LINE# 565 - C:1001H LINE# 566 - C:1013H LINE# 567 - C:1025H LINE# 568 - C:1025H LINE# 569 + C:071DH LINE# 499 + C:071DH LINE# 500 + C:071DH LINE# 502 + C:0728H LINE# 504 + C:072BH LINE# 505 + C:0736H LINE# 506 + C:0740H LINE# 507 + C:0745H LINE# 508 + C:0750H LINE# 509 + C:075AH LINE# 510 + C:075FH LINE# 512 + C:076AH LINE# 513 + C:0774H LINE# 514 + C:0779H LINE# 515 + C:0784H LINE# 516 + C:078EH LINE# 517 + C:0793H LINE# 518 + C:079EH LINE# 519 + C:07A8H LINE# 521 + C:07ADH LINE# 522 + C:07B7H LINE# 524 + C:07BCH LINE# 525 + C:07CBH LINE# 526 + C:07D6H LINE# 527 + C:07E8H LINE# 528 + C:07F7H LINE# 529 + C:0809H LINE# 530 + C:0818H LINE# 531 + C:082AH LINE# 532 + C:0839H LINE# 533 + C:0841H LINE# 534 + C:0846H LINE# 535 + C:084BH LINE# 536 + C:0850H LINE# 537 + C:0862H LINE# 538 + C:0874H LINE# 539 + C:0879H LINE# 541 + C:087EH LINE# 542 + C:0897H LINE# 543 + C:089BH LINE# 544 + C:089EH LINE# 545 + C:08A1H LINE# 546 + C:08B3H LINE# 547 + C:08C5H LINE# 548 +BL51 BANKED LINKER/LOCATER V6.22 05/05/2022 19:42:13 PAGE 13 + + + C:08CAH LINE# 549 + C:08DCH LINE# 550 + C:08EEH LINE# 551 + C:08F3H LINE# 552 + C:0905H LINE# 553 + C:0917H LINE# 554 + C:091CH LINE# 556 + C:0924H LINE# 558 + C:0929H LINE# 559 + C:093BH LINE# 560 + C:094DH LINE# 561 + C:0952H LINE# 562 + C:0964H LINE# 563 + C:0976H LINE# 564 + C:097BH LINE# 565 + C:098DH LINE# 566 + C:099FH LINE# 567 + C:099FH LINE# 568 ------- ENDPROC LCDDISPLAY ------- PROC DELAY10MS ------- DO @@ -769,29 +747,26 @@ SYMBOL TABLE OF MODULE: pro (MAIN) D:0006H SYMBOL b D:0007H SYMBOL c ------- ENDDO - C:16C3H LINE# 572 - C:16C3H LINE# 573 - C:16C3H LINE# 575 - C:16C5H LINE# 576 - C:16C7H LINE# 577 - C:16CFH LINE# 578 + C:0FF5H LINE# 571 + C:0FF5H LINE# 572 + C:0FF5H LINE# 574 + C:0FF7H LINE# 575 + C:0FF9H LINE# 576 + C:1001H LINE# 577 ------- ENDPROC DELAY10MS ------- ENDMOD MAIN ------- MODULE LCD -BL51 BANKED LINKER/LOCATER V6.22 05/01/2022 13:48:31 PAGE 14 - - C:0000H SYMBOL _ICE_DUMMY_ D:0080H PUBLIC P0 D:0090H PUBLIC P1 - C:16E6H PUBLIC _LcdWriteData + C:1018H PUBLIC _LcdWriteData B:0090H.6 PUBLIC LCD1602_RS B:0090H.5 PUBLIC LCD1602_RW - C:158EH PUBLIC LcdInit + C:0EC0H PUBLIC LcdInit B:0090H.4 PUBLIC LCD1602_E - C:16DCH PUBLIC _LcdWriteCom - C:1422H PUBLIC _Lcd1602_Delay1ms + C:100EH PUBLIC _LcdWriteCom + C:0D7BH PUBLIC _Lcd1602_Delay1ms ------- PROC L?0015 ------- ENDPROC L?0015 ------- PROC _LCD1602_DELAY1MS @@ -800,110 +775,110 @@ SYMBOL TABLE OF MODULE: pro (MAIN) D:0004H SYMBOL a D:0005H SYMBOL b ------- ENDDO - C:1422H LINE# 11 - C:1422H LINE# 12 - C:1422H LINE# 14 - C:142BH LINE# 15 - C:142BH LINE# 16 - C:142DH LINE# 17 - C:142DH LINE# 18 - C:1431H LINE# 19 - C:1433H LINE# 20 - C:143AH LINE# 22 + C:0D7BH LINE# 11 + C:0D7BH LINE# 12 + C:0D7BH LINE# 14 + C:0D84H LINE# 15 +BL51 BANKED LINKER/LOCATER V6.22 05/05/2022 19:42:13 PAGE 14 + + + C:0D84H LINE# 16 + C:0D86H LINE# 17 + C:0D86H LINE# 18 + C:0D8AH LINE# 19 + C:0D8CH LINE# 20 + C:0D93H LINE# 22 ------- ENDPROC _LCD1602_DELAY1MS ------- PROC _LCDWRITECOM D:0007H SYMBOL com - C:16DCH LINE# 31 - C:16DCH LINE# 32 - C:16DCH LINE# 33 - C:16DEH LINE# 34 - C:16E0H LINE# 35 - C:16E0H LINE# 37 - C:16E0H LINE# 38 - C:16E0H LINE# 40 - C:16E0H LINE# 41 - C:16E3H LINE# 42 - C:16E5H LINE# 43 + C:100EH LINE# 31 + C:100EH LINE# 32 + C:100EH LINE# 33 + C:1010H LINE# 34 + C:1012H LINE# 35 + C:1012H LINE# 37 + C:1012H LINE# 38 + C:1012H LINE# 40 + C:1012H LINE# 41 + C:1015H LINE# 42 + C:1017H LINE# 43 ------- ENDPROC _LCDWRITECOM ------- PROC _LCDWRITEDATA D:0007H SYMBOL dat - C:16E6H LINE# 74 - C:16E6H LINE# 75 - C:16E6H LINE# 76 - C:16E8H LINE# 77 - C:16EAH LINE# 78 - C:16EAH LINE# 80 - C:16EAH LINE# 81 - C:16EAH LINE# 83 - C:16EAH LINE# 84 - C:16EDH LINE# 85 - C:16EFH LINE# 86 + C:1018H LINE# 74 + C:1018H LINE# 75 + C:1018H LINE# 76 + C:101AH LINE# 77 + C:101CH LINE# 78 + C:101CH LINE# 80 + C:101CH LINE# 81 + C:101CH LINE# 83 + C:101CH LINE# 84 + C:101FH LINE# 85 + C:1021H LINE# 86 ------- ENDPROC _LCDWRITEDATA -BL51 BANKED LINKER/LOCATER V6.22 05/01/2022 13:48:31 PAGE 15 - - ------- PROC LCDINIT - C:158EH LINE# 116 - C:158EH LINE# 117 - C:158EH LINE# 118 - C:1593H LINE# 119 - C:1598H LINE# 120 - C:159DH LINE# 121 - C:15A2H LINE# 122 + C:0EC0H LINE# 116 + C:0EC0H LINE# 117 + C:0EC0H LINE# 118 + C:0EC5H LINE# 119 + C:0ECAH LINE# 120 + C:0ECFH LINE# 121 + C:0ED4H LINE# 122 ------- ENDPROC LCDINIT ------- ENDMOD LCD ------- MODULE DS1302 C:0000H SYMBOL _ICE_DUMMY_ D:00B0H PUBLIC P3 - C:13DCH PUBLIC _Ds1302Write - C:1604H PUBLIC Ds1302ReadTime - C:161AH PUBLIC Ds1302Init + C:0D35H PUBLIC _Ds1302Write + C:0F36H PUBLIC Ds1302ReadTime + C:0F4CH PUBLIC Ds1302Init B:00B0H.5 PUBLIC SCLK - D:0008H PUBLIC TIME + D:004BH PUBLIC TIME B:00B0H.4 PUBLIC DSIO - C:16A1H PUBLIC WRITE_RTC_ADDR - C:169AH PUBLIC READ_RTC_ADDR + C:0FD3H PUBLIC WRITE_RTC_ADDR + C:0FCCH PUBLIC READ_RTC_ADDR +BL51 BANKED LINKER/LOCATER V6.22 05/05/2022 19:42:13 PAGE 15 + + B:00B0H.3 PUBLIC RST - C:12D1H PUBLIC _Ds1302Read + C:0BF1H PUBLIC _Ds1302Read ------- PROC _DS1302WRITE D:0007H SYMBOL addr D:0005H SYMBOL dat ------- DO D:0006H SYMBOL n ------- ENDDO - C:13DCH LINE# 14 - C:13DCH LINE# 15 - C:13DCH LINE# 17 - C:13DEH LINE# 18 - C:13DFH LINE# 20 - C:13E1H LINE# 21 - C:13E2H LINE# 22 - C:13E4H LINE# 23 - C:13E5H LINE# 25 - C:13E7H LINE# 26 - C:13E7H LINE# 27 - C:13EBH LINE# 28 - C:13EFH LINE# 29 - C:13F1H LINE# 30 - C:13F2H LINE# 31 - C:13F4H LINE# 32 - C:13F5H LINE# 33 - C:13F9H LINE# 34 - C:13FBH LINE# 35 - C:13FBH LINE# 36 - C:13FFH LINE# 37 - C:1403H LINE# 38 - C:1405H LINE# 39 - C:1406H LINE# 40 - C:1408H LINE# 41 - C:1409H LINE# 42 - C:140DH LINE# 44 -BL51 BANKED LINKER/LOCATER V6.22 05/01/2022 13:48:31 PAGE 16 - - - C:140FH LINE# 45 - C:1410H LINE# 46 + C:0D35H LINE# 14 + C:0D35H LINE# 15 + C:0D35H LINE# 17 + C:0D37H LINE# 18 + C:0D38H LINE# 20 + C:0D3AH LINE# 21 + C:0D3BH LINE# 22 + C:0D3DH LINE# 23 + C:0D3EH LINE# 25 + C:0D40H LINE# 26 + C:0D40H LINE# 27 + C:0D44H LINE# 28 + C:0D48H LINE# 29 + C:0D4AH LINE# 30 + C:0D4BH LINE# 31 + C:0D4DH LINE# 32 + C:0D4EH LINE# 33 + C:0D52H LINE# 34 + C:0D54H LINE# 35 + C:0D54H LINE# 36 + C:0D58H LINE# 37 + C:0D5CH LINE# 38 + C:0D5EH LINE# 39 + C:0D5FH LINE# 40 + C:0D61H LINE# 41 + C:0D62H LINE# 42 + C:0D66H LINE# 44 + C:0D68H LINE# 45 + C:0D69H LINE# 46 ------- ENDPROC _DS1302WRITE ------- PROC _DS1302READ D:0007H SYMBOL addr @@ -912,124 +887,124 @@ SYMBOL TABLE OF MODULE: pro (MAIN) D:0006H SYMBOL dat D:0007H SYMBOL dat1 ------- ENDDO - C:12D1H LINE# 48 - C:12D1H LINE# 49 - C:12D1H LINE# 51 - C:12D3H LINE# 52 - C:12D4H LINE# 54 - C:12D6H LINE# 55 - C:12D7H LINE# 56 - C:12D9H LINE# 57 - C:12DAH LINE# 59 - C:12DCH LINE# 60 - C:12DCH LINE# 61 - C:12E0H LINE# 62 - C:12E4H LINE# 63 - C:12E6H LINE# 64 - C:12E7H LINE# 65 - C:12E9H LINE# 66 - C:12EAH LINE# 67 - C:12EEH LINE# 68 - C:12EFH LINE# 69 - C:12F1H LINE# 70 - C:12F1H LINE# 71 - C:12F6H LINE# 72 - C:1302H LINE# 73 - C:1304H LINE# 74 - C:1305H LINE# 75 - C:1307H LINE# 76 - C:1308H LINE# 77 - C:130CH LINE# 79 - C:130EH LINE# 80 - C:130FH LINE# 81 - C:1311H LINE# 82 - C:1312H LINE# 83 - C:1314H LINE# 84 - C:1315H LINE# 85 - C:1317H LINE# 86 - C:1318H LINE# 87 - C:131AH LINE# 88 + C:0BF1H LINE# 48 + C:0BF1H LINE# 49 + C:0BF1H LINE# 51 + C:0BF3H LINE# 52 + C:0BF4H LINE# 54 + C:0BF6H LINE# 55 + C:0BF7H LINE# 56 + C:0BF9H LINE# 57 + C:0BFAH LINE# 59 + C:0BFCH LINE# 60 + C:0BFCH LINE# 61 + C:0C00H LINE# 62 +BL51 BANKED LINKER/LOCATER V6.22 05/05/2022 19:42:13 PAGE 16 + + + C:0C04H LINE# 63 + C:0C06H LINE# 64 + C:0C07H LINE# 65 + C:0C09H LINE# 66 + C:0C0AH LINE# 67 + C:0C0EH LINE# 68 + C:0C0FH LINE# 69 + C:0C11H LINE# 70 + C:0C11H LINE# 71 + C:0C16H LINE# 72 + C:0C22H LINE# 73 + C:0C24H LINE# 74 + C:0C25H LINE# 75 + C:0C27H LINE# 76 + C:0C28H LINE# 77 + C:0C2CH LINE# 79 + C:0C2EH LINE# 80 + C:0C2FH LINE# 81 + C:0C31H LINE# 82 + C:0C32H LINE# 83 + C:0C34H LINE# 84 + C:0C35H LINE# 85 + C:0C37H LINE# 86 + C:0C38H LINE# 87 + C:0C3AH LINE# 88 ------- ENDPROC _DS1302READ ------- PROC DS1302INIT ------- DO D:0007H SYMBOL n ------- ENDDO - C:161AH LINE# 90 - C:161AH LINE# 91 - C:161AH LINE# 93 - C:1621H LINE# 94 - C:1623H LINE# 95 -BL51 BANKED LINKER/LOCATER V6.22 05/01/2022 13:48:31 PAGE 17 - - - C:1623H LINE# 97 - C:1627H LINE# 98 + C:0F4CH LINE# 90 + C:0F4CH LINE# 91 + C:0F4CH LINE# 93 + C:0F53H LINE# 94 + C:0F55H LINE# 95 + C:0F55H LINE# 97 + C:0F59H LINE# 98 ------- ENDPROC DS1302INIT ------- PROC DS1302READTIME ------- DO D:0003H SYMBOL n ------- ENDDO - C:1604H LINE# 101 - C:1604H LINE# 102 - C:1604H LINE# 104 - C:1606H LINE# 105 - C:1606H LINE# 106 - C:1615H LINE# 107 - C:1619H LINE# 108 + C:0F36H LINE# 101 + C:0F36H LINE# 102 + C:0F36H LINE# 104 + C:0F38H LINE# 105 + C:0F38H LINE# 106 + C:0F47H LINE# 107 + C:0F4BH LINE# 108 ------- ENDPROC DS1302READTIME ------- ENDMOD DS1302 ------- MODULE I2C C:0000H SYMBOL _ICE_DUMMY_ D:00A0H PUBLIC P2 - C:135DH PUBLIC _I2cSendByte - C:16F0H PUBLIC I2cStop - C:16ADH PUBLIC Delay10us + C:0C7DH PUBLIC _I2cSendByte + C:1022H PUBLIC I2cStop +BL51 BANKED LINKER/LOCATER V6.22 05/05/2022 19:42:13 PAGE 17 + + + C:0FDFH PUBLIC Delay10us B:00A0H.0 PUBLIC SDA - C:14D6H PUBLIC _At24c02Read + C:0E08H PUBLIC _At24c02Read B:00A0H.1 PUBLIC SCL - C:166FH PUBLIC I2cStart - C:15A7H PUBLIC _At24c02Write - C:148BH PUBLIC I2cReadByte - C:16A8H SYMBOL L?0024 + C:0FA1H PUBLIC I2cStart + C:0ED9H PUBLIC _At24c02Write + C:0DBDH PUBLIC I2cReadByte + C:0FDAH SYMBOL L?0024 ------- PROC L?0023 ------- ENDPROC L?0023 - C:16A8H SYMBOL L?0024 + C:0FDAH SYMBOL L?0024 ------- PROC DELAY10US ------- DO D:0006H SYMBOL a D:0007H SYMBOL b ------- ENDDO - C:16ADH LINE# 10 - C:16ADH LINE# 11 - C:16ADH LINE# 13 - C:16AFH LINE# 14 - C:16B5H LINE# 16 + C:0FDFH LINE# 10 + C:0FDFH LINE# 11 + C:0FDFH LINE# 13 + C:0FE1H LINE# 14 + C:0FE7H LINE# 16 ------- ENDPROC DELAY10US ------- PROC I2CSTART - C:166FH LINE# 25 - C:166FH LINE# 26 - C:166FH LINE# 27 - C:1671H LINE# 28 - C:1671H LINE# 29 - C:1671H LINE# 30 - C:1674H LINE# 31 - C:1676H LINE# 32 - C:1679H LINE# 33 - C:167BH LINE# 34 + C:0FA1H LINE# 25 + C:0FA1H LINE# 26 + C:0FA1H LINE# 27 + C:0FA3H LINE# 28 + C:0FA3H LINE# 29 + C:0FA3H LINE# 30 + C:0FA6H LINE# 31 + C:0FA8H LINE# 32 + C:0FABH LINE# 33 + C:0FADH LINE# 34 ------- ENDPROC I2CSTART ------- PROC I2CSTOP -BL51 BANKED LINKER/LOCATER V6.22 05/01/2022 13:48:31 PAGE 18 - - - C:16F0H LINE# 44 - C:16F0H LINE# 45 - C:16F0H LINE# 46 - C:16F2H LINE# 47 - C:16F2H LINE# 48 - C:16F2H LINE# 49 - C:16F5H LINE# 50 - C:16F7H LINE# 51 + C:1022H LINE# 44 + C:1022H LINE# 45 + C:1022H LINE# 46 + C:1024H LINE# 47 + C:1024H LINE# 48 + C:1024H LINE# 49 + C:1027H LINE# 50 + C:1029H LINE# 51 ------- ENDPROC I2CSTOP ------- PROC _I2CSENDBYTE D:0005H SYMBOL dat @@ -1037,140 +1012,143 @@ SYMBOL TABLE OF MODULE: pro (MAIN) D:0003H SYMBOL a D:0002H SYMBOL b ------- ENDDO - C:135DH LINE# 61 - C:135FH LINE# 62 - C:135FH LINE# 63 - C:1362H LINE# 64 - C:1362H LINE# 65 - C:1362H LINE# 66 - C:136DH LINE# 67 - C:1371H LINE# 68 - C:1371H LINE# 69 - C:1371H LINE# 70 - C:1374H LINE# 71 - C:1376H LINE# 72 - C:1379H LINE# 73 - C:137DH LINE# 74 - C:137FH LINE# 75 - C:1382H LINE# 76 - C:1384H LINE# 77 - C:1387H LINE# 78 - C:1387H LINE# 79 - C:1388H LINE# 80 - C:138EH LINE# 81 - C:138EH LINE# 82 - C:1390H LINE# 83 - C:1393H LINE# 84 - C:1396H LINE# 85 - C:1396H LINE# 86 - C:1396H LINE# 87 - C:1398H LINE# 88 - C:139BH LINE# 89 - C:139DH LINE# 90 + C:0C7DH LINE# 61 + C:0C7FH LINE# 62 + C:0C7FH LINE# 63 + C:0C82H LINE# 64 + C:0C82H LINE# 65 + C:0C82H LINE# 66 + C:0C8DH LINE# 67 +BL51 BANKED LINKER/LOCATER V6.22 05/05/2022 19:42:13 PAGE 18 + + + C:0C91H LINE# 68 + C:0C91H LINE# 69 + C:0C91H LINE# 70 + C:0C94H LINE# 71 + C:0C96H LINE# 72 + C:0C99H LINE# 73 + C:0C9DH LINE# 74 + C:0C9FH LINE# 75 + C:0CA2H LINE# 76 + C:0CA4H LINE# 77 + C:0CA7H LINE# 78 + C:0CA7H LINE# 79 + C:0CA8H LINE# 80 + C:0CAEH LINE# 81 + C:0CAEH LINE# 82 + C:0CB0H LINE# 83 + C:0CB3H LINE# 84 + C:0CB6H LINE# 85 + C:0CB6H LINE# 86 + C:0CB6H LINE# 87 + C:0CB8H LINE# 88 + C:0CBBH LINE# 89 + C:0CBDH LINE# 90 ------- ENDPROC _I2CSENDBYTE ------- PROC I2CREADBYTE ------- DO D:0005H SYMBOL a D:0004H SYMBOL dat ------- ENDDO - C:148BH LINE# 99 - C:148BH LINE# 100 - C:148BH LINE# 101 - C:148EH LINE# 102 - C:1490H LINE# 103 - C:1493H LINE# 104 -BL51 BANKED LINKER/LOCATER V6.22 05/01/2022 13:48:31 PAGE 19 - - - C:1493H LINE# 105 - C:1493H LINE# 106 - C:1495H LINE# 107 - C:1498H LINE# 108 - C:149CH LINE# 109 - C:14A2H LINE# 110 - C:14A5H LINE# 111 - C:14A7H LINE# 112 - C:14AAH LINE# 113 - C:14AEH LINE# 114 - C:14B0H LINE# 115 + C:0DBDH LINE# 99 + C:0DBDH LINE# 100 + C:0DBDH LINE# 101 + C:0DC0H LINE# 102 + C:0DC2H LINE# 103 + C:0DC5H LINE# 104 + C:0DC5H LINE# 105 + C:0DC5H LINE# 106 + C:0DC7H LINE# 107 + C:0DCAH LINE# 108 + C:0DCEH LINE# 109 + C:0DD4H LINE# 110 + C:0DD7H LINE# 111 + C:0DD9H LINE# 112 + C:0DDCH LINE# 113 + C:0DE0H LINE# 114 + C:0DE2H LINE# 115 ------- ENDPROC I2CREADBYTE ------- PROC _AT24C02WRITE D:0001H SYMBOL addr D:0004H SYMBOL dat - C:15A7H LINE# 125 - C:15ABH LINE# 126 - C:15ABH LINE# 127 - C:15AEH LINE# 128 - C:15B3H LINE# 129 - C:15B8H LINE# 130 - C:15BDH LINE# 131 + C:0ED9H LINE# 125 + C:0EDDH LINE# 126 + C:0EDDH LINE# 127 + C:0EE0H LINE# 128 + C:0EE5H LINE# 129 + C:0EEAH LINE# 130 + C:0EEFH LINE# 131 +BL51 BANKED LINKER/LOCATER V6.22 05/05/2022 19:42:13 PAGE 19 + + ------- ENDPROC _AT24C02WRITE ------- PROC _AT24C02READ D:0004H SYMBOL addr ------- DO D:0005H SYMBOL num ------- ENDDO - C:14D6H LINE# 140 - C:14D8H LINE# 141 - C:14D8H LINE# 143 - C:14DBH LINE# 144 - C:14E0H LINE# 145 - C:14E5H LINE# 146 - C:14E8H LINE# 147 - C:14EDH LINE# 148 - C:14F2H LINE# 149 - C:14F5H LINE# 150 - C:14F7H LINE# 151 + C:0E08H LINE# 140 + C:0E0AH LINE# 141 + C:0E0AH LINE# 143 + C:0E0DH LINE# 144 + C:0E12H LINE# 145 + C:0E17H LINE# 146 + C:0E1AH LINE# 147 + C:0E1FH LINE# 148 + C:0E24H LINE# 149 + C:0E27H LINE# 150 + C:0E29H LINE# 151 ------- ENDPROC _AT24C02READ ------- ENDMOD I2C ------- MODULE DS18B20 C:0000H SYMBOL _ICE_DUMMY_ D:00B0H PUBLIC P3 - C:139EH PUBLIC DS18B20_ReadByte - C:14B1H PUBLIC DS18B20_Init - C:14F8H PUBLIC DS18B20_ReadTemp + C:0CBEH PUBLIC DS18B20_ReadByte + C:0DE3H PUBLIC DS18B20_Init + C:0E2AH PUBLIC DS18B20_ReadTemp B:00B0H.2 PUBLIC DS18B20 - C:1327H PUBLIC _DS18B20_WriteByte - C:1282H PUBLIC Temper_change - C:1557H PUBLIC _delay_ms + C:0C47H PUBLIC _DS18B20_WriteByte + C:0BA2H PUBLIC Temper_change + C:0E89H PUBLIC _delay_ms ------- PROC _DELAY_MS D:0006H SYMBOL x ------- DO D:0006H SYMBOL y D:0004H SYMBOL z -BL51 BANKED LINKER/LOCATER V6.22 05/01/2022 13:48:31 PAGE 20 - - ------- ENDDO - C:1557H LINE# 5 - C:1557H LINE# 6 - C:1557H LINE# 8 - C:1560H LINE# 9 - C:1574H LINE# 10 + C:0E89H LINE# 5 + C:0E89H LINE# 6 + C:0E89H LINE# 8 + C:0E92H LINE# 9 + C:0EA6H LINE# 10 ------- ENDPROC _DELAY_MS ------- PROC DS18B20_INIT ------- DO D:0003H SYMBOL i ------- ENDDO - C:14B1H LINE# 12 - C:14B1H LINE# 13 - C:14B1H LINE# 15 - C:14B3H LINE# 16 - C:14B5H LINE# 17 - C:14BBH LINE# 18 - C:14BDH LINE# 19 - C:14BFH LINE# 20 - C:14C2H LINE# 21 - C:14C2H LINE# 22 - C:14C9H LINE# 23 - C:14CAH LINE# 24 - C:14D0H LINE# 25 - C:14D0H LINE# 26 - C:14D3H LINE# 27 - C:14D3H LINE# 28 - C:14D3H LINE# 29 - C:14D5H LINE# 30 + C:0DE3H LINE# 12 + C:0DE3H LINE# 13 + C:0DE3H LINE# 15 + C:0DE5H LINE# 16 + C:0DE7H LINE# 17 + C:0DEDH LINE# 18 + C:0DEFH LINE# 19 + C:0DF1H LINE# 20 + C:0DF4H LINE# 21 + C:0DF4H LINE# 22 + C:0DFBH LINE# 23 +BL51 BANKED LINKER/LOCATER V6.22 05/05/2022 19:42:13 PAGE 20 + + + C:0DFCH LINE# 24 + C:0E02H LINE# 25 + C:0E02H LINE# 26 + C:0E05H LINE# 27 + C:0E05H LINE# 28 + C:0E05H LINE# 29 + C:0E07H LINE# 30 ------- ENDPROC DS18B20_INIT ------- PROC DS18B20_READBYTE ------- DO @@ -1179,97 +1157,94 @@ SYMBOL TABLE OF MODULE: pro (MAIN) D:0006H SYMBOL i D:0004H SYMBOL j ------- ENDDO - C:139EH LINE# 32 - C:139EH LINE# 33 - C:139EH LINE# 36 - C:13A2H LINE# 37 - C:13A2H LINE# 38 - C:13A4H LINE# 39 - C:13A8H LINE# 40 - C:13AAH LINE# 41 - C:13AEH LINE# 42 - C:13B2H LINE# 43 - C:13B6H LINE# 44 - C:13C2H LINE# 45 - C:13C6H LINE# 46 - C:13D0H LINE# 47 - C:13D9H LINE# 48 - C:13DBH LINE# 49 + C:0CBEH LINE# 32 + C:0CBEH LINE# 33 + C:0CBEH LINE# 36 + C:0CC2H LINE# 37 + C:0CC2H LINE# 38 + C:0CC4H LINE# 39 + C:0CC8H LINE# 40 + C:0CCAH LINE# 41 + C:0CCEH LINE# 42 + C:0CD2H LINE# 43 + C:0CD6H LINE# 44 + C:0CE2H LINE# 45 + C:0CE6H LINE# 46 + C:0CF0H LINE# 47 + C:0CF9H LINE# 48 + C:0CFBH LINE# 49 ------- ENDPROC DS18B20_READBYTE ------- PROC L?0042 ------- ENDPROC L?0042 ------- PROC _DS18B20_WRITEBYTE -BL51 BANKED LINKER/LOCATER V6.22 05/01/2022 13:48:31 PAGE 21 - - D:0007H SYMBOL dat ------- DO - D:005FH SYMBOL i + D:001BH SYMBOL i D:0002H SYMBOL j ------- ENDDO - C:1327H LINE# 51 - C:1327H LINE# 52 - C:1327H LINE# 54 - C:132AH LINE# 55 - C:132AH LINE# 56 - C:132CH LINE# 57 - C:1334H LINE# 58 - C:1338H LINE# 59 - C:133EH LINE# 60 - C:134BH LINE# 61 - C:134DH LINE# 62 - C:1351H LINE# 63 - C:135CH LINE# 64 + C:0C47H LINE# 51 + C:0C47H LINE# 52 + C:0C47H LINE# 54 + C:0C4AH LINE# 55 + C:0C4AH LINE# 56 + C:0C4CH LINE# 57 + C:0C54H LINE# 58 + C:0C58H LINE# 59 + C:0C5EH LINE# 60 + C:0C6BH LINE# 61 + C:0C6DH LINE# 62 + C:0C71H LINE# 63 + C:0C7CH LINE# 64 ------- ENDPROC _DS18B20_WRITEBYTE ------- PROC DS18B20_READTEMP ------- DO D:0006H SYMBOL temp +BL51 BANKED LINKER/LOCATER V6.22 05/05/2022 19:42:13 PAGE 21 + + D:0007H SYMBOL tmh - D:005EH SYMBOL tml + D:001AH SYMBOL tml ------- ENDDO - C:14F8H LINE# 66 - C:14F8H LINE# 67 - C:14F8H LINE# 68 - C:14FBH LINE# 70 - C:14FBH LINE# 71 - C:14FBH LINE# 72 - C:14FEH LINE# 73 - C:1503H LINE# 75 - C:1503H LINE# 76 - C:1503H LINE# 77 - C:1506H LINE# 78 - C:150BH LINE# 80 - C:1510H LINE# 81 - C:1513H LINE# 82 - C:1513H LINE# 83 - C:1515H LINE# 84 - C:1518H LINE# 85 - C:1518H LINE# 86 + C:0E2AH LINE# 66 + C:0E2AH LINE# 67 + C:0E2AH LINE# 68 + C:0E2DH LINE# 70 + C:0E2DH LINE# 71 + C:0E2DH LINE# 72 + C:0E30H LINE# 73 + C:0E35H LINE# 75 + C:0E35H LINE# 76 + C:0E35H LINE# 77 + C:0E38H LINE# 78 + C:0E3DH LINE# 80 + C:0E42H LINE# 81 + C:0E45H LINE# 82 + C:0E45H LINE# 83 + C:0E47H LINE# 84 + C:0E4AH LINE# 85 + C:0E4AH LINE# 86 ------- ENDPROC DS18B20_READTEMP ------- PROC TEMPER_CHANGE ------- DO D:0006H SYMBOL temper - D:005AH SYMBOL tp + D:0016H SYMBOL tp ------- ENDDO - C:1282H LINE# 89 - C:1282H LINE# 90 - C:1282H LINE# 94 - C:1285H LINE# 95 - C:128BH LINE# 96 - C:128BH LINE# 97 - C:1290H LINE# 98 - C:1296H LINE# 99 -BL51 BANKED LINKER/LOCATER V6.22 05/01/2022 13:48:31 PAGE 22 - - - C:1296H LINE# 100 - C:1296H LINE# 101 - C:1298H LINE# 103 - C:1298H LINE# 104 - C:12B2H LINE# 105 - C:12D0H LINE# 106 - C:12D0H LINE# 107 - C:12D0H LINE# 108 + C:0BA2H LINE# 89 + C:0BA2H LINE# 90 + C:0BA2H LINE# 94 + C:0BA5H LINE# 95 + C:0BABH LINE# 96 + C:0BABH LINE# 97 + C:0BB0H LINE# 98 + C:0BB6H LINE# 99 + C:0BB6H LINE# 100 + C:0BB6H LINE# 101 + C:0BB8H LINE# 103 + C:0BB8H LINE# 104 + C:0BD2H LINE# 105 + C:0BF0H LINE# 106 + C:0BF0H LINE# 107 + C:0BF0H LINE# 108 ------- ENDPROC TEMPER_CHANGE ------- ENDMOD DS18B20 @@ -1284,6 +1259,9 @@ SYMBOL TABLE OF MODULE: pro (MAIN) ------- MODULE ?C?FPDIV C:0204H PUBLIC ?C?FPDIV +BL51 BANKED LINKER/LOCATER V6.22 05/05/2022 19:42:13 PAGE 22 + + ------- ENDMOD ?C?FPDIV ------- MODULE ?C?FPCMP @@ -1301,72 +1279,33 @@ SYMBOL TABLE OF MODULE: pro (MAIN) C:0358H PUBLIC ?C?CASTF ------- ENDMOD ?C?CASTF - ------- MODULE PRINTF - D:0058H PUBLIC ?_PRINTF?BYTE - D:0058H PUBLIC ?_SPRINTF?BYTE - C:0704H PUBLIC _PRINTF - C:06FEH PUBLIC _SPRINTF - ------- ENDMOD PRINTF - - ------- MODULE ?C?FPROUND - C:03D9H PUBLIC ?C?FPROUND - ------- ENDMOD ?C?FPROUND - - ------- MODULE ?C?FPCONVERT - C:0408H PUBLIC ?C?FPCONVERT - ------- ENDMOD ?C?FPCONVERT - - ------- MODULE ?C?FTNPWR - C:053BH PUBLIC ?C?FTNPWR - ------- ENDMOD ?C?FTNPWR -BL51 BANKED LINKER/LOCATER V6.22 05/01/2022 13:48:31 PAGE 23 - - - ------- MODULE ?C?CLDPTR - C:057BH PUBLIC ?C?CLDPTR + C:03D9H PUBLIC ?C?CLDPTR ------- ENDMOD ?C?CLDPTR - ------- MODULE ?C?CLDOPTR - C:0594H PUBLIC ?C?CLDOPTR - ------- ENDMOD ?C?CLDOPTR - - ------- MODULE ?C?CSTPTR - C:05C1H PUBLIC ?C?CSTPTR - ------- ENDMOD ?C?CSTPTR - ------- MODULE ?C?UIDIV - C:05D3H PUBLIC ?C?UIDIV + C:03F2H PUBLIC ?C?UIDIV ------- ENDMOD ?C?UIDIV ------- MODULE ?C?SIDIV - C:0628H PUBLIC ?C?SIDIV + C:0447H PUBLIC ?C?SIDIV ------- ENDMOD ?C?SIDIV ------- MODULE ?C?LNEG - C:065EH PUBLIC ?C?LNEG + C:047DH PUBLIC ?C?LNEG ------- ENDMOD ?C?LNEG - ------- MODULE ?C?PLDIIDATA - C:066CH PUBLIC ?C?PLDIIDATA - ------- ENDMOD ?C?PLDIIDATA - - ------- MODULE ?C?CCASE - C:067CH PUBLIC ?C?CCASE - ------- ENDMOD ?C?CCASE - - ------- MODULE PUTCHAR - C:1464H PUBLIC _PUTCHAR - ------- ENDMOD PUTCHAR - *** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS SEGMENT: ?PR?INIT_BH1750?MAIN +*** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS + SEGMENT: ?PR?_BLUETOOTH_SET?MAIN + *** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS SEGMENT: ?PR?_AT24C02WRITE?I2C *** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS SEGMENT: ?PR?_AT24C02READ?I2C -Program Size: data=99.1 xdata=0 code=5899 -LINK/LOCATE RUN COMPLETE. 3 WARNING(S), 0 ERROR(S) +Program Size: data=79.1 xdata=0 code=4152 +LINK/LOCATE RUN COMPLETE. 4 WARNING(S), 0 ERROR(S) diff --git a/pro.build_log.htm b/pro.build_log.htm index a0859b0..10911e0 100644 --- a/pro.build_log.htm +++ b/pro.build_log.htm @@ -23,17 +23,22 @@ Project File Date: 04/30/2022