芯片解密|单片机解密|IC解密|芯片破解|芯片复制| PCB抄板|软件开发

飞芯科技-芯片解密|单片机解密|IC解密|芯片破解|芯片复制| PCB抄板|软件开发

芯片解密单片机+BMP180+LCD1602温度气压高度计源程序

  1. 芯片解密#include  <REG52.H>
  2. 芯片解密#include  <math.h>    //Keil library
  3. 芯片解密#include  <stdlib.h>  //Keil library
  4. 芯片解密#include  <stdio.h>   //Keil library
  5. 芯片解密#include  <INTRINS.H> //Keil library

  6. #define   uchar unsigned char
  7. #define   uint unsigned int
  8. #define BMP085_SlaveAddress   0xee  //定义器件在IIC总线中的从地址                              
  9. #define OSS 0// Oversampling Setting (note: code is not set up to use other OSS values)
  10. #define   DataPort P0    //LCD1602数据端口

  11. sbit      LCM_RS=P2^4;   //LCD1602命令端口               
  12. sbit      LCM_RW=P2^5;   //LCD1602命令端口               
  13. sbit      LCM_EN=P2^6;   //LCD1602命令端口
  14. sbit  SCL=P1^0;      //IIC时钟引脚定义
  15. sbit   SDA=P1^1;      //IIC数据引脚定义
  16. int  dis_data;                              //变量
  17. typedef unsigned char  BYTE;
  18. typedef unsigned short WORD;
  19. long  temperature;//温度值
  20. long  pressure;//压力值
  21. long  height;//相对海拔高度值
  22. short ac1;
  23. short ac2;
  24. short ac3;
  25. unsigned short ac4;
  26. unsigned short ac5;
  27. unsigned short ac6;
  28. short b1;
  29. short b2;
  30. short mb;
  31. short mc;
  32. short md;

  33. void delay(unsigned int k)        
  34. {                                                
  35. unsigned int i,j;                                
  36. for(i=0;i<k;i++)
  37. {                        
  38. for(j=0;j<121;j++)                        
  39. {;}}                                                
  40. }
  41. /*******************************/
  42. void WaitForEnable(void)        
  43. {                                       
  44. DataPort=0xff;               
  45. LCM_RS=0;LCM_RW=1;_nop_();
  46. LCM_EN=1;_nop_();_nop_();
  47. while(DataPort&0x80);        
  48. LCM_EN=0;                                
  49. }                                       
  50. /*******************************/
  51. void WriteCommandLCM(uchar CMD,uchar Attribc)
  52. {                                       
  53. if(Attribc)WaitForEnable();        
  54. LCM_RS=0;LCM_RW=0;_nop_();
  55. DataPort=CMD;_nop_();        
  56. LCM_EN=1;_nop_();_nop_();LCM_EN=0;
  57. }                                       
  58. /*******************************/
  59. void WriteDataLCM(uchar dataW)
  60. {                                       
  61. WaitForEnable();               
  62. LCM_RS=1;LCM_RW=0;_nop_();
  63. DataPort=dataW;_nop_();        
  64. LCM_EN=1;_nop_();_nop_();LCM_EN=0;
  65. }               
  66. /***********************************/
  67. void InitLcd()                                
  68. {                        
  69. WriteCommandLCM(0x38,1);        
  70. WriteCommandLCM(0x08,1);        
  71. WriteCommandLCM(0x01,1);        
  72. WriteCommandLCM(0x06,1);        
  73. WriteCommandLCM(0x0c,1);
  74. }                        



联系方式

地址:石家庄市新华区民族路77号华强广场D座2009
电话:0311-88816616/87087811
手机:13315190088
传真:0311-67901001
联系人:张工
网址:www.feixindz.com
邮箱:feixindz@163.com
微信:xinpianjiemi
QQ:527263666/568069805

在线客服
热线电话

企业微信