Skip to content
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

Check for 3.3V supply before raising IRQ and continuing boot process #72

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jannic
Copy link

@jannic jannic commented Jan 27, 2025

Signals:
1: 3.3V
2: 5V
4: IRQ0

Before:
neotron-3V3-5V-main

With this fix:
neotron-3V3-5V-power_good

neotron-bmc-pico/src/main.rs Outdated Show resolved Hide resolved
@thejpster
Copy link
Member

Nice catch, thanks!

if ctx.shared.state_dc_power_enabled.lock(|r| *r) == DcPowerState::Starting {
let mon_3v3 = ctx.local.adc.read_abs_mv(ctx.local.pin_3v3_monitor);
defmt::trace!("3v3 reading: {}", mon_3v3);
if mon_3v3 < 1600 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why 1600mV? That seems quite low?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a voltage divider before the ADC. 1600mV on the pin means 3.2V on the 3.3V rail.
image

So 1600mV may actually be too high. I didn't do an estimate of the tolerances.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(If you agree with the general approach, I can work on the details, like adding some explanations, putting the "magic value" 1600 in a const etc.)

Copy link
Member

@thejpster thejpster Jan 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahhhh. Yes, you can't exceed fairly tight limits on the ADC pin so I halved the input.

Yes the approach makes sense.

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.

2 participants