-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ESP32] Detect board version, and adjust config accordingly #122
Comments
EDIT: There's no reason to differentiate between v2.0b and v2.1a, since there isn't anything that changed from a software perspective. See #88 for full details. Consequently, I'm going to keep the detection pins disconnected/Hi-Z on v2.1a. EDIT 2: There's no practical difference between v2.0b and the version I'm working on. It doesn't warrant a bump to v2.1. Renaming to v2.0c. EDIT 3: Well, shoot. Hi-Z/Hi-Z will make v2.0 indifferentiable from v1.x. OK. SO. Here's the plan. Pins 4 and 5 are the sense pins. Currently, they're shown disconnected, Hi-Z state. This is what's on the v2.0b boards. This is electrically the same as the v1.x boards, hence the problem. My proposal for v2.0b is to bodge pins 4 and 5 to the immediately adjacent 3.3v test point. I'll connect v2.0c to 3.3v on the actual board. Since they are configured the same, we can use the same config for both. See Edit 2 above. This will make the following table:
I'll update the table above with the current values. |
There are other options as well. You can put a resistor/cap combo with different time constants on the pins and use the pullup/pulldowns to test them. That gives you a very wide range of values. If these pins can be analog inputs, you can use a resistor ladder to generate a variety of voltage which the A/D can sample. You can get quite a few bits that way. This is one of those problems that woke me up at 4am one day and filled a page in my bedside notebook. |
Hehe. All very true, and the sense pins can be analog inputs as well. They're specifically designed to be a precise differential analog input, so we're well suited for options in the future. For now though, 9 non-backward-compatible board revisions are enough to get us started. We can add more options in the future as necessary. KISS. |
I don't think I need to do anything with this enhancement request, right? Closing. Please reopen if something is needed. |
Dang it! I knew there were already issues for these things I've been doing! Yes, this is duplicate of #203 |
With v2, I've added a way for the ESP32 to detect which version of the board it's running on. This allows you to build a single image that will work on multiple boards.
The detection pins are GPIO36 and GPIO39 (aka: Sensor_VP and Sensor_VN).

Each pin can be in one of three Config States:
The code detects which state each pin is in by configuring the pin with an internal pull-up, and read its state. Then configure it with an internal pull-down, and read its state again. The mapping from Pin State to Config State is:
The Board Version is a 2-digit base-3 number, for a total of 9 trackable versions. The only valid Board Versions right now are:
We'll add more to that table as we make more boards that require software changes.
Let me know if you have any questions.
The text was updated successfully, but these errors were encountered: