STM8 dev board problem - Page 1
Forum section: electronics / projects

author: spiller
author_rank: Newbie
timestamp: July 30, 2015, 09:10:23 am
content: Hello,I am making a dev board for STM8S103F3 mcu. The problem is that the stlink will not recognise the controller.The stlink is working correctly, I tried it with another dev board, which my friend ordered from ebay.When I measure the current of the mcu then the current rocks between 20mA to 100mA.The voltage was fine.I soldered the mcu and 1uF and 0.1uF capacitor between VCC and GND as shown on the schematic. Also soldered a pin header, which has VCC, SWIM, GND and RST connected to it(for the stlink) in this particular order.Im out of ideas why this is happening, I have checked the design and remade it 2-3 times already, nothing.Maybe there's something obvious im missing.I added the schematic and pcb below.Any advice/suggestions are more than welcome!

author: Kjelt
author_rank: Super Contributor
timestamp: July 30, 2015, 10:01:31 am
content: Just a few pointers:Check the following:- is the STLink powering the uC (it should be only 20 mA max, so not powering the rest of the board) or are you powering the whole board from external supply (then use a resistor of 15 ohm for Vccbetween ICP socket and the board)- the total swim cable length should be as short as possible (since very high frequency) and NO capacitors should be on this line to ground > 10pF so no 100nF or something like that on that line it will kill the whole swim signal.- use resistors of 100 ohms between the reset and swim signal to the ICP socket.- check if /reset on the uC gets high (from low) and if the debugger is able to pull it low.

author: Kjelt
author_rank: Super Contributor
timestamp: July 30, 2015, 10:03:27 am
content: PS your schematic is some kind of document not a schematic

author: Jeroen3
author_rank: Super Contributor
timestamp: July 30, 2015, 10:42:12 am
content: Sharing university results was probably not indented.

author: spiller
author_rank: Newbie
timestamp: July 30, 2015, 10:52:47 am
content: Quote from: Jeroen3 on July 30, 2015, 10:42:12 amWhat a mistake by me, wow!Schematic is now a schematic.

author: Kjelt
author_rank: Super Contributor
timestamp: July 30, 2015, 11:03:50 am
content: Ok loose R2 (see datasheet of STM8S recommended reset pin schematic) uC has an internal pullup and make sure S2 is NOT closedCheck the swim line on the pcb for shorts or other faults.

author: spiller
author_rank: Newbie
timestamp: July 30, 2015, 11:09:54 am
content: Quote from: Kjelt on July 30, 2015, 10:01:31 am

author: Kjelt
author_rank: Super Contributor
timestamp: July 30, 2015, 11:10:25 am
content: Another thing, you're reset line trace is all over the place, like a big antenna.Best to keep the Capacitor C6 as close as possible to the uC as a filter for unwanted spikes etc.

author: Kjelt
author_rank: Super Contributor
timestamp: July 30, 2015, 11:16:07 am
content: Quote from: spiller on July 30, 2015, 11:09:54 amThere is something wrong, the uC will (without active outputs) use at most around 20mA so check everything double and find out what causes this high current. Better use an external powersupply with current control on 50mA's or so to protect your ST link from damage.QuoteNo that is fine, when I wrote that you did not have the schematic attached so I could not see.QuoteCommon practice to put some kind of protection on outgoing connectors, you never know what is incoming. So normally you put a RC filter on outgoing lines but the SWIM can not handle a C on its line. So I put 100 ohms in series so that is just to limit current if something is going wrong.

author: spiller
author_rank: Newbie
timestamp: July 30, 2015, 11:42:58 am
content: Quote from: Kjelt on July 30, 2015, 11:16:07 amAlright, got it.So, I will redesign the board, move the stlink header closer and add the current limiting resistor to the rst and swim signal.Thanks alot.Will update the topic later this evening.

author: Kjelt
author_rank: Super Contributor
timestamp: July 30, 2015, 12:25:51 pm
content: But first find out whats wrong with the board there might be other problems. It should still work as is now. Remove the cap from the reset line and place it closer to the microcontroller and see if you can get it going.Oh yeah and check where and why all that current is flowing ?

author: spiller
author_rank: Newbie
timestamp: July 30, 2015, 08:43:33 pm
content: Ok, so I connected VCAP capacitor and soldered short wires to rst and swim and powered the board with an arduino. Gave it 3.3V. It worked for a while, STVP recognised the mcu. And then suddenly it didnt anymore and 0.1uF decoupling capacitor started to smoke. I had removed the 1uF decoupling capacitor.Why can this happen?The mcu was drawing 170+ mA at the time and VCAP had 0.9V. The incoming voltage was 3.2V and the voltage after the 0.1uF cap was 3.0V.

author: Kjelt
author_rank: Super Contributor
timestamp: July 30, 2015, 09:16:14 pm
content: Vcap should be >680nF i always use 2,2uF and also for all Vdd pins 2,2uF caps.But why a 100nF cap starts smoking is beyond meWhere did you get them from? Brand? Are they X7R and 10V or higher rating?

author: ajb
author_rank: Super Contributor
timestamp: July 30, 2015, 09:19:45 pm
content: Sounds like you either had a bad capacitor, or you had a very small short, perhaps underneath it. A tiny solder or copper whisker would explain the excessive current draw--a dead short would have had more obvious effects. Other than exceeding its rated voltage, I'm not sure what else would cause an MLCC to smoke.

author: spiller
author_rank: Newbie
timestamp: July 31, 2015, 05:38:57 am
content: Quote from: Kjelt on July 30, 2015, 09:16:14 pmThey most probably are X7R, but dont know the rating tho. A friend bought them from ebay.Thanks

author: spiller
author_rank: Newbie
timestamp: July 31, 2015, 05:42:59 am
content: Quote from: ajb on July 30, 2015, 09:19:45 pmThe small short is logical. I will make a new board anyway with more clearance between the tracks. ThanksBtw, my friend uses the same caps on his designs and they work as they should. So I doubt that rated voltage is being exceeded, but maybe it could be a bad cap indeed.