This is a design question, but let's start with a real SoC: Amlogic A311D. According to its datasheet, it has two on SoC temperature sensors. Each allows setting of thresholds which are used to generate interrupt. I would assume there is a low threshold, and a high one. But it had 4 pairs for each sensors. Each threshold can be individually controlled: enabled, disabled, set threshold. So my first question is, why do we need more than one pair to detect if the temperature crosses a threshold? Wouldn't one enough? If the temperature reading is high and generates interrupt, the service should disable interrupt, set the system thermal state to another value, and then may set to a new threshold. I couldn't understand why the SoC has four pairs of thresholds. The thing is, with 4 high thresholds, if the first one is crossed, the service has to disable it, and then keep waiting for the rest. It's not like the one that is crossed can be used any more.
2nd question: say I need to design a system which has a remote temperature sensor, so I connect the signal to ADC, and then I also need to generate interrupt with thresholds. Do I need to follow the Amlogic's example and put multiple comparators? Or do I just need to put one pair there?
So in general, this is a system level question, from temperature sensors, to ADC, to comparator, to interrupt generation, and to driver handling the interrupt. I hope I could learn some insights.
Check the last few pages from https://datasheetspdf.com/pdf-file/1410888/AMLOGIC/A311D/1 for the diagram
2nd question: say I need to design a system which has a remote temperature sensor, so I connect the signal to ADC, and then I also need to generate interrupt with thresholds. Do I need to follow the Amlogic's example and put multiple comparators? Or do I just need to put one pair there?
So in general, this is a system level question, from temperature sensors, to ADC, to comparator, to interrupt generation, and to driver handling the interrupt. I hope I could learn some insights.
Check the last few pages from https://datasheetspdf.com/pdf-file/1410888/AMLOGIC/A311D/1 for the diagram