-
Notifications
You must be signed in to change notification settings - Fork 5
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
base: main
Are you sure you want to change the base?
Conversation
Nice catch, thanks! |
neotron-bmc-pico/src/main.rs
Outdated
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 { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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.)
There was a problem hiding this comment.
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.
Signals:
1: 3.3V
2: 5V
4: IRQ0
Before:
![neotron-3V3-5V-main](https://private-user-images.githubusercontent.com/232606/407107673-07dc0b3f-7bf2-4987-9832-cd49fc64159b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNDIyNjIsIm5iZiI6MTczOTI0MTk2MiwicGF0aCI6Ii8yMzI2MDYvNDA3MTA3NjczLTA3ZGMwYjNmLTdiZjItNDk4Ny05ODMyLWNkNDlmYzY0MTU5Yi5wbmc_WC1Bb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