Author Topic: MCU recommendations- looking for low pin count with more memory than ATtiny  (Read 501 times)

0 Members and 1 Guest are viewing this topic.

Offline hsetlikTopic starter

  • Newbie
  • Posts: 3
  • Country: us
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 interrupt
2. Update a SSD1306-driven OLED with that frequency info

I 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.pdf and 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 PlatformIO  ;D

Any advice much appreciated!
 

Offline Sacodepatatas

  • Regular Contributor
  • *
  • Posts: 90
  • Country: es
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.
 
The following users thanked this post: hsetlik

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 4056
  • Country: nz
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.

Yes, 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.html

https://www.aliexpress.us/item/1005005036714708.html // 50 for $5

 
The following users thanked this post: hsetlik

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 1584
  • Country: au
1. Calculate an audio range square wave's frequency from a rising edge interrupt
2. Update a SSD1306-driven OLED with that frequency info

What 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 1kR

SO-8 packages tend to be somewhat trailing edge.
If you are ok with SO16N, QFN20, or TSSOP20 there a (lot) more choices.


 
 
The following users thanked this post: hsetlik

Offline wilhe_jo

  • Regular Contributor
  • *
  • Posts: 179
  • Country: at
Gigadevice has also some very interesting parts.

QFN28 is just 4x4mm and is easily soldered with hotair.
There are also some tssop20 parts.

73
 
The following users thanked this post: hsetlik

Offline mariush

  • Super Contributor
  • ***
  • Posts: 5068
  • Country: ro
  • .
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 Mhz

example PIC18F06Q40 https://www.digikey.com/en/products/detail/microchip-technology/PIC18F06Q40-I-ST/12807418

Yeah 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)
 

Offline hsetlikTopic starter

  • Newbie
  • Posts: 3
  • Country: us
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.

Yeah 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.
 

Offline hsetlikTopic starter

  • Newbie
  • Posts: 3
  • Country: us
SO-8 packages tend to be somewhat trailing edge.
If you are ok with SO16N, QFN20, or TSSOP20 there a (lot) more choices.

Yeah was just realizing this- I did a rough PCB layout of the controls and analog section and there's definitely room for a TSSOP20 package, I was leaning towards the STM32G030F6 because it can run off an external crystal rather than relying on the internal RC oscillator like you mentioned.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf