jonnybgood
Full Member level 4
- Joined
- Dec 28, 2010
- Messages
- 214
- Helped
- 3
- Reputation
- 6
- Reaction score
- 1
- Trophy points
- 1,298
- Activity points
- 3,011
I am using a timer delay with polling method. Every thing works fine execpt that when implementend on my dev board, the true delay is twice that of Keil and Proteus simulator. Every crystal frequency setting is correct. Any ideas. I tried to check the X2 in the hardware byte option
in flip but then my UART communication was effected and did not work correctly because of the baud rate being doubled. I had to vary the baud rate on my PC and then it worked fine. Is there any other solution for this problem?
ucont : T89C51AC2
XTAL : 18.432Mhz
Keil: Uvision V4.60.00.0
in flip but then my UART communication was effected and did not work correctly because of the baud rate being doubled. I had to vary the baud rate on my PC and then it worked fine. Is there any other solution for this problem?
Code:
void delay_10m() // Delay generation using Timer 0 mode 1
{
TMOD = 0x01; // Mode1 of Timer0
TH0= 0xC3; // C33FF = 10millisecond delay
TL0 = 0xFF;
TR0 = 1; // Start Timer
while(TF0 == 0); // Polling method
TR0 = 0; // Stop Timer
TF0 = 0; // Clear flag
}
XTAL : 18.432Mhz
Keil: Uvision V4.60.00.0
Last edited: