摘要 |
A method and an apparatus for auto-tracking and compensating a clock frequency are disclosed. The method is suitable for being applied in USB controllers. The apparatus for receiving a data stream includes an oscillator, for generating a sampling clock; a clock extractor, for extracting a system clock according to the data stream and the sampling clock; a pattern extractor, coupled to the clock extractor to extract a plurality of patterns from the data stream according to the system clock; a counter coupled to the pattern extractor for counting the length of the data stream and generating a counting value, according to the sampling clock, in response to the patterns; an arithmetic logic unit (ALU), coupled to the counter and the pattern extractor for mapping a configuration according to the counting value and a reference value; and a register, coupled to the ALU and the oscillator to temporarily store the configuration and feedback the configuration to the ALU, so that the oscillator updates the frequency of the sampling clock in response to the configuration.
|