'-------------------------------------------------------------- ' (c) 1998 MCS Electronics '-------------------------------------------------------------- ' file: TIMER2c.BAS ' *TIMER2 used as a clockgenerator ' Select 8052.dat or 89s8252.dat '-------------------------------------------------------------- Dim C As Word '--------------- TIMER 2 modes ------------------ '0=16-bit auto reload '1=16-bit capture '2=baudrate generator '3=receive only '4=transmit only '5=clock output '------------------------------------------------ Config Timer2 = Timer , Mode = 5 'The output frequency = (fOSC / 4) / (65536-CAPTURE) 'So when used with 12Mhz clock the minimum freq would be '(12/4)=3000000 / (65535)= 'The maximum freq would be : 46 Hz '3000000 / 1 = 3 MHz. Capture = 65535 'will produce 3MHz End