Skip to content

feat: implement firmware for new ADC battery monitor - #6

Open
oddgrd wants to merge 2 commits into
mainfrom
feat/battery-monitor
Open

oddgrd wants to merge 2 commits into
mainfrom
feat/battery-monitor

Conversation

@oddgrd

@oddgrd oddgrd commented Oct 12, 2026 •

Copy link
Copy Markdown
Owner

In the v0.3 motherboard, a battery monitor was added, by connecting the tap of a voltage divider connected to the 7.4V rail to an ADC input. This PR implements the firmware to read the battery voltage and enter a shutdown when a low voltage threshold is crossed. The hardware init code is generated with STM32CubeMx.

Before merging this PR, the documentation should be updated to reflect the existence of this feature and how it works, and also to reflect how to update the relevant config, like what the voltage threshold should be, in app_config.h.

Final part of ODD-42

Triggering a conversion every 500ms with TIM6 update event, and then reading the ADC value after the conversion with an ADC1 ISR.
Furthermore, indicate the failure with the new yellow debug LED on PF1.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant