Electronics > Microcontrollers

From PIC to STM32

(1/4) > >>

Veketti:
Hi,

Inspired by DavidAlpha’s post on another thread I got thought of starting to replace my mostly utilized PIC16F1847 to STM32G050F6. I’ve done one project earlier with STM32L4S5ZIT and already have Mikroelectronica Fusion for STM32 v8 development board, but they’re not providing MCU card for STM32G050F6..
1. So my question is how would I do the development with this TSSOP 20 MCU? Would it be so simple to solder the MCU to "SSOP-20 to DIP" adapter and use breadboard?
2. Does this transfer to STM make any sense and would this MCU do all the stuff PIC would as long as it has the support for same peripherals?
3. Last but not least. How to program it easiest by ST/link V2 with the 20 pin flat cable. Previous project I implemented the whole 20 pin connector to PCB. There must be easier way. Is there any information how to program with lesser pins with ST/link?

Thank you in advance

ataradov:
1. Yes, it would work. You generally want power supply decoupling capacitors close to the MCU, so ideally on the same breakout board. I would try to mount them locally, but for  G0 it might not matter that much.
2. Sure. Pretty much anything will do what PIC does.
3. Cortex-M0 devices only need 3 wires for programming GND/SWDIO/SWCLK. Reset is desirable, but not mandatory. And some debuggers would need target VCC to power I/O buffers.

How you break that out from the full 20-pin connector is up to you. You can make a simple adapter or use standard 0.05" 2x5 Cortex-Mx debug connector and use existing adapters and tools that have that connectors directly.  On a breadboard you will likely have to use flying wires unless you make some breadboard friendly adapter.

Nominal Animal:

--- Quote from: Veketti on October 11, 2023, 06:10:49 pm ---Would it be so simple to solder the MCU to "SSOP-20 to DIP" adapter and use breadboard?
--- End quote ---
Per the datasheet, you'll want to add some supply bypass capacitors (see 5.1.6 Power supply scheme).  Also note that its maximum supply voltage is 3.6 V, so you might wish to add a voltage regulator or switchmode controller for easier powering.

I recommend you also read AN5096 - Getting started with STM32G0 series hardware development application note.


--- Quote from: Veketti on October 11, 2023, 06:10:49 pm ---Is there any information how to program with lesser pins with ST/link?
--- End quote ---
It has an ARM Coresight SWD debug port, so for the TSSOP-20 package, you only need to connect VDD (pin 4), VSS/GND (pin 5), SWDIO (pin 18), SWCLK (pin 19), and NRST (pin 6).  (I.e., two signal lines, a reset line, supply, and ground.)

To connect any STM32G0 in TSSOP-20 to ST/Link V2:
* VDD: ST/Link pins 1 and 2 –– TSSOP-20 pin 4
* VSS/GND: ST/Link pins 12, 18, and 20  –– TSSOP-20 pin 5
* NRST: ST/Link pin 15 –– TSSOP-20 pin 6
* SWDIO: ST/Link pin 7 –– TSSOP-20 pin 18
* SWCLK: ST/Link pin 9 –– TSSOP-20 pin 19 as described in AN5096 chapter 4.3.3 and ST-Link/V2 User Manual table 4.

nctnico:

--- Quote from: ataradov on October 11, 2023, 06:49:04 pm ---1. Yes, it would work. You generally want power supply decoupling capacitors close to the MCU, so ideally on the same breakout board. I would try to mount them locally, but for  G0 it might not matter that much.
2. Sure. Pretty much anything will do what PIC does.
3. Cortex-M0 devices only need 3 wires for programming GND/SWDIO/SWCLK. Reset is desirable, but not mandatory. And some debuggers would need target VCC to power I/O buffers.

--- End quote ---
Better connect the reset line though. I've seen trouble getting some ST controllers to talk to the SWD interface without the reset line connected.

DavidAlfa:
My advice is to buy a cheap board from AliExpress, less trouble, buy & use!
I bought this one to evaluate the G030, but the G050 pinout should be compatible, so you can simply swap it.
https://a.aliexpress.com/_ExJOvrH

And yeah, the stm32 will blow the PIC out of the water.
Harvard architecture sucks, it got really old, not having separate program and data busses or memory banks makes thing so much better, easier and versatile, everything is accesible in a linear memory map.
Much better peripherals and so much faster cpu while doing more with less instructions.
It's a steep learning curve coming from PIC, but once you get used to it you won't look back.

Navigation

[0] Message Index

[#] Next page

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod