/**************************************************/ //eepron写温度
/*
OP_CTM1 &=~bit3|bit2; //禁止IAP
IAPKEY =0x0f; //保护寄存器n个系统时钟
IAPADL =0x00; //写入地址低
IAPADH =0x00; //写入地址高
IAPADE =0x02; //扩展地址eeprom
//IAPDAT //数据寄存器
IAPCTL =bit2; //控制寄存器(写入)
*/
void eeprom_xiewendu() //eepron写温度
{
IAPADE =0x02; //选择eeprom区域
IAPDAT =wendu; //数据
IAPADL =0x01; //地址
IAPADH =0x00;
IAPKEY =0xf0; //保护寄存器n个系统时钟
IAPCTL =bit1; //控制寄存器(写入)
_nop_();
_nop_();
_nop_();
_nop_();
_nop_();
IAPADE =0x00; //返回rom区域
}
/**************************************************/ //eepron读温度
void eeprom_duwendu() //eepron读温度
{
unsigned char code *eedu_a1; //code区
IAPADE =0x02; //选择eeprom区域
//IAPADL =0x01; //地址
//IAPADH =0x00;
eedu_a1 =0x01;
wendu =*eedu_a1;
IAPADE =0x00; //返回rom区域
}