stc89c54单片机红外接收后,进入epprom存储时,iap代码跑不动...
请高手帮忙解答,如果要程序的话,可以发看看
程序在isp上卡住了,是什么意思呀?
就是epprom 中的iap 操作擦除、读、写控制驱动的时候, 代码程序跑不下去; 有加入红外接收的时候是跑不下去,没有的时候,正常完成工作
大神们,要看代码的话,说一声, 本人调了很久了,请帮助,
这个还真没搞过,要不你把程序贴上来吧
接收红外模块:
bit decode(void)
{
unsigned char i;
EA=0; //all interrupt close
TR0=0; //timer 0 close
TH0=0; //timr0 dingshi high 8bit clearing 0
TL0=0; //timer0 start value
TR2=0; //stop timer2 work
ET2=1; //timer2 interrupt enable
TH2=0; //timer2 start value
TL2=0;
while(IR==1);// if ir is high waiting
TR0=1; // open timer 0
for(i=0;i<150;i++)
{
while(IR==0);// if ir is low waiting
TR2=1; //timer2 open
TR0=0; //timer0 close
low_dianpingH[i] =TH0; //
low_dianpingL[i] =TL0;
TH0 = 0; //clearing
TL0 = 0;
while(IR==1)
{
if(TH2 == 0xff) //timer2 yichu caozuo
{
high_dianpingH[i] = TH2;
high_dianpingL[i] = TL2;
return 1;
}
}
TR0=1; //open timer0 ?
TR2=0; //close timer2 ?
high_dianpingH[i] = TH2;
high_dianpingL[i] = TL2;
TH2 = 0; //clearing
TL2 = 0;
Led_av1=0;
}
}
void study_hongwai_exe(unsigned int study_add)
{
unsigned int add_temp;
unsigned char i;
IR =1;//因为红外以低电平结束,所以必须拉高引脚为下次红外做准备
memset(low_dianpingH,0,sizeof(low_dianpingH));
memset(low_dianpingL,0,sizeof(low_dianpingL));
memset(high_dianpingH,0,sizeof(high_dianpingH));
memset(high_dianpingL,0,sizeof(high_dianpingL));
// Beep_On(35);
// led_con(0);
while(decode() != 1);
Led_pc=0;
IR = 1;
EA = 1;
TR2 = 1;
ET2 = 1;
TL2 = RCAP2L = BAUDLOADL; //T2初始值的装载
TH2 = RCAP2H = BAUDLOADH;
// led_con(1);
EEPROM_Sector_Program(study_add); //清空
add_temp = study_add;
for(i=0; i<150; i++)
{
EEPROM_Byte_Write(add_temp,low_dianpingL[i]);
add_temp++;
EEPROM_Byte_Write(add_temp,low_dianpingH[i]);
add_temp++;
EEPROM_Byte_Write(add_temp,high_dianpingL[i]);
add_temp++;
EEPROM_Byte_Write(add_temp,high_dianpingH[i]);
add_temp++;
}
Led_av2=0;
// Beep_On(35);
}
主要模块,就是这些, 加入红外的时候,eeprom卡程序卡了, 帮忙看看