2022-10-25 10:51 PM
I am working on a new PCB/platform based on the STM32H730 MCU.
In general, all peripheral drivers work well, using Cube MX.
But I have a problem with the ADC sampling:
I quite often see errors on the ADC sampling, when USB is connected to PC.
But only when the communication between the two are running.
When USB is just connected, I don't see any errors.
But as soon as the communication starts, the errors starts to show up.
I use 5 ADC channels, sampled in a sequence.
In 99,9% of the cases, it is the same channel and almost the same ADC value: 65 +/- 2.
Sampling frequency is 100 ms, and the error shows up appr. twice every minute.
But then sometimes it can be 15 minutes without errors.
The ADC values are read from this IRQ:
void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef* hadc)
Why does the USB communication influence on the ADC sampling?
Thanks for any input!
2022-10-26 12:43 AM
What about crosstalk, could you show us your pcb design special attention to where USB lines and ADC lines meet?
Are you using the bottom layer as a ground plane?
2022-10-26 02:30 AM
Yes, of course, that could also be the problem!
The USB connector is placed in between the MCU and analog wires.
The troublesome analog values are the ones that travels along/across the USB.
Other ADC values are not near to the USB.
I have asked the HW guy to check this, but he is on vacation the rest of the weekk.
I will update here.
Thanks!