www.pudn.com > STC89C52.rar > Device.c, change:2011-11-28,size:317b


 
 
#define  DEVICE_GLOBALS 
#include "Device.h" 
 
 
void Timer0_Init(void) 
{    
	TMOD=0x21;					//TMODE=00100001  T0设为16定时器,T1设为8重载定时器 
 	 
 	TL0=(0xFFFF-54645)%0xFF;	//T0=10ms 
 	TH0=(0xFFFF-54645)/0xFF; 	//32.768MHz 
	 
	ET0=1; 
	TR0=1; 
} 
 
 
void InitHardware(void)  
{    
	Timer0_Init(); 
}