cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with AD conversions

DBein
Associate III

We encountered a big issue with the ADC's in a project.

The G4 device has 4 ADC's configured (ADC1, ADC2. ADC3, ADC5).

ADC1 and ADC2 are sampled simultanious and triggered by HRTIMER1A interrupt with 4 channels each.

ADC3 and ADC5 are in independent mode and are triggered at different times by HRTIMER1B interrupt with 1 channel each.

The problem we encountered now is that the ADC1 samplings are not consistent.

It seems like there are always "steps" on which the measured voltages stay or alternate.

First I assumed some problem with the ADC multiplexing, however after disabling all but ADC1 the issue is still there. The signals at the ports are all fine and stable without noise, the Vref is external but stable as well as Vcc. It somehow looks like the ADC got damaged. I tested the same code on a Nucleo board with the same result. We got like 20 PCB baords, all use the same code, but about a third of the boards are messed up. Another weird thing is, that the ADC measurements and "steps" are getting much worse with increasing temperature.

We need urgent help...

32 REPLIES 32
MM..1
Chief II

Then ok , but as i write an hw or sw issue break 6.5 cycle in middle and ADC dont work properly, i cant say why, but some conditions must be fail. When this break ocurs your changes to other numbers of cycles is irelevant. ARM is risc architecture and sometimes need special asm for working properly.

DBein
Associate III

​Thats right, so it should be ensured that nothing will interrupt the ADC samplings.

Injected mode has to be used carefully as I know, I do use circular sampling currently without interruption.

K.Oku
ST Employee

Hello.

We already have conference call to discuss this problem.

It was identified that ADC clock was set to 170MHz, but ADC clock speed max is 60MHz. Due to this, ADC shows missing codes, etc.

By reducing ADC clock, it should solve the problem.

We also discussed that older version of CubeMX does not flag the wrong ADC clock setting.

Newer version of CubeMX will flag the wrong ADC clock setting(Or cannot select higher frequency than the spec).