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

User ADC #167

merged 4 commits into from Jun 6, 2018


Copy link

commented May 15, 2018

ADC1 is configured to sample channels 0 to 15 continuously
at about 30kHz. Users can now set their GPIO of choice to
analog mode (as long as it's wired to one of the analog
channels) and then read the voltage at any time.

On startup GPIOs 1, 2, 3 and 4 (and GPIO 5 for board v3.5) are initialized to analog unless used by any other feature. For board v3.4 this means GPIOs 3 and 4 are analog by default.

Usage Example (in firmware):

GPIO_set_to_analog(GPIO_1_GPIO_Port, GPIO_1_Pin);
my_voltage = get_adc_voltage(GPIO_1_GPIO_Port, GPIO_1_Pin);

Usage example (ODrive Tool)

In [11]: odrv0.get_adc_voltage(3)
Out[11]: 0.0

In [12]: odrv0.get_adc_voltage(4)
Out[12]: 3.278247117996216

@samuelsadok samuelsadok force-pushed the sam_user_adc branch from e754419 to 8339311 May 15, 2018

samuelsadok and others added some commits May 15, 2018

@madcowswe madcowswe merged commit f830674 into devel Jun 6, 2018

1 of 2 checks passed

continuous-integration/travis-ci/pr The Travis CI build failed
license/cla Contributor License Agreement is signed.

@madcowswe madcowswe deleted the sam_user_adc branch Jun 6, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
3 participants
You can’t perform that action at this time.