void UID_READ(u8 *PP)
{
u8 i;
EA =0;
UN_TA;
CHPCON |= 0x01; //IAPEN = 1, enable IAP mode CHPCON TA保护
IAPCN =UID_AP;
IAPAH=0;
for(i=0;i<12;i++)
{
IAPAL=i;
UN_TA;
IAPTRG |= 0x01; //write ‘1’ to IAPGO to trigger IAP process
PP[i]=IAPFD;
}
UN_TA;
CHPCON &= ~0x01; //IAPEN = 0, disable IAP mode
EA =1;
}
|