2017-12-01 08:55 AM
References:
STM32L0x3 - RM0367, Rev 5
STM32L0x2 - RM0376, Rev 4
In both cases, the description of ADC sampling time register (ADC_SMPR) says,
Bits 2:0 SMP[2:0]: Sampling time selection
These bits are written by software to select the sampling time that applies to all channels.000: 1.5 ADC clock cycles001: 3.5 ADC clock cycles010: 7.5 ADC clock cycles011: 12.5 ADC clock cycles100: 19.5 ADC clock cycles101: 39.5 ADC clock cycles110: 79.5 ADC clock cycles111: 160.5 ADC clock cyclesBut, in both cases, the code examples say,
(4) Select a sampling mode of
111 i.e. 239.5 ADC
clkSo which is it - 160.5 samples, or
239.5
samples??https://community.st.com/message/75668
, from March 2015, quotesRM0367, v2 :
RM0367, v2, section 14.13.6 lists the following possible sample time:
1.5, 7.5, 13.5, 28.5, 41.5, 55.5, 71.5, 239.5.
https://community.st.com/message/75668
I don't see anything mentioned in the Revision Record...
#stm32l0x2 #adc-sample-cycles #adc_smpr #adc #adc-sampling-time #stm32l0x32017-12-01 09:24 AM
I found an old Rev 2 copy of RM0367 - and it does, indeed, say:
Bits 2:0 SMP[2:0]: Sampling time selection
These bits are written by software to select the sampling time that applies to all channels.
000: 1.5 ADC clock cycles
001: 7.5 ADC clock cycles
010: 13.5 ADC clock cycles
011: 28.5 ADC clock cycles
100: 41.5 ADC clock cycles
101: 55.5 ADC clock cycles
110: 71.5 ADC clock cycles
111: 239.5 ADC clock cycles
http://www.mouser.com/ds/2/389/DM00095744-337294.pdf
So was that a chip revision?
Or an error in the earlier document, that's been partially fixed?
Or an error that's crept into the new document?
2017-12-04 03:37 PM
Andy,
The first is unlikely; both of the second two have been seen many times.
Did you try, what is the sampling time in reality? (Yes I know I know it needs to come from ST, but that may take quite long).
Jan
2017-12-05 08:40 AM
No, I haven't tried it. The timing is not critical for me at the moment, so I have just left it at max.
Given nearly 1000 pages of reference manual, one doesn't expect to have to reverse-engineer the product oneself ...
2018-03-04 11:41 AM
https://community.st.com/0D50X00009XkfspSAB
- somebody who's name is Andrew too :) , and actually tried before it was fixed in the RM.JW