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

Variable gain ADC feature #240

Merged
merged 3 commits into from
May 5, 2023
Merged

Conversation

boramonideep
Copy link
Collaborator

By creating this pull request you agree to the terms in CONTRIBUTING.md.
https://github.com/Infineon/.github/blob/master/CONTRIBUTING.md
--- DO NOT DELETE ANYTHING ABOVE THIS LINE ---

CONTRIBUTING.md also tells you what to expect in the PR process.

Description
Add variable gain feature of XMC VADC to Arduino API

Context
XMC VADC for XMC1000 series provide a gain stage at the ADC inputs with variable gain factors. This is particularly useful for sampling weak voltage values. This has been enabled with an additional function in the Arduino API.

@boramonideep
Copy link
Collaborator Author

Investigating the CI/CD failures

@techpaul
Copy link
Contributor

techpaul commented May 4, 2023

Two things missing

  1. #defines LIKE ADC_VAR_GAIN_1 to ADC_VAR_GAIN_12 in analog.h to simplify the setting of gains.
  2. Documentation at least in Wiki to describe limits especially on channels, which are different on different boards.

Personally in a lot of my front ends this low level of gain would not help, but then again for gains of 100+ I would not do it inside the micro for noise reasons.

@boramonideep
Copy link
Collaborator Author

Added wiki note here: https://github.com/Infineon/XMC-for-Arduino/wiki/Analog-Functions-and-Additions
Added macros as suggested
Thanks @techpaul

@boramonideep boramonideep merged commit f58509d into Infineon:develop May 5, 2023
7 checks passed
@techpaul
Copy link
Contributor

techpaul commented May 5, 2023

One advantage of the Macros reduces chance of someone trying a gain factor of 50 and wondering why it is not working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants