T / C is counted by adding 1, and counting by subtracting 1 is not supported. When t / c works in timer, count the pulse of 12 frequency division of oscillation source, that is, add 1 to the count value of each machine cycle, and the count frequency = the current working frequency of single chip microcomputer / 12. When the single chip microcomputer works at 12Mhz, the counting frequency = 1MHz, and the single chip microcomputer adds 1 for every 1US counting value. When t / c works in the counter, the count pulse comes from the external pulse input pin t0 (p3.4) T1 (p3.5). Add 1 to the counter value when t0 or T1 pin is in negative jump. It takes 2 machine cycles to identify the negative jump on the pin, that is, 24 oscillation cycles. Therefore, the highest frequency of the countable external pulse input by t0 or T1 is the current working frequency of the single chip microcomputer / 24. When the single chip microcomputer works at 12Mhz, the highest counting frequency is 500KHz. If the frequency is higher than this, the counting will be wrong