I'm trying to figure out if STM32G030F6P6 in TSSOP20 package supports 8MHz crystal. Here is datasheet:
https://www.st.com/resource/en/datasheet/stm32g030j6.pdfOn page 31 in table 12 is: (image1)
In additional function there is OSC_IN but then there is nowhere corresponding OSC_OUT.
Do I need to use LQFP48 if I want to use 8MHz crystal?
You will have to use higher pin count device. The reason OSC_IN is an option is so that you can still feed the external clock. But there is no way to use internal oscillator.
You may want to consider using external CMOS oscillator, they are not that expensive and the difference in board area and device cost may be worth it.
Yes, the smaller-package 'G0 support only HSE BYPASS, i.e. you'd need to use an external oscillator. ST does this also for other families such as 'L0; but in the new 'C0 family (which is derived from the 'G0) there's a better multiplexer allowing to use either LSE or HSE crystal even in small packages (OTOH there's no PLL).
Another option would be to use a 32.768kHz crystal and use it to trim the HSI16 oscillator, if your application would be OK with this.
JW
You may want to consider using external CMOS oscillator, they are not that expensive and the difference in board area and device cost may be worth it.
The price difference between the TSSOP20 and LQFP48 versions is (to me) surprisingly small, at least in our favourite local webshop:
I understand the volatility of pricing etc. so I am not suggesting this is generally the optimal solution, just had a look and been surprised.
JW
CMOS oscillators are available for less than 50 cents and they are so much easier to use than crystals (no need for load capacitors, no sensitive analog stuff).
CMOS oscillators are available for less than 50 cents and they are so much easier to use than crystals (no need for load capacitors, no sensitive analog stuff).
yep, current consumption will be higher and sleep modes will be tricky, but an oscillator is a much easier solution
Ok, that explains it. I can't spare extra 5mA so I will use LQFP48 package instead.
Oh, I felt for this same trap and already got bunch of tssop20 package uc's. My question is, how good is the internal oscillator, is it accurate enough for fast Uart, i2c? Is there any rule of thumb, when you need external oscillator, other than RTC?
I2C, SPI (Synchronous interfaces) are master-slave interfaces, clock driven, so no problem with the accuracy, there's only one clock.
It's good enough for uart, check datasheet for HSI accuracy specs.