Author Topic: stm32 implementation feedback  (Read 2219 times)

0 Members and 1 Guest are viewing this topic.

Offline karsTopic starter

  • Contributor
  • Posts: 21
  • Country: nl
stm32 implementation feedback
« on: April 10, 2019, 10:34:57 am »
hi all!
if been working on a project for the last couple of weeks. its a board based on the stm32f103rbt6 and a NCV7351D10R2G can tranciever.
as im not that experienced with pcb design and microcontroller implementation id like to know what you guys/girls/things thougt of designs.
i know there are still some faults i need to fix (unconnected traces and ground pads).
thanks in advance
kars
 

Offline capt bullshot

  • Super Contributor
  • ***
  • Posts: 3033
  • Country: de
    • Mostly useless stuff, but nice to have: wunderkis.de
Re: stm32 implementation feedback
« Reply #1 on: April 10, 2019, 10:40:11 am »
Looks like you didn't fan out the SWD (serial wire debug) / JTAG pins. It's highly recommended to have them on a conveniently accessibly connector, the ST-Link style debuggers are cheap and easy to use, way more comfortable than dealing with a bootloader.

Add a GND pin to the CAN connector. CAN without GND won't work.

Safety devices hinder evolution
 
The following users thanked this post: kars

Offline karsTopic starter

  • Contributor
  • Posts: 21
  • Country: nl
Re: stm32 implementation feedback
« Reply #2 on: April 10, 2019, 11:05:05 am »
i've added the can ground now. the SWD is a good call but the bootloader is a requirement as it needs to be programmed via the arduino ide (not my requirement, im making this for someone else).
this is also flashable by serial. the SWD pins are still broken out on the main headers in case the new owners still want to use it.
thanks for you quick reply!
 

Offline tsman

  • Frequent Contributor
  • **
  • Posts: 599
  • Country: gb
Re: stm32 implementation feedback
« Reply #3 on: April 10, 2019, 11:21:11 am »
You've got VC and VIN on the XL2012 swapped on your schematic. The capacitor should be on the VC pin.

No bypass caps for that SC662K voltage regulator.

Why does your schematic have flipped labels??
« Last Edit: April 10, 2019, 11:24:47 am by tsman »
 

Offline karsTopic starter

  • Contributor
  • Posts: 21
  • Country: nl
Re: stm32 implementation feedback
« Reply #4 on: April 10, 2019, 11:24:20 am »
you are right, thanks!
 

Offline Dave

  • Super Contributor
  • ***
  • Posts: 1356
  • Country: si
  • I like to measure things.
Re: stm32 implementation feedback
« Reply #5 on: April 10, 2019, 11:29:34 am »
I'd spin the chip 90° clockwise. Your traces seem like they are reaching around the chip on every single side for no reason whatsoever.  :-//
<fellbuendel> it's arduino, you're not supposed to know anything about what you're doing
<fellbuendel> if you knew, you wouldn't be using it
 

Offline emece67

  • Frequent Contributor
  • **
  • !
  • Posts: 614
  • Country: 00
Re: stm32 implementation feedback
« Reply #6 on: April 10, 2019, 11:52:08 am »
.
« Last Edit: August 19, 2022, 02:20:13 pm by emece67 »
 

Offline AndyC_772

  • Super Contributor
  • ***
  • Posts: 4315
  • Country: gb
  • Professional design engineer
    • Cawte Engineering | Reliable Electronics
Re: stm32 implementation feedback
« Reply #7 on: April 10, 2019, 11:54:52 am »
I agree. Whilst you're at it, I'd also make it into a 4 layer board, because there's really no reason not to, and time spent debugging problems that are down to poor power and grounding is simply wasted.

1 - components
2 - GND
3 - power
4 - tracking, and more components if need be

Offline Siwastaja

  • Super Contributor
  • ***
  • Posts: 9327
  • Country: fi
Re: stm32 implementation feedback
« Reply #8 on: April 10, 2019, 12:06:40 pm »
Or, possibly just 45 degrees clockwise, hard to say which is better (45 deg or 90 deg). Try and see.

I wouldn't make it 4-layer on such a super simple board unless I have unlimited budget. It may be only a few dollars in mid-sized batches, but for small quantity prototypes, the two extra layers would become the biggest expense of the project. Of course, if this doesn't matter, 4-layer will be easier to lay out and perform better EMI wise. It's very hard to see that you'd need to debug power and grounding on such a small and simple board on 2 layers.

Instead, add a few GND stitching vias, they are free. You have enough empty space (read: wide copper pours) and enough pin headers with ground connections (natural ground stitching) there so you could do without, probably, but adding a few would be a good habit. You could try adding a few and then we'll give you feedback about how you did.

Quote
1 - components
2 - GND
3 - power
4 - tracking, and more components if need be

And, most of the tracks would naturally go to 1 to minimize vias on signals.
« Last Edit: April 10, 2019, 12:09:20 pm by Siwastaja »
 

Offline tsman

  • Frequent Contributor
  • **
  • Posts: 599
  • Country: gb
Re: stm32 implementation feedback
« Reply #9 on: April 10, 2019, 12:16:19 pm »
Pinout of J3 makes no sense. You need to put BOOT0 and BOOT1 in the middle, 3.3V on the top two pins and ground on the bottom two pins. Your current layout makes it hard to use a 2 pin shunt jumper.
 

Offline mariush

  • Super Contributor
  • ***
  • Posts: 5170
  • Country: ro
  • .
