-
Notifications
You must be signed in to change notification settings - Fork 205
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
ATSAME53N20A ADC question #706
Comments
Hi @pustekuchen91, I hope it's OK that I have separated this issue from where you posted. I'm not very familiar with embassy nor the SAME53, but offhand I think it's a little suspect to use Could you please try adapting the ADC example from one of the M4 BSPs (eg Metro M4) to your board? |
Whoops, off-by-one error: it's GCLK0 that generates the the main core clock, not GCLK1... |
The above code is nearly the same as the example from the metro_m4 board. I just changed from adc0 to adc1 because i use a custom board. Edit: Okay i found the issue. I changed the GLCK to 11 or 10 and it works. Why should GLCK1 not be allowed? |
Is GCLK1 configured in your code? Harmony will generate the setup code for you, but you need to manually setup the clock in your rust code, I believe. |
@sakian No i didnt explizit configured GCLK1 in rust. I didnt for GLCK10/11 either. The clock is initalized in the adc module itself, which I think is not the best option. because the clock configuration should be freely configured. |
@pustekuchen91 - is it OK to close this issue, or is there more to it that is not captured by #707 ? |
In this Issue we could take a closer look at why GLCK1 is not usable as clock. |
It is strange. Standard v1 clocking sets up GCLK1 (code) then ADC tries to configure it as well, which panics since it's already configured. Maybe I'm missing something here, but I wonder how this ever worked with v1 clocking. Solution, imo, is to move to v2 clocking, and move peripherals to support v2 properly and not configure their own clocks. |
Thank you @sakian for poiting this out. That should be the reason. GLCK5 is also intialized . I think this is not ideally for everyone. |
Hey, i have a question about the adc. I'm trying to read an adc pin on a ATSAME53N20A.
My Test code
Error
What could be the cause for this error? Other Tasks run as expected and reading a simple GPIO also works.
Originally posted by @pustekuchen91 in #439 (comment)
The text was updated successfully, but these errors were encountered: