cancel
Showing results for 
Search instead for 
Did you mean: 

Is this uC damaged?1 ADC ch reflects its value on other 2

Diego Colombo
Associate III
Posted on February 23, 2018 at 14:05

Hi ,i'm talking about STM32F410RBT

I'm using 12 ADC channels in DMA mode.I did any sort of manipulation around the hardware built on a prototype board,and it is not unlikely that something went wrong,despite only 3.3V are used.

The analog signals are very slow,i sample it at 1KHz

The acquired values are sent to an UART,at the pretty high speed of 460800 bps,and then a serial to USB converter send it to a PC where i wrote a primitive 12 channel minimal 'oscilloscope viewer'.

I tested each channel with an arbitrary function generator,then with some analog sensor and everything worked fine

Now what i see is that an ADC channel,say CH9,reflects its value on CH10 e CH11,that strangely does not move when a signal is applied to them.

I checked serial,USB and PC simply forcing known levels in the ADC out buffer.

I was in doubt that something was changed wrongly in my DMA acquisition,and that the fact that the affected channels were the last to be sampled was the reason.

So i exchanged them with CH0,CH1,CH2,but the problem still looks related to the 'physical' ADC channels CH9,CH10,CH11.

I'm always prone to blame my code rather than a good uC,so i ask to you,in the community,if this behaviour is symptom of fault or wrong code,if you experimented it.

Many thanks for your attention

Diego,

Milan

Italy
11 REPLIES 11
Posted on February 23, 2018 at 14:18

It is charging a capacitor, so the sample time, and ability to change the state (ie sink/source current) will impact bleed-thru from one channel to the next.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on February 23, 2018 at 19:46

Thanks for your opinion,Clive

it looks possible, but all the channels are buffered by the same kind of op amp,why 3 should behave differently?
AvaTar
Lead
Posted on February 23, 2018 at 22:41

Try a significantly longer sampling time.

Seems your opamp buffer is not capable of charging the S&H capacitor fast enough ...

Posted on February 24, 2018 at 15:55

Thanks Clive,

I followed your hint.I tried today.

No way.

The sampling time was increased from 3 to 15 cycles on the interested channel but it still behaves the same way-

Thanks anyway.

I need time to replace the IC because this prototype board can't stand the substitution without loose some PCB tracks
Posted on February 24, 2018 at 17:53

The sampling time was increased from 3 to 15 cycles on the interested channel but it still behaves the same way-

I guess that's not enough.

Do a simple test.

Apply a fixed voltage to one of the channels (say, 2.5 .. 3.0V), and pull the others to GND. Measure the results.

Then change the channels, and repeat.

Not sure if you fully understand the inner workings of a multiplexed SAR-ADC.

T J
Lead
Posted on February 25, 2018 at 01:23

do you use the cube ?

without the cube I guess it is possible to map some pins to the same function.

S.Ma
Principal
Posted on February 25, 2018 at 05:23

Decorrelate functions when debugging to find out where the bug is.

Start by measuring all voltages and supplies, then force all adc input voltages in injected mode for easy debug in the ide. Put the dma and uart out of the equation.

Diego Colombo
Associate III
Posted on February 26, 2018 at 07:00

Solved,

the solution was trivial and the problem was not worth of wasting yor time,sorry.

Despite i was almost shure that the low Z of the OpAmp was enough to drive the Sample Hold capacitor or any capacitor at the ADC input,i wanted to follow anyway the hints of Clive and KIC84,forcing VDD and VSS voltages directly.

Even hardwired the 2 ''strange'' ADC channels refuse to give a coherent digital value.That was too much...i lifted components around then put the circuit under microscope...the track looks non cutted,and checking with ohmeter once more confirmed connection between ADC pins and opamp out.Checking better i discovered the error:

Simply ,after one air removing and resoldering of a crystal close to the pins,the 2 pins of the interested channel remained sligthly llifted,so close to the track that the pressure of the multimeter probe tip was enough to reconnect it during measurement,due to the fact that the center of the uC was a bit lifted because of the thickness of ''handcrafted vias'' and some elastic force was present0690X00000602ntQAA.jpg

The lesson for me is that my home made SMD PCB are good for immediate test,but manipulate it again and again and they will show some of their weakness.

Sorry to have discovered it too late.

Thanks for your time and for your answers.

Diego

Posted on February 26, 2018 at 07:30

pcbway.com  usually delivery in 6-10 days.