Re: stm32 implementation feedback
« Reply #10 on: April 10, 2019, 04:40:01 pm »
Rotate the chip by 90 degrees.
Make thicker traces  to the IO pins... seem unnecessarily thin.

Any particular reason the DC In connector (or whatever) has to be all the way on the opposite side of the board?
Consider using a better switching regulator (synchronous rectifier so you lose the diode, higher switching frequency so you get smaller inductors)
Plenty of cheap 500kHz or higher switching regulators.

Seems like there's enough room on the board that you could have all the components on one side... and maybe make it cheaper to do reflow soldering on the boards instead of messing around with soldering each side or using glue on the parts...   
« Last Edit: April 10, 2019, 04:43:55 pm by mariush »
 

Offline ajb

  • Super Contributor
  • ***
  • Posts: 2785
  • Country: us
Re: stm32 implementation feedback
« Reply #11 on: April 10, 2019, 04:58:35 pm »
You've left NRST unconnected, that should get a pullup resistor and should be made accessible so that you can hook up an SWD debugger.  Ideally you would also have an SWD header (either the standard 10-pin 50mil header or just extra pins).

 

Online SiliconWizard

  • Super Contributor
  • ***
  • Posts: 15795
  • Country: fr
Re: stm32 implementation feedback
« Reply #12 on: April 10, 2019, 07:06:15 pm »
There is an internal pull-up in most STM32 devices on the NRST pin and I personally never added an external one. Look at section 5.3.14 of the datasheet. What's recommended though is to add a capacitor to ground (like 100nF) to avoid spurious resets in case of parasitics. If your intent is to add a lower resistance external pull-up for the same reason (the typ. internal pull-up is ~40k), I think the capacitor should be enough to do the trick. Just know there *is* an internal pull-up.

As to making it accessible for SWD, I'd recommend it but it's not 100% mandatory. You can absolutely connect via SWD without it, but not in all cases. One case you can't is if the MCU is in stop mode. So yes, if you ever intend to use low-power modes, you have to make NRST accessible to your SWD probe. If it's a development board, just do that, or your users may get angry. ;D
 

Offline AndyC_772

  • Super Contributor
  • ***
  • Posts: 4315
  • Country: gb
  • Professional design engineer
    • Cawte Engineering | Reliable Electronics
Re: stm32 implementation feedback
« Reply #13 on: April 10, 2019, 08:15:04 pm »
I wouldn't make it 4-layer on such a super simple board unless I have unlimited budget. It may be only a few dollars in mid-sized batches, but for small quantity prototypes, the two extra layers would become the biggest expense of the project.

I find the danger with trying to fit everything on 2 layers is that, even if one layer can be a reasonably solid ground plane, the other is inevitably chopped up into bits, which negates the benefit of having it. Sometimes different parts end up completely disconnected, which is OK because the PCB software should at least warn you. Often, though, different areas end up connected through a long, thin, convoluted path which won't flag an error, but it isn't obvious just how bad the plane is unless you trace it out by hand.

Unless there's a strongly compelling reason, I never use 2 layer boards these days. A 4 layer board from somewhere like AllPCB is inexpensive, and it's a good habit to get into from day one. Don't waste any part of your life debugging avoidable signal integrity problems, there's really nothing good about them, not even the learning experience.

Offline langwadt

  • Super Contributor
  • ***
  • Posts: 4857
  • Country: dk
Re: stm32 implementation feedback
« Reply #14 on: April 10, 2019, 09:04:25 pm »
Looks like you didn't fan out the SWD (serial wire debug) / JTAG pins. It's highly recommended to have them on a conveniently accessibly connector, the ST-Link style debuggers are cheap and easy to use, way more comfortable than dealing with a bootloader.

Add a GND pin to the CAN connector. CAN without GND won't work.

and might want to add the option of a termination resistor too
 

Offline Siwastaja

  • Super Contributor
  • ***
  • Posts: 9327
  • Country: fi
Re: stm32 implementation feedback
« Reply #15 on: April 11, 2019, 10:58:14 am »
I find the danger with trying to fit everything on 2 layers is that, even if one layer can be a reasonably solid ground plane, the other is inevitably chopped up into bits, which negates the benefit of having it. Sometimes different parts end up completely disconnected, which is OK because the PCB software should at least warn you. Often, though, different areas end up connected through a long, thin, convoluted path which won't flag an error, but it isn't obvious just how bad the plane is unless you trace it out by hand.

Unless there's a strongly compelling reason, I never use 2 layer boards these days. A 4 layer board from somewhere like AllPCB is inexpensive, and it's a good habit to get into from day one. Don't waste any part of your life debugging avoidable signal integrity problems, there's really nothing good about them, not even the learning experience.

Generally I agree 100%, and recommend what you do as well. But this is such a physically small board, with such small number of nets and power rails, that it's fairly easy to have a full, proper ground plane in a 2-layer design (or nearly so - if you need a cut or two, you still have plenty of space to stitch it to the corresponding top layer, and the number of plane jumps will be limited).

Secondly: even if a beginner fails this process somewhere, by forgetting some important stitching vias, the resulting return path is still only a centimeter or two, maybe max three cm, which should be far from causing any risk of serious SI issues in a board with such medium edge rate devices, hence no frustration in debugging.
 

Offline karsTopic starter

  • Contributor
  • Posts: 21
  • Country: nl
Re: stm32 implementation feedback
« Reply #16 on: April 16, 2019, 10:53:49 am »
based on your feedback i made some modifications like add more bypass capacitors, fix pinouts, rotate the chip and shorten the ground tracks as much as possible
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf