2023-11-16 02:47 AM
I have designed a buck converter that uses the MCU to regulate its output voltage.
I am using one pin for the voltage feedback that will be used to regulate the output. However, because it has to read this pin very quickly, the sample period has been set to 2.5 clock cycles and thus the effective resolution is not very good (fine for control though). I see that I can assign multiple ADC channels to a single pin.
If I assign two ADC channels to the same pin, can I use one of the ADCs to read the voltage on the pin with much more precision at the same time the alternate ADC is being used to regulate the voltage without effecting control?
2023-11-30 07:25 AM - edited 2023-11-30 08:37 AM
Hello @DavidNaviaux,
Here are some guidance for your application :
Best Regards,
Pierre
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2023-11-30 07:50 AM
Pierre,
I am using PB15 (ADC4_IN5) with a fixed negative offset to give me an error signal for the FMAC. It appears that I can have multiple ADC channels assigned to that pin, i.e. PB15 looks like I can assign ADC4_IN5 and ADC2_IN15. Currently I am using DMA to transfer the ADC4_IN5 results to the FMAC to be processed.
If I can assign multiple ADC inputs to a pin and I add ADC2_IN15 to PB15 (i.e., both ADC2_IN15 and ADC4_IN5 are highlighted), can I use ADC2 to read a more precise voltage on that pin without effecting the ADC4_IN5 results transferred by DMA to the FMAC (ADC_IN5 is being sampled every 5us)?
Thanks,
David
2023-11-30 08:53 AM
Here are some remark/answers:
Best Regards,
Pierre
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2023-11-30 09:08 AM
Pierre,
Thank you for your quick responses (I have to finish the firmware within a week!).
What I was concerned about is if a pin is being converted by two ADC converters that are not synchronized in any way, will the source impedance of the analog signal to the pin (1k ohm in my case) affect either of the conversions if they happen to be converting at the same time?
In my application, I am not concerned about the speed of the sampling of ADC2_IN15 since it will only be used to provide accurate feedback to an operator. However, the timing of ADC4_IN5 is critical since it is used as feedback for regulating the output voltage of the buck converter with a PWM frequency of 200kHz (i.e., sampled every 5us).
Thanks again,
David
2023-12-01 02:30 AM
Hello @DavidNaviaux,
Q : What I was concerned about is if a pin is being converted by two ADC converters that are not synchronized in any way, will the source impedance of the analog signal to the pin (1k ohm in my case) affect either of the conversions if they happen to be converting at the same time?
A : No, it's not possible to use ADC2 and ADC4 with a single pin at the same time without any synchronization. The risk is the noise between them if they sample at the same time. Below, when the switch closes, noise is generated which can be detected by the second ADC.
Best Regards,
Pierre
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.