Skip to content

Programmable Sample Time parameter for faster sample rates #62

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

Closed
jmdodd95682 opened this issue Mar 18, 2024 · 0 comments · Fixed by #67
Closed

Programmable Sample Time parameter for faster sample rates #62

jmdodd95682 opened this issue Mar 18, 2024 · 0 comments · Fixed by #67
Assignees
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself type: enhancement Proposed improvement

Comments

@jmdodd95682
Copy link
Contributor

jmdodd95682 commented Mar 18, 2024

In HALConfig.cpp, the hal_adc_config() routine currently has the Sample Time (sConfig.SamplingTime) hard coded to a value of
ADC_SAMPLETIME_8CYCLES_5 (8.5 clocks).

According to the datasheet, a value of ADC_SAMPLETIME_2CYCLES_5 (2.5 clocks) is legal. This increases the maximum sample rate from 1.8 MS/s to 2.9 MS/s.

Due to concerns about operating conditions (temperature, voltage etc), it would NOT be a good idea to simply change the hard-coded value from 8.5 clocks to 2.5 clocks. Instead, a new defaulted argument can be added to hal_adc_config() which can be set to SAMPLE_SLOW or SAMPLE_FAST to enable switching between 8.5 clocks and 2.5 clocks as the user prefers based on their operating conditions and needs. The default would be SAMPLE_SLOW to retain backward compatibility.

@iabdalkader iabdalkader self-assigned this Mar 18, 2024
@per1234 per1234 added type: enhancement Proposed improvement conclusion: resolved Issue was resolved topic: code Related to content of the project itself labels Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants