This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

why the same 'word' can't do the same 'job'?

On AT89S52 platform .T0 interrupt_routine like following:

void Timer0(void) interrupt TF0_VECTOR
{
	static unsigned char data cF=0;
	static unsigned char data c=0, cC= 0;
	T0RC  = -(SYSCLK/1000/12)*INTERVAL;
	c = c + 1;
	cqq =cqq + 1;
	bMR = ~bMR;
	bFF = ~bFF;
}
when debugged,var 'c' can only switch to '0' or '1',the same to var 'cqq'.why the var can't hold value in increment? And the initial routine is following:
...
	AUXR = 0X00;
	T0RC  = -(SYSCLK/1000/12)*INTERVAL;
	TMOD = 0X01;
	TCON = 0X01;
	TR0  = 1;
   	SCON  = 0X50;
	RCAP2 = -(SYSCLK/32/BAUDRATE);
	T2MOD = 0X00;
	T2CON = 0X34;
	IE = 0X97;
	IP = 0X00;
...
I am sure the interrupt_routine running because port_pin 'bMR' changed orderly.
And so ,all this word is in the other program which running on C8051F020 well.
Can you tell me what'S the different between AT89S52 and C8051F020?How can I solve this problem?
Thanks!

0