芯片破解MSP430F5438全智能密码锁程序
- //-----------------------------------------------
- //-----------------密码锁程序--------------------
- //-----------------芯片破解MSP430F5438--晶振11.0592M--
- //***********************************************
- 芯片破解MSP430F5438#include <reg52.h>
- 芯片破解MSP430F5438#include "AT24C01.C"
- 芯片破解MSP430F5438#include "LCD1602.C"
- //---------------------------
- #define uchar unsigned char
- #define uint unsigned int
- static uchar c=0;
- //---------------------------
- sbit K0=P0^0;//0
- sbit K1=P0^1;//1
- sbit K2=P0^2;//2
- sbit K3=P0^3;//确认密码
- sbit K4=P0^4;//修改密码
- //---------------------------
- sbit LE_LED=P3^4;
- sbit LED_LDEOKK=P1^3;
- sbit LED_LEDOK=P1^4;
- sbit LED_OPEN=P1^5;
- sbit beep=P3^3;
- //---------------------------
- uchar tablee [3]; //键值存储器
- uchar tablee2[4]; //常规密码存储器
- //------------------------------
- void delayx(uint i)
- {
- uint w;
- for(w=0;w<i;w++);
- }
- //------------------------------
- void beepo()
- {
- beep=0;
- delayx(5000);
- beep=1;
- }
- //------------------------------数据键盘扫描并返回键值
- shuju_jianpan()
- {
- uchar a=15;
- uchar KEY; //
- if(!K0) //0
- {
- delayx(500);
- while(K0==0);
- beepo();
- a=0;
- }
- //----------------------
- if(!K1) //1
- {
- delayx(500);
- while(K1==0);
- beepo();
- a=1;
- }
- //----------------------
- if(!K2) //2
- {
- delayx(500);
- while(K2==0);
- beepo();
- a=2;
- }
- switch (a)
- {
- case 0: KEY=0; break;
- case 1: KEY=1; break;
- case 2: KEY=2; break;
- case 15:KEY=15;break;
- }
- return (KEY);
- }
- //***********************************************************//
- //***********************************************************//
- void main()
- {
- uchar b;
- uchar u=0;
- uchar e=30;
- uchar f=31;
- uchar y=32;
- uchar nem0=0,nem1=0,nem2=0;
- uchar nem3=0,nem4=0,nem5=0;
- uchar r=0;
- uchar j;
- uchar q=0;
- uchar h=0;
- LE_LED=0;
- LCD1602_0(15,0); //显示PleasePassword
- //---------------------------------------------------------
- //-----------------------------------------置入初始出厂密码
- if(q==0)
- {
- init(); //24c01初始化
- W_AT24C01(e,2); //写入初始密码“111”数据到AT24C01存储器中保存
- delayx(500);
- //------------------
- init();
- W_AT24C01(f,2);
- delayx(500);
- //------------------
- init();
- W_AT24C01(y,2);
- delayx(500);
- q=1;
- }

芯片解密