The invention provides a method for detecting and controlling the temperatures of a processor. The method includes the steps of firstly, initializing a kernel
timer for initializing the structure of the
timer, setting the cycle of the
timer, designating the interrupt
processing function of the timer and inserting the timer into a timer global array; secondly, calling the interrupt
processing function of the timer when
timeout of the timer occurs, reading data of a temperature sensor, and
processing the read temperature data so as to determine a PWM
control signal; thirdly, reactivating the kernel timer in the timer interrupt processing function so as to conduct the next time of temperature collection and so as to adjust the rotating speed of a fan. The temperature data collected by the temperature sensor connected to a south bridge
chip are read periodically through the kernel timer, after
software filtering is conducted on the temperature data, corresponding control information is generated according to the interval where the processed temperature data are located and is then transmitted to the south bridge
chip so that the south bridge
chip can be controlled to output corresponding
PWM signals, and therefore the aims of adjusting the rotating speed of the fan and controlling the temperatures of the processor are achieved. According to the method, the temperatures of the processor are collected and controlled through basic elements on a main board,
software filtering is conducted on the temperature data, and control accuracy is improved.