Taking a look at STM32G0 series

Anything not related to STM32
dannyf
Posts: 447
Joined: Sat Jul 04, 2020 7:46 pm

Re: Taking a look at STM32G0 series

Post by dannyf »

On the tssop20 version of G0, OSC32OUT is routed out. The OSCOUT is not. So it cannot use a high speed crystal. But it can use a lse crystal.

The py32 is the opposite. The OSCOUT is available. But the OSC32OUT is not. So it can take a hse crystal but not a lse crystal. The saving grace here is that the lsi is very accurate out of the box and is trimmable.

And you can always use a software rtc to maintain long term timing accuracy.
ag123
Posts: 1655
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: Taking a look at STM32G0 series

Post by ag123 »

they should have instead place OSC_OUT there, OSC32 isn't always used
dannyf
Posts: 447
Joined: Sat Jul 04, 2020 7:46 pm

Re: Taking a look at STM32G0 series

Post by dannyf »

would agree. being able to use a HSE crystal directly is much more useful than being able to use a LSE crystal directly - I can see that compromise coming out the otherway around for a low-power chip, like the L0.

PY32 got it right I think.
dannyf
Posts: 447
Joined: Sat Jul 04, 2020 7:46 pm

Re: Taking a look at STM32G0 series

Post by dannyf »

PY32 got it right I think.
an unscientific comparison of the PY32 vs. G030: https://dannyelectronics.wordpress.com/ ... stm32g030/

I think the PY32 is hard to beat for its value proposition.
IOsetting
Posts: 2
Joined: Tue Sep 19, 2023 6:33 am

Re: Taking a look at STM32G0 series

Post by IOsetting »

ag123 wrote: Wed Sep 06, 2023 5:08 am they should have instead place OSC_OUT there, OSC32 isn't always used
PY32F002A also has a sibling PY32F002B that outputs OSC32
dannyf
Posts: 447
Joined: Sat Jul 04, 2020 7:46 pm

Re: Taking a look at STM32G0 series

Post by dannyf »

The 002b seemed like a G0 competitor. Sacrificing osc32_out for osc_out is t a good tradoff.

And at 50c/1, it isn't price competitive vs the G0, and definitely not vs the 002a part..
IOsetting
Posts: 2
Joined: Tue Sep 19, 2023 6:33 am

Re: Taking a look at STM32G0 series

Post by IOsetting »

dannyf wrote: Tue Sep 19, 2023 10:24 pm The 002b seemed like a G0 competitor. Sacrificing osc32_out for osc_out is t a good tradoff.

And at 50c/1, it isn't price competitive vs the G0, and definitely not vs the 002a part..
The retail price may vary a lot, because 002B just comes on the market. The actual price of 002B is cheaper than 002A.

The retail price of PY32F002 series on Taobao are:

PY32F002B
* SOP8 MSOP10 SOP16 SOP14 0.5CNY
* TSSOP20 0.52CNY
* QFN20 0.55CNY

PY32F002A
* SOP16 0.54CNY
* TSSOP20 0.55 CNY
* QFN20 0.6CNY

The wholesale price will be about 2 cents cheaper.
Also some suppliers offer OEM parts, e.g. XL32F001(=PY32F002B), XL32F002A(=PY32F002A), different packaging factory but using the same die. You can get even lower price from these suppliers.
dannyf
Posts: 447
Joined: Sat Jul 04, 2020 7:46 pm

Re: Taking a look at STM32G0 series

Post by dannyf »

that pricing makes more sense.

seems to come down to HSE vs. LSE: if you need HSE, pick 002a; and if you need LSE, pick 002b.

for tssop20 only.
ag123
Posts: 1655
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: Taking a look at STM32G0 series

Post by ag123 »

ok I've got my passive 8 mhz crystals, and now need to find ideas to make it oscillate for the HSE :lol:
https://www.aliexpress.com/w/wholesale- ... 2d49S.html

as it turns out i've not quite figured out what is a good way to do it.
I'm thinking of doing some thing like such
https://en.wikipedia.org/wiki/Pierce_oscillator

but that I disliked 74HC04 as that is at least DIP14 or SO14
https://assets.nexperia.com/documents/d ... _HCT04.pdf

it seemed there are some purpose made 'crystal oscillator' chips, but that they won't be available in the 'online flea markets' e.g. AliX or are expensive.
so I started looking at 74LVC1G04
https://www.ti.com/product/SN74LVC1G04
this one is there, being a 'commodity' part, but 'expensive' considering it is just a single cmos transistor/gate
https://www.aliexpress.com/w/wholesale-74lvc1g04.html

any other ideas for a HSE?
I'm also thinking about colpitts oscillator
https://en.wikipedia.org/wiki/Colpitts_oscillator
it is probably a few more parts on a perfboard, but that I can then use cheap BJTs like 2n2222
https://www.aliexpress.com/w/wholesale-2n2222.html
in the 'online flea markets', I'd guess 2n2222 is simply any 'unamed' 'generic' npn transistors where the 'flea mkt' vendors just give it a label.

for the 74LVC04, I'm thinking of using it as like an 'oscillator chip' e.g. using an 'sot23 sop8 adapter' board
https://www.aliexpress.com/w/wholesale- ... apter.html
the crystal takes 2 pins of the sop8, 74LVC04 takes the other 6 pins, then wire it across the not gate, and the output goes to OSC-IN
i'm not sure if that'd after all work.
edit: it seemed 74LVC1G14 may be a better chip/gate as that adds schmitt-trigger inputs
https://www.ti.com/product/SN74LVC1G14
https://www.aliexpress.com/w/wholesale-74lvc1g14.html
so that automatically makes it square waves.


I'm thinking that OSC-IN 'won't bother if it is a sine wave', it would shape it into a square wave after all.
for 'most' purposes, that should do for sysclk and peripherals clock

off-topic, a blurb:
it is quite extreme that these days entire microcontrollers sits in that sot23-6 and with ADC !
https://www.lcsc.com/product-detail/Mic ... 37445.html
while that 74LVC1g04 is just a single cmos transistor module :lol:

oh and of course, these days there are single chip oscillators, don't bother with crystals if you havn't buy them :lol:
https://www.aliexpress.com/w/wholesale- ... lator.html
dannyf
Posts: 447
Joined: Sat Jul 04, 2020 7:46 pm

Re: Taking a look at STM32G0 series

Post by dannyf »

a few suggestions.
1. using invertors is a good way. you want to use non-schmitt / non-bufferred gates. most people recommend single input single gate but I prefer nand gates myself - the other input can be used as on/off switch.
2. you may look into dividers as well - hc4060 for example. easy way to get multiple output frequency from one crystal.
3. if possible, a crystal oscillator is simpler for the G0.
Post Reply

Return to “Off topic”