shall I upgrade from stm32f373? - Page 1
Forum section: electronics / general

author: exe
author_rank: Unknown
timestamp: November 18, 2019, 10:19:16 am
content: A few years ago I started a project (programmable power supply). I bought a few stm32f373 ICs back then. It took quite a while to design the analog part, but now it's nearly ready. Now I need to think of digital part. Question: shall I proceed with with using stm32f373, or there are better MCUs available from ST?Reasons I chose stm32f373:1) 3 DACs (but I ended up with using only two: one current setting, another one for voltage setting)2) 16bit ADCDoes it make sense to change to something more modern? May be more recent mcu's have better analog performance, less noise and power consumption?

author: techman-001
author_rank: Frequent Contributor
timestamp: November 18, 2019, 10:43:54 am
content: Quote from: exe on November 18, 2019, 10:19:16 amThat's still a quite impressive ST chip, especially with the 16 bit ADC..55 peripherals790 registers6354 bitfields

author: mariush
author_rank: Super Contributor
timestamp: November 18, 2019, 11:52:26 am
content: Well, I'd suggest having a look at what's available without a 16 bit ADC or with fewer DACs.You may get higher performance in lower package (not 100 pin parts) and use a separate 16bit ADC connected through i2c or spi. Maybe even be good with 14bit and a good voltage reference, and get better results than built in ADC.

author: rvalente
author_rank: Frequent Contributor
timestamp: November 18, 2019, 11:57:09 am
content: What would be yours pros an cons?Possible pros: cheaper part, worth it? More resources, do you miss anything? More friendly package?Possible cons: redesign the pcb, respin the manufacturing files, retest all the circuit, change code, retest code...Put on a paper, every pro is 1 point, every con is -1 point. How to they sum up?

author: exe
author_rank: Unknown
timestamp: November 18, 2019, 12:17:52 pm
content: I don't have any pcb yet, I'm making it right now.As of package tqfp-48 sounds the best option to me in terms of available pins, features, and board area.As of using external ADC/DAC, that was a hard choice. External components will give better performance, but I decided to go "one package does everything" in a hope that it would be efficient in terms of board area and troubleshooting the board. Otherwise any MCU would do a job because all it's not a main mcu that controls display. For display and external connectivity I'm using esp32.So, I'm giving preference to easier solutions, but nothing is set in stone. Part because I'm not sure in analog performance of stm32, I'm evaluating it now. But I use a breadboard and loosey-goosey wiring, and I know this way I'm not going to get good results.PS that 16bit seems to be really "14bit noise-free" at best. But still good-enough for me.

author: JohnnyBerg
author_rank: Frequent Contributor
timestamp: November 18, 2019, 12:22:43 pm
content: As a side note: the layout of the board has a huge impact on the noisiness of the ADC. You can win and loose everything there. I would suggest a good external reference.

author: Brutte
author_rank: Frequent Contributor
timestamp: November 18, 2019, 12:51:43 pm
content: Quote from: exe on November 18, 2019, 12:17:52 pmTroubleshooting internal ADC is way more complicated than troubleshooting external one. I did some STM32L project and this is really tricky to make ADC work within specification. You can easily cripple the performance with just toggling IO in an inappropriate moment of conversion.QuoteEven if you apply a constant Vref/2 to AIN input, the ADC won't return only 0x8000 values. There are going to be 0x7FFF and 0x8001 there, maybe also some other values. Just paste that to excel and measure the variance (1000 samples will do) and if variance is below 0.1 [unit is bit^2] then ADC is fine. If variance is bigger then sth went wrong.

author: exe
author_rank: Unknown
timestamp: November 18, 2019, 01:54:58 pm
content: Quote from: Brutte on November 18, 2019, 12:51:43 pmYeah, I learned this the hard way. Not just there are tons of settings and conversion options, I also had to average at least 10 values on stm32f103 devboard to have any meaningful valuesShould I have separate power rails for digital and analog parts of the ic? For analog plans I'm going to use lt1461... For digital part I'd use something cheaper

author: Brutte
author_rank: Frequent Contributor
timestamp: November 18, 2019, 02:57:44 pm
content: Quote from: exe on November 18, 2019, 01:54:58 pmWell, if you average N samples then the variance decreases N times.For 4 samples [1 0 0 0] and N = 2:Var( [1 0 0 0] ) = 0.25Averaging every two you get [0.5 0] samplesVar( [0.5 0] ) = 0.125The problem is that also the resolution will decrease Log2(N) times and the bandwidth N times. So with your N=10 from 16ksps you finish with 1.6ksps ADC.

author: exe
author_rank: Unknown
timestamp: November 18, 2019, 03:01:36 pm
content: Quote from: Brutte on November 18, 2019, 02:57:44 pmDid you mean that the resolution should increase?

author: Brutte
author_rank: Frequent Contributor
timestamp: November 18, 2019, 05:57:38 pm
content: QuoteOops, resolution increase, bandwidth decrease.

author: iMo
author_rank: Super Contributor
timestamp: November 18, 2019, 08:53:48 pm
content: The ADC noise levels close to what datasheets claim are only possible with 4 layers pcb, imho.And of course perfect grounding, decoupling, etc.

