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

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

IC解密74hc595使用方法与单片机驱动源程序

  1. IC解密#include<reg52.h>
  2. IC解密#include<intrins.h>

  3. typedef unsigned char u8;
  4. typedef unsigned int u16;

  5. sbit SH_CP1 = P2^1;
  6. sbit DS = P2^0;
  7. sbit ST_CP1 = P2^2;
  8. sbit SH_CP2 = P2^3;
  9. sbit ST_CP2 = P2^4;

  10. void delay()                                                //延时函数
  11. {
  12.         u8 a, b, c;
  13.         for(a = 0; a < 110; ++a)
  14.                 for(b = 0; b < 110; ++b)
  15.                         for(c = 0; c < 10; ++c);
  16. }

  17. void send_data_74hc595(u16 data_74hc595)                    //传送数据给74hc595
  18. {
  19.         u8 a;
  20.         for(a = 0; a < 8; ++a)
  21.         {
  22.                 DS = (data_74hc595 << a) & 0x80;                    //从高位开始传输
  23.                 SH_CP1 = 0;
  24.                 SH_CP2 = 0;
  25.                 _nop_();
  26.                 _nop_();
  27.                 SH_CP1 = 1;
  28.                 SH_CP2 = 1;
  29.         }
  30. }

  31. void show_74hc595()                                         //数据显示
  32. {
  33.         ST_CP1 = 0;
  34.         ST_CP2 = 0;
  35.         _nop_();
  36.         _nop_();
  37.         ST_CP1 = 1;
  38.         ST_CP2 = 1;
  39. }

  40. void main()
  41. {
  42.         while(1)
  43.         {
  44.                 send_data_74hc595(0x00);                            //依次传输数据,上面的数据传输给第二个595
  45.                 send_data_74hc595(0x01);                            //下面的给第一个·595
  46.                 show_74hc595();                                     //数据显示
  47.                 delay();                                            //延时
  48.                 send_data_74hc595(0x00);
  49.                 send_data_74hc595(0x03);
  50.                 show_74hc595();
  51.                 delay();
  52.                 send_data_74hc595(0x00);
  53.                 send_data_74hc595(0x07);
  54.                 show_74hc595();
  55.                 delay();
  56.                 send_data_74hc595(0x00);
  57.                 send_data_74hc595(0x0f);
  58.                 show_74hc595();
  59.                 delay();
  60.                 send_data_74hc595(0x00);
  61.                 send_data_74hc595(0x1f);
  62.                 show_74hc595();
  63.                 delay();
  64.                 send_data_74hc595(0x00);
  65.                 send_data_74hc595(0x3f);
  66.                 show_74hc595();
  67.                 delay();
  68.                 send_data_74hc595(0x00);
  69.                 send_data_74hc595(0x7f);
  70.                 show_74hc595();
  71.                 delay();
  72.                 send_data_74hc595(0x00);
  73.                 send_data_74hc595(0xff);
  74.                 show_74hc595();
  75.                 delay();

  76.                 send_data_74hc595(0x01);
  77.                 send_data_74hc595(0xff);
  78.                 show_74hc595();
  79.                 delay();
  80.                 send_data_74hc595(0x03);
  81.                 send_data_74hc595(0xff);
  82.                 show_74hc595();
  83.                 delay();
  84.                 send_data_74hc595(0x07);
  85.                 send_data_74hc595(0xff);
  86.                 show_74hc595();
  87.                 delay();
  88.                 send_data_74hc595(0x0f);
  89.                 send_data_74hc595(0xff);
  90.                 show_74hc595();
  91.                 delay();
  92.                 send_data_74hc595(0x1f);
  93.                 send_data_74hc595(0xff);
  94.                 show_74hc595();
  95.                 delay();
  96.                 send_data_74hc595(0x3f);
  97.                 send_data_74hc595(0xff);
  98.                 show_74hc595();
  99.                 delay();
  100.                 send_data_74hc595(0x7f);
  101.                 send_data_74hc595(0xff);
  102.                 show_74hc595();
  103.                 delay();
  104.                 send_data_74hc595(0xff);
  105.                 send_data_74hc595(0xff);
  106.                 show_74hc595();
  107.                 delay();
  108.         }
  109. }



联系方式

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

在线客服
热线电话

企业微信