2014年5月4日 星期日

IRQ & Thermal sensor

當溫度過高或過低,到 SOC收到的IRQ通知,中間經過那些過程呢? 軟體工程師可以讀到系統溫度,但卻不一定知道系統如何得到溫度。硬體工程師接了電路,卻不一定知道軟體如何處理ADC轉換後的資料。
When the system temperature is too high , how the SOC receive and handle the over temperature event?

1.溫度感測:首先需要溫度感測的零件(Temperature sensor),例如NTC。當溫度產生變化時,NTC阻值產生變化(圖一)。We need the temperature sensor component, like the NTC. When the
temperature change ,the NTC resistance is also changed. In the figure as below, the resistance is 10Kohm in the 25degC. When the temperature is rising, the resistance would be dropped.

                                                                             圖一
2.ADC轉換::NTC會跟一個固定阻值的電阻串聯,當NTC隨著溫度改變,分壓值Vadc也跟著改變。Vadc經過ADC,轉換為數位資料 (ADC code)。在ADC的spec可以查到電壓與ADC code的轉換公式,例如ADC code=Vadc* 512.
The NTC resistor will be series with a constant resistor. The divided voltage is input of ADC, ADC convert the voltage to digital data(ADC code). You can find the formula to transfer voltage to ADC code in the ADC spec. 

圖二 

3. 設定溫度保護:如果要做高溫保護,就要定時去讀取ADC code,由ADC code去換算現在的溫度。溫度保護可以分成兩階,當溫度超過第一階保護點,就發出中斷給SOC(圖三)。SOC可由中斷向量表得知是溫度過高事件,通常SOC會降頻作為高溫保護。當溫度超過第二階,就直接關機來做保護。
Setting the temperature protection point. The system need to read ADC code regularly and transfer ADC code to update the present temperature. The temperature protection can be two level, when the temperature cross first level, temperature sensor IC will inform the SOC by interrupt pin, SOC would be downgrade its frequency. When the temperature cross second level, the SOC would go to sleep or shutdown. 



                           

沒有留言: