MCU recommendations- looking for low pin count with more memory than ATtiny - Page 1
Forum section: electronics / projects

author: hsetlik
author_rank: Newbie
timestamp: May 02, 2024, 11:38:28 pm
content: Hi!New to the forum so I'm not sure if this is the right place to ask, but I'm working on a synthesizer VCO with a built-in tuner and I was hoping for some advice choosing a microcontroller. The first version of this project used an ESP32 WROOM module from an unused dev board I had, which works fine but I'd like to downsize to something more appropriate for what this little tuner actually needs to do, which is just:1. Calculate an audio range square wave's frequency from a rising edge interrupt2. Update a SSD1306-driven OLED with that frequency infoI need a total of 3 IO pins between the interrupt pin and I2C for the display, and I thought the ATtiny202 with its UPDI programming interface and SOIC-8 package might be perfect until I realized there was no way to adequately track tuning in 128 bytes of memory.Right now I'm looking at the STM32G030J6:https://www.mouser.com/datasheet/2/389/stm32g030c6-1826662.pdfand it sounds like a good option as a similar sized package with 8kbytes of RAM, but I wanted to ask if there are other obvious candidates I'm not aware of. Also I've never used CubeIDE or anything STM32 before, so bonus points for anything that plays nice with PlatformIOAny advice much appreciated!

author: Sacodepatatas
author_rank: Regular Contributor
timestamp: May 03, 2024, 12:27:29 am
content: The STM32G030 is well suited for the task. Maybe a bit overkill, but it is very cheap (around 35-40 cents) and well supported. However if you are going to produce thousands of units, you might consider even cheaper contenders that, although not as powerful as the STM32G0x, will also do the job. The CH32V003J4M6 is a RISC-V MCU made by WCH that costs below 20 cents, but you need to purchase a cheap dedicated debug probe (around 4€). There are tons of code examples and many people supporting these chips. Another MCU for considering is the PY32F002AL15S6, you can use any CMSIS-DAP probe you could already have or make (as with the STM32G030, because both are Cortex M0+), and it costs around 10 cents in low quantities, but it is not as well documented as the formers.

author: brucehoult
author_rank: Super Contributor
timestamp: May 03, 2024, 12:58:34 am
content: Quote from: Sacodepatatas on May 03, 2024, 12:27:29 amYes, lots of people doing things with these .. eg ...48 MHz with a wait state or 24 MHz without ... 2 KB RAM, 16 KB flash (so closer to an ATMega328 than to an ATTiny) with your choice of 8, 16, or 20 pins ranging in price from $10c to $14c.https://www.aliexpress.us/item/1005004895791296.htmlhttps://www.aliexpress.us/item/1005005036714708.html// 50 for $5

author: PCB.Wiz
author_rank: Super Contributor
timestamp: May 03, 2024, 01:14:43 am
content: Quote from: hsetlik on May 02, 2024, 11:38:28 pmWhat precision and accuracy do you need on that frequency reading ?Low end MCUs have RC oscillators, of only moderate accuracy.Better accuracy may need a crystal, or an oscillator.Does it need to be 3.3 or 5V ?If you want small, there are MSOP10 MCUs available, Nuvoton ML51BB9AE is 16kF 1kRSO-8 packages tend to be somewhat trailing edge.If you are ok with SO16N, QFN20, or TSSOP20 there a (lot) more choices.

author: wilhe_jo
author_rank: Regular Contributor
timestamp: May 03, 2024, 08:25:46 am
content: Gigadevice has also some very interesting parts.QFN28 is just 4x4mm and is easily soldered with hotair.There are also some tssop20 parts.73

author: mariush
author_rank: Super Contributor
timestamp: May 03, 2024, 09:18:31 am
content: If you're fine with 4 KB of ram, PIC16F chips exist 14-20 pins in ssop, qfn etc etc and they can go up to 64 Mhzexample PIC18F06Q40https://www.digikey.com/en/products/detail/microchip-technology/PIC18F06Q40-I-ST/12807418Yeah it's more expensive but on the other hand you don't need to deal with the complications of arm, has built in voltage reference configurable to 1.024v , 2.048v or 4.096v that would work great with 12 bit adc as you don't need to do floating point math, 12 bit with 4096mV reference gives you 1mV steps (that arm chip only goes up to 3.6v)

author: hsetlik
author_rank: Newbie
timestamp: May 03, 2024, 03:46:48 pm
content: Quote from: Sacodepatatas on May 03, 2024, 12:27:29 amYeah the CH32V003J4M6 looks promising, nice that it's compact and low cost but I did a rough layout of the PCB analog section and realized I can comfortably fit a TSSOP-20 package, so I'm leaning towards the STM32G030F6 now. The ST is more expensive but the CH32V003 isn't available from Mouser or DigiKey and I'll only be making a handful. For the price I probably will order a CH32V003 probe just to experiment.

author: hsetlik
author_rank: Newbie
timestamp: May 03, 2024, 03:55:35 pm
content: Quote from: PCB.Wiz on May 03, 2024, 01:14:43 am