2018-02-23 05:05 AM
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 fineNow 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 attentionDiego,
MilanItaly2018-02-23 05:18 AM
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.
2018-02-23 11:46 AM
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?2018-02-23 01:41 PM
Try a significantly longer sampling time.
Seems your opamp buffer is not capable of charging the S&H capacitor fast enough ...
2018-02-24 07:55 AM
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 tracks2018-02-24 09:53 AM
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.
2018-02-24 04:23 PM
do you use the cube ?
without the cube I guess it is possible to map some pins to the same function.
2018-02-24 08:23 PM
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.
2018-02-25 10:00 PM
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 presentThe 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
2018-02-25 11:30 PM
pcbway.com usually delivery in 6-10 days.