How those voltage levels for brownout of ESP32S3 are defined if there is no internal voltage references implemented?
Posted: Sun Apr 07, 2024 1:48 pm
Are those levels defined as some percentage of power supplied voltage (which is usually 3.3V +- 0.3V) or they are deffined by some internal circuit in ESP32S3 which is not exposed to the rest of hardware but only to brown_out function?
Battery powered applications, can generate large voltage fluctuation on power supply (esspecially in fast switching of large consumers possibly connected to ESP chip, like relay(s), coils, amps etc.). So in scenarios where exaustion of battery must be prevented (not because of battery itself, because most of LiPo bateries already contain a small circuit which protect the battery goes to deep discharge by cutting battery output once the voltage drops below some critical level) because you have to protect time keeping mechanism handled by RTC, so you must not allow situation where large consumption of whole application will trigger protection implemented in battery which then will be followed by ESP reset, but rather, you want to recognize some specific voltage level before that happens, so application can put LX7 cores at sleep and reducing current consumption avoiding chip reset on brown out, allowing the remaining of battery capacitance to hold RTC and time keeping function.
So something like function GO_TO_SLEEP_ON_BROWN_OUT (if such thing exists). Technically it would be posible to try to simulate such a function using ULP (which consumes really small amount of current in operational mode) but problem is related to absence of internal absolute stable voltage reference. For example utilizing the AD converter on ULP and measurring power supply voltage is not suitable for that purpose because measuring value of AD converter is ALWAYS related to some percents of power supply voltage. So basically, if you configure a free input pin for AD converter on ULP, to measure power supply voltage, you will always measure value of 4095 (full saturation) becuase that internal AD converter uses the same power source for its reference of full saturation. The same thing, for example, if you make some voltage divider, let's say by using two identical resistors in between power supply and GND, and measure voltage at that point in between, you will always get 12 bit value of 2048, because you are actually measuring 50% of power supply voltage and not an absolute rference of 1.65V. So if power supply voltage is 3 V that binary 2048 will represent 1.5V however if power supply voltage is 3.7 V the same value represents 1.85V. So you see the problem. You can not measure a power supply voltage if it is used as a refference at the same time.
For proper, measurement of power supply, an internally generated voltage reference is required with respect to ground. (many microcontroller manufacturers provide in their chips, stable internal refferences of: 1.024V, 2.048V (and 4.096V for chips running at 5V). From values, it is obvious why they choose exactlly those. Because they represent values of fully saturated 10, 11 and 12 bit AD convertors and are also useful in combination with DA converters and comparator circuits.
So my question, technically speaking is, is it possible to accuratelly measure power supply voltage, in battery powered applications utillizing ESP32S3 in sleep mode, without any additional hardware circuits (VCOs, external references ICs etc)? And how?
Battery powered applications, can generate large voltage fluctuation on power supply (esspecially in fast switching of large consumers possibly connected to ESP chip, like relay(s), coils, amps etc.). So in scenarios where exaustion of battery must be prevented (not because of battery itself, because most of LiPo bateries already contain a small circuit which protect the battery goes to deep discharge by cutting battery output once the voltage drops below some critical level) because you have to protect time keeping mechanism handled by RTC, so you must not allow situation where large consumption of whole application will trigger protection implemented in battery which then will be followed by ESP reset, but rather, you want to recognize some specific voltage level before that happens, so application can put LX7 cores at sleep and reducing current consumption avoiding chip reset on brown out, allowing the remaining of battery capacitance to hold RTC and time keeping function.
So something like function GO_TO_SLEEP_ON_BROWN_OUT (if such thing exists). Technically it would be posible to try to simulate such a function using ULP (which consumes really small amount of current in operational mode) but problem is related to absence of internal absolute stable voltage reference. For example utilizing the AD converter on ULP and measurring power supply voltage is not suitable for that purpose because measuring value of AD converter is ALWAYS related to some percents of power supply voltage. So basically, if you configure a free input pin for AD converter on ULP, to measure power supply voltage, you will always measure value of 4095 (full saturation) becuase that internal AD converter uses the same power source for its reference of full saturation. The same thing, for example, if you make some voltage divider, let's say by using two identical resistors in between power supply and GND, and measure voltage at that point in between, you will always get 12 bit value of 2048, because you are actually measuring 50% of power supply voltage and not an absolute rference of 1.65V. So if power supply voltage is 3 V that binary 2048 will represent 1.5V however if power supply voltage is 3.7 V the same value represents 1.85V. So you see the problem. You can not measure a power supply voltage if it is used as a refference at the same time.
For proper, measurement of power supply, an internally generated voltage reference is required with respect to ground. (many microcontroller manufacturers provide in their chips, stable internal refferences of: 1.024V, 2.048V (and 4.096V for chips running at 5V). From values, it is obvious why they choose exactlly those. Because they represent values of fully saturated 10, 11 and 12 bit AD convertors and are also useful in combination with DA converters and comparator circuits.
So my question, technically speaking is, is it possible to accuratelly measure power supply voltage, in battery powered applications utillizing ESP32S3 in sleep mode, without any additional hardware circuits (VCOs, external references ICs etc)? And how?