author: techman-001
author_rank: Frequent Contributor
timestamp: November 18, 2019, 09:34:34 pm
content: Quote from: exe on November 18, 2019, 01:54:58 pmI agree with the previous poster who said that the PCB layout can make or break ADC's with regard to noise. This applies to analog as well as digital. Having a full ground plane in a multilayer PCB is probably the first step. Digital is inherently noisy so one needs a multifaceted approach.There is a alternative to averaging for removing noise from ADC outputs, I use it with my cheap (but not so nasty) STM32 Discovery boards, namely a configurable digital tracking filter which rejects variances UNDER a preset value.Of course it's best to get rid of noise at the source as best one can, but removing it entirely is impossible, look at any DSO, they *all* have tons of noise from their front ends.

author: thm_w
author_rank: Super Contributor
timestamp: November 19, 2019, 12:26:52 am
content: I went from 32F302 (1-2 adc) to 32F303 (4 5MSPS adc) now you make me want to try this thingPrice is not even that bad, $3/ea from LCSC. Its a bit slower ADC though, 1MSPS.I would stay with it unless you need more than 70MHz for processing, or some other unique peripheral in the newer devices.I'm not sure why you care about power consumption for a PSU, even if the thing is rechargeable, the MCU is not going to be a significant amount of that power.

author: exe
author_rank: Unknown
timestamp: November 19, 2019, 09:25:01 am
content: Quote from: thm_w on November 19, 2019, 12:26:52 amI was hoping that more efficient MCUs produce less noise on power rails, and may be this could potentially improve analog performance.

author: Yansi
author_rank: Super Contributor
timestamp: November 19, 2019, 09:41:30 am
content: Quote from: exe on November 18, 2019, 01:54:58 pmDon't use the Chinese craptacularly designed devboards with F103 (likely not even genuine F103 on them), then you won't need to average over 10 samples. STM32F1 ADC is pretty good otherwise (compared to some other STM32 specimens).There are unfortunately no other STM32 chips with SDADC available as far as I can tell. And forget on the H7 with its 16bit SAR ADC, it's pure marketing wank. In such a high powered ultrahungry MCU, the ADC produces just noise. Only in some specific doh BGA package, it can be made to work, slightly behaved.Do not switch to other ones, you won't get much if any benefits from that.

author: thm_w
author_rank: Super Contributor
timestamp: November 19, 2019, 11:06:43 pm
content: Quote from: exe on November 19, 2019, 09:25:01 amOh good point, but I don't think it would be enough to matter.More important would be to isolate the Vdd from Vdda with good filtering. You can even use a dedicated reference as Vdda (eg REF3030). The thing with the TQFP-48 package is there is probably no access to Vref and it is internally connected. I added this option on my board but haven't gotten close to be able to test the performance difference between the two yet.

author: Yansi
author_rank: Super Contributor
timestamp: November 19, 2019, 11:09:59 pm
content: Quote from: thm_w on November 19, 2019, 11:06:43 pmBeware of allowable voltage difference between VDDA and VDD. Also note, that VDDA shall be applied first ideally.You better not hack this like that, and get a proper package with the REF+ pin bonded out separately. SDADC also has its dedicated REF pins if I remember correctly.

author: thm_w
author_rank: Super Contributor
timestamp: November 19, 2019, 11:45:21 pm
content: Quote from: Yansi on November 19, 2019, 11:09:59 pmREF3030 = 3V and Vcc can be 3.3V, that is within the spec. Would also be possible to do say 3.35V and 3.3V reference if you wanted as well.But you are right stm32f373 has VRefSD+/-/VddSD available, so thats the better choice to use it. Vdda/Vref are paralleled but not really critical if you've got the 16-bit ADC running.

author: asmi
author_rank: Super Contributor
timestamp: November 20, 2019, 03:59:36 am
content: Never make a change for the sake of change. If existing solution meets all requirements, I see absolutely zero reason to change anything.

author: AE7OO
author_rank: Regular Contributor
timestamp: December 07, 2019, 03:06:44 am
content: I've got 2 or 3 boards that use the STM32F373CC(256K Flash, 48pin). One is a power supply controller and another was my first IV impedance meter(50Khz max testing signal).As long as you pay attention to your layout, follow good PCB design criteria, don't use a auto-router, and actually figure out what ST is talking about in the manuals it's not hard to get 13 or 14 bits out of the SDADCs on the F373.The two power supplies are still working like a champ(0-32VDC, 0-2A full control via USB).I've since created one and half other impedance meters not using the F373. I wanted to be able to test out to at least 150Khz and the SDs loose steam before you even hit 100Khz. The F303CC's 5Msps ADCs worked just fine, but are only 12bit. So for the next version I got a couple of different dual 16/24 ADCs to play with. Right now I'm working on a MCP3911 board. In all cases I'm doing the digital filtering and DFT using the F3xx, which works just fine.As far as the F373 SDADCs go, just make sure you follow the directions on calibration and operation, it's not that hard...Sorry for rambling...