Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Delay in reality is twice that of Keil and Proteus simulator

Status
Not open for further replies.

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?

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
}
ucont : T89C51AC2
XTAL : 18.432Mhz
Keil: Uvision V4.60.00.0
 
Last edited:

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top