Replies: 3 comments 9 replies
-
@MarP13 on behalf of the project: thank you for your kind words of appreciation! To your question: sample rate is not exposed in C# API therefore you can't set it using the ADC API. Regarding I2S, yes, that could be a good alternative as it allows all sorts of configurations. See here. Bus indexes in .NET are 1 "based", so you have to refer to it as I2S1 (take a look at the |
Beta Was this translation helpful? Give feedback.
-
Thank you for swift answer.I did check the docs and tried different configs (slavemode, different buffer sizes, channelconfig and more), but AdcMode keeps failing. The only way I am able to readout data is PDM mode. But I would like to get raw adc data since I won't be receiving sound. On Jan 26, 2023 00:46, José Simões ***@***.***> wrote:
@MarP13 on behalf of the project: thank you for your kind words of appreciation!
Happy to know that you're having fun with .NET nanoFramework.
To your question: sample rate is not exposed in C# API therefore you can't set it using the ADC API.
Regarding I2S, yes, that could be a good alternative as it allows all sorts of configurations. See here.
Bus indexes in .NET are 1 "based", so you have to refer to it as I2S1 (take a look at the SetPinFunction call 😉 you see there DeviceFunction.I2S1....
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
@MarP13 first, about I2S0: on this code line you can see that the C# input "BusId" will be reduced by one -> therefore a BusId=1 equals the 0 bus natively. About the SampleRate: I'd say it is exposed and consumed.. I've had however problems in understanding what I was doing while implementing I2S natively.. because all these PCM | ADM modes etc.. I really struggled to wrap my head around that stuff.. So native implementation is a bit of: "copy & paste" from some sample source codes and adapting that to nanoFramework. If you find a "complete" native implementation for ADC and could show me, I could try to figure out, where the differences might be. |
Beta Was this translation helpful? Give feedback.
-
Hello! First I wanna express my gratitude for this project. Running C#/.NET on microcontrollers has been my wet dream for years and I was very sad to see official microFw die before the price for devices become reasonable.
It's great to see the resurection with nanoFramework, especially on my beloved ESP32!
To my actual question:
I want to read analog data at high pace. I haven't found option how to set the sampling rate for ADC.
Is that possible with nano framework?
I found that I2S could be used for this purpose, but I struggle to configure it for ADC. When I use Mode = AdcBuiltIn program gets stuck on reading into buffer.
Espressif's doc for i2s states, that Adc mode is available on I2S0 bus. Does that equal to nanoframework's busId = 1? I2sConnectionSettings will fail with Id 0 and there are no definitions in DeviceFunction for I2S0_*.
I looked briefly into I2S implementation for clues, but it's to complex for my lame C++ skill.
Thanks a lot for your help.
Beta Was this translation helpful? Give feedback.
All reactions