Repository navigation
feat: PCB_VERSION, the internal 1.1 V ADC reference of the new motherboard - #184
Merged
Merged
Conversation
…board The universal 3phaseDiverter board (rev. 6.0 and later) is designed for the internal 1.1 V reference of the ATmega328P (buffered from AREF by an LMV321A), which the firmware must select. Until now the firmware always used AVCC, the reference of the old 3-phase board, so a new board measured wrongly. The change was on the unmerged new-pcb branch (cfe0682), written for the ISR before the circular channel list of #127. - config.h: PCB_VERSION, OLD (default, unchanged behaviour) or NEW; - processing.cpp: _ADMUX selects AVCC or the internal 1.1 V, and the first conversion now uses it too (it ran on the AREF setting before the ISR took over); - the startup summary shows the board; - READMEs (EN/FR): how to choose, and to recalibrate after a change; CHANGELOG. Checked: OLD gives the same ADMUX values as before (0x60 | channel) and passes the grid simulator scenarios; NEW gives 0xE0 | channel. Co-Authored-By: Claude <noreply@anthropic.com>
This was referenced Oct 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The universal 3phaseDiverter board (rev. 6.0 and later) is designed for the internal 1.1 V reference of the ATmega328P. An LMV321A buffers it from AREF, and the doc says the firmware must switch it on. The firmware always selected AVCC, the reference of the old 3-phase board, so a new board measured wrongly.
The change existed on the unmerged
new-pcbbranch (cfe0682a, 2025-12-30). It was written for the oldswitchISR, which #127 later replaced with the circular channel list, so it could not be merged as is.What
config.h: a setting a user can understand:OLDis the default, so existing installations behave as before.processing.cpp:_ADMUXselects AVCC (OLD) or the internal 1.1 V (NEW).initializeProcessing()now writes the fullADMUX(reference, ADLAR, V1) for the first conversion too. Before, that conversion ran with REFS = 00 (external AREF) until the ISR took over.Motherboard: old (AVCC reference)ornew (internal 1.1 V reference).Checked
OLD: the ADMUX values in the channel list are unchanged (0x60 | channel). The grid simulator passes (clouds 11/11, no_surplus 7/7, surplus_step 12/12).NEW: the channel list holds0xE0 | channeland the setup writes0xE0.NEW, as expected: simavr scales conversions against the 1.1 V reference while the scenarios feed signals sized for 5 V. That shows the reference really switches. Simulating the new board would need scenarios with its signal levels.Follow-ups
new-pcbbranch can be deleted after the merge.OLD_PCB, which only switches the analog pins.🤖 Generated with Claude Code