2024-01-21 05:00 AM - edited 2024-01-21 10:41 AM
Hello stm community. I am designing my first ever PCB board and i need some comments of yours. Here is the screenshots of the pcb schematic and pcb itself. Do you see any mistakes etc? Also I am not sure about the VCAP connection. Is it correctly made?
2024-01-22 01:14 AM
Firstly, congratulations on starting a hardware design! Just a few hints:
L1 and L2 have an inductance of 27nH, which is far too low for decoupling the power supply. L1 should rather have 10...100µH, L2 should rather be in the range of millihenry according to the switched loads. L2 in particular must also have a saturation current of at least the sum of all switched loads, because otherwise their magnetic field can collapse, causing the inductance and thus its effect to drop to zero.
The value of C10 also depends on the size of the loads. If you want to switch the full 500mA per channel with the ULN2003, C10 should rather be in the range 1000...4700µF, which are of course considerably more voluminous and therefore no longer fit on the SMD land pattern. Small consolation: C11 is absolutely not necessary, as the ULN2003 is not a digital component to be buffered.
Micro USB connector: in your design only used as a power supply with 5V. Depending on the source of this 5V, it may only be possible to draw 100mA, the standard maximum is 500mA. However, there are also computers and power supply units that do not care about standards and supply the full specified current. You should therefore first check what total current your loads require and what current your source can supply.
Regards
/Peter
2024-01-22 02:21 AM - edited 2024-01-22 02:41 AM
Firstly huge thanks for giving me a such detailed feedback Peter. This will help me a lot.
Best regards and thanks
2024-01-22 03:40 AM
How do you plan to load your program into MCU ? You didnt route SWIM and Reset signal...
2024-01-22 04:29 AM - edited 2024-01-22 04:43 AM
I am planning to load before the soldering. Since this wont be a dev board, i will only load once it does not create a big problem i think.
2024-01-22 05:56 AM
@bepo-san Regarding the load capacitors, you can find the basics and how to calculate them in the mentioned AN2867. If you give me the values C0, CL and ESR of the crystal, I can check the capacitors for you. The video you cited refers to the STM32, not STM8, and should be seen more as an idea of how to work with KiCAD.
As far as the coils are concerned, I had already specified the order of magnitude, approx. 47...100µH should be a suitable value for L1. In my opinion, L2, C10 and C11 are not necessary as your stepper motor is an inductive load whose current does not need to be buffered with capacitors. However, I would consider a TVS like the SMA6J5.0A or ESDA7P60-1U1M instead of C10 to protect the 5V rail (STM8 and 5V source) from spikes from the stepper motor coils (cathode to VCC, anode to GND). Such spikes are generated when the current-carrying motor coil is switched off and are limited by the freewheeling diode of the ULN2003, but can be quite disruptive or even destructive, which is why a TVS is a good idea.
And finally: @Michal Dudka's advice is definitely worth considering. At the latest when you notice a problem with the system and want to change something, you will be happy about the SWIM port.
2024-02-05 07:04 AM - edited 2024-02-05 12:38 PM
Hello again Peter. I am sorry for the late reply. Last couple of weeks were a bit bussy for me. I have read the documentations and manuels. For the crystal 16 MHz is not required since this will be just a RTC circuit. 32.768 KHz crystal should 1be enough for an RTC application. So i have replaced the crystal with this crystal. I have to ask can I use such a slow crystal with this chip? HSE should be between 1-16 MHz but i could not find an information about LSE. From what i have read about the crystal capacitors, C2 and C3 should be 15 pF i believe. I have replaced the inductors with the TVS you have mentioned. Replaced USB micro B with a USB type C socket since it is double sided and easy to use. Added some solderpads as you and Michal suggested for the RX TX GND SWIM RST pins. Here is the renewed version of the board. Is is good enough?
2024-02-05 02:36 PM
Hello,
why is a very cheap processor important for hobby use? Go for something more recent. Probably some STM32C0 is available at a similar price. Connect USB as written in the datasheet and then you can upload and somehow debug your program via DFU. And do yourself a favout and connect the debug pins. The need for resoldering with every program change will be very tedious.
Cheers
2024-02-05 07:21 PM - edited 2024-02-05 07:22 PM
Hi,
I didn't read all the replies I just did a text search for vias and pads and didn't see anyone pointing out that there are vias in pads (MCU, ULN2003 GND pin and caps). That's something to avoid unless you're very very tight for space. Just draw a trace to the side and add the via. For the ULN2003 GND you could draw a square on the pad to the side and add the vias.
Also , D1 and other components have the reference designator inside the footprint. You won't be able to see them after you mount the components.
Hope that helps.
2024-02-06 03:15 AM
It is a hobby use but i will produce this board 20 pieces or so and give it to the people. And also i have this specific processor. Also since it will not be a development board. I will not change any program on it. I will upload the code and forget about it. Thats why i have choosen this one.