Skip to content

Commit

Permalink
add changed ADC input config and comment about hack
Browse files Browse the repository at this point in the history
  • Loading branch information
nkrackow committed Jun 30, 2023
1 parent 1cb3a11 commit 05cd925
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/hardware/setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -397,12 +397,15 @@ pub fn setup(
None,
None,
],
// last ADC has single ended inputs negatively referenced to the positive reference input
// This is a hack to get the single ended inputs to work. Somehow the ADC sometimes went
// into an error state and did not recover if the single ended channels were referenced to the positive reference input.
// The workaround is to connect the positive reference to an unused single ended input (Ain2) and
// reference the single ended input to this input. The ADC seems to not have a problem recovering here.
[
Some((AdcInput::RefP, AdcInput::Ain0)),
Some((AdcInput::RefP, AdcInput::Ain1)),
Some((AdcInput::RefP, AdcInput::Ain2)),
Some((AdcInput::RefP, AdcInput::Ain3)),
Some((AdcInput::Ain2, AdcInput::Ain0)),
Some((AdcInput::Ain2, AdcInput::Ain1)),
Some((AdcInput::Ain0, AdcInput::Ain2)),
Some((AdcInput::Ain2, AdcInput::Ain3)),
],
],
};
Expand Down

0 comments on commit 05cd925

Please sign in to comment.