Attiny1606 burning out when connected to a drv8251 - Page 1
Forum section: electronics / general

author: lavaman
author_rank: Contributor
timestamp: April 20, 2024, 07:42:03 pm
content: Hi, I am designing my own locomotive DCC decoder, no need to know what that is. The major problem i am having now is that if i try to use the drv8251 the attiny1606 overheats and then burns out. Even when there is nothing connected to the output, i was just measuring the output voltage with a multimeter. Initially everything was fine, but then, as i said, the mcu burnt out.

author: lavaman
author_rank: Contributor
timestamp: April 20, 2024, 07:42:41 pm
content: https://drive.google.com/file/d/1tMD6DQN1XsESLvD6DEwJkq8qwyXzs5Pj/view

author: MarkF
author_rank: Super Contributor
timestamp: April 20, 2024, 08:11:12 pm
content: Welcome fellow modeler. I do HO scale myself with my own custom throttle power controlled by a laptop computer.https://www.eevblog.com/forum/chat/model-trains/msg4729595/#msg4729595I think your problem is going to turn out to be that you're switching the GND to enable the DRV8251.I'm not familiar with the DRV8251 but suspect the its inputs are floating higher than Attiny Vdd causingits pins to overload.

author: lavaman
author_rank: Contributor
timestamp: April 20, 2024, 08:20:50 pm
content: I am not sure about that, the drv is using the reference voltage of the attiny, plus those resistors on the inputs should prevent possible overcurrent. Prior to assembling the whole PCB, I tested all the parts individually. First the voltage regulator, then separating the signal. And last i tested the drv. For the test i used the same schematic for the drv as shown in the picture before, but instead of the attiny I was controlling it with arduino nano (vcc 5v). That seemed to work with no problem

author: uer166
author_rank: Super Contributor
timestamp: April 20, 2024, 08:24:40 pm
content: Check the 3.3V rail when you turn off the DRV. The previous poster is likely correct: you can't switch that IC's GND and not have it back-power all of its' other pins.

author: lavaman
author_rank: Contributor
timestamp: April 20, 2024, 08:31:01 pm
content: Well that might be true. I didnt get a chance to test this. I don't think that's why the mcu burnt out because the transistor was never off during the test. Everithing seemed alright and than out of nowhere the mcu died.

author: lavaman
author_rank: Contributor
timestamp: April 23, 2024, 07:46:00 pm
content: Thanks for your answers. After some iterations thanks to your recommendations the attiny completely stopped overheating and the circuit is working absolutely fine. But for one fatal exception, the attiny doesn't seem to be able to switch the B input of the drv high. Not sure why tho. All i have done was, directly connect ground to the drv and add 1k ohm resistors between the attiny and input of the drv. One of the inputs can be controlled fully, but the other (input B) cannot be controlled at all and is constantly pulled down, probably by the integrated pulldown resistors of the drv.

author: MarkF
author_rank: Super Contributor
timestamp: April 23, 2024, 08:02:31 pm
content: Why do you think you need to have resistors between the Attiny and the DRV8251?They are both powered by 3.3V?As far as the built-in pull-down resistors. From what I see the pull-downs are 100KΩ (Figure 8-6).Negligible to the Attiny. They are only there so the motor outputs are at Hi-Z (disabled) if theinputs are not connected.Also, insure that both Attiny pins are configured as outputs.

author: lavaman
author_rank: Contributor
timestamp: April 23, 2024, 08:05:33 pm
content: I added those resistors just to be sure not to damage the attiny, but i have tried it even without them resulting in the same situation. One of the inputs can be fully controlled and the other is for some reason always low. Even tried if the attiny pin works, it does.

author: lavaman
author_rank: Contributor
timestamp: April 23, 2024, 08:08:33 pm
content: It might be some kind of a problem with the reference voltage, but i don't think that's the case because that would result in neither of the inputs working

author: Andy Watson
author_rank: Super Contributor
timestamp: April 23, 2024, 09:56:30 pm
content: The schematic has signal PA_2 connected to both PA_2 and PA_4 on the Attiny ?

author: lavaman
author_rank: Contributor
timestamp: April 24, 2024, 05:33:24 am
content: Yes that is shown in the schemat, i wrongly rewritten it. But in the pcb everithing is as intended. Signal input on PA2, outputs for the motor PA3 and PA4

author: mikerj
author_rank: Super Contributor
timestamp: April 24, 2024, 08:13:31 am
content: Quote from: lavaman on April 23, 2024, 07:46:00 pmBy "B" input do you mean pin 2 of the DRV8251? That is adjacent to the ground pin, perhaps you have a small solder ball/whisker causing a short?

author: lavaman
author_rank: Contributor
timestamp: April 24, 2024, 08:30:57 am
content: Yes i mean pin 2 of the drv8251. I measured that and there is no short to ground or the adjecent input (pin 3)

author: lavaman
author_rank: Contributor
timestamp: April 24, 2024, 08:31:51 am
content: This is the current schematic

author: MarkF
author_rank: Super Contributor
timestamp: April 24, 2024, 12:15:36 pm
content: There doesn't seem to be anything wrong with your latest schematic.Barring any connection issues, it seems like the DRV8251 may have beendamaged through all the other issues found thus far.

author: lavaman
author_rank: Contributor
timestamp: April 24, 2024, 12:21:59 pm
content: There should not be anything wrong with the components. I have installed a whole new set of brand new components

author: lavaman
author_rank: Contributor
timestamp: April 24, 2024, 01:22:16 pm
content: I feel like i have tried everything. Separately everything seems to work fine, but when connected together it stops working.I think the only option i havent tryed yet is changing the reference voltage. Not sure if that would make a diffefence.

author: pcprogrammer
author_rank: Super Contributor
timestamp: April 24, 2024, 01:30:29 pm
content: Your Attiny might need better power supply decoupling. In the schematic there is only a 10uF capacitor to decouple the Attiny, and it might be that internal oscillations cause it to overheat. Try adding a 100nF capacitor as close as possible to the Attiny power pin.Another problem can be when the motor starts to run due to the low capacitance in the device. It depends on the input supply voltage and the startup current drawn by the motor. If the voltage temporarily drops to low it might cause a reset of the Attiny. As long as the input voltage onto the MCP1792 stays above the minimum 4.5V it most likely won't be a problem.

author: MarkF
author_rank: Super Contributor
timestamp: April 24, 2024, 01:38:57 pm
content: Along those lines of thought, you might try two things:1) Disable the current sense by tying the ISEN directly to GND.2) Use a 1K resistor in place of the motor to verify operation (i.e. minimal load).BTW. What is the motor voltage you're trying to control?Edit: Dah. I forgot. DCC decoder.

author: lavaman
author_rank: Contributor
timestamp: April 24, 2024, 02:05:22 pm
content: I tryed the first point, no effect. For the second point i tryed connecting a LED, didnt work. And powering the motor doesnt work either.

author: MarkF
author_rank: Super Contributor
timestamp: April 24, 2024, 02:28:01 pm
content: Are you testing this from track power or a lab power supply?For DCC, the track power for HO scale is approx +/-15V @ 5KHz pulse width encoded communication and power.I don't do DCC but that's what I remember. So, you should have plenty of voltage for the 3.3V regulator.I'm assuming that you're using PA2 to decode the DCC commands?___________________________________________________________________Testing with a LED will not work since the LED is not bidirectional. At least use a incandescent light bulb.

author: lavaman
author_rank: Contributor
timestamp: April 24, 2024, 09:31:59 pm
content: It finally works. Turned out to be a problem with the voltage regulator as it is rated only for 100mA max it couldn't deliver enough power for the drv reference and power the attiny. Not sure why it was causing this kind of problem, but after exchanging the old regulator (MCP1792T-3302H/CB) for a new one (AP2210N-3.3TRE1, rated for 300mA), I just seemed to have to laying around, everything works just fine. No overheating, no other problems. Thanks for your help, I really appreciate it.

author: Faranight
author_rank: Unknown
timestamp: April 25, 2024, 05:25:45 am
content: I'm a bit skeptical. Sounds a bit unusual that the attiny and the reference would need that much current. The reference pin of the DRV8251 is internally connected to a high-impedance amplifier input, so it shouldn't draw any noticeable current (see attachment pic). As for attiny, are you sure that it really needs that much current? Do you have a multimeter where you can measure the amount of current draw from the regulator on the 3V3 rail? A scope would also be helpful to see the voltage ripple on that line.

author: lavaman
author_rank: Contributor
timestamp: April 25, 2024, 08:57:22 am
content: I am skeptical too. Power usage on the 3v3 rail, when drv is under load, is around 20mA. Not sure if there was some kind of problem with the voltage regulator.

author: pcprogrammer
author_rank: Super Contributor
timestamp: April 25, 2024, 09:05:47 am
content: Quote from: lavaman on April 25, 2024, 08:57:22 amMeasuring the supply voltages with a scope can show noise levels, but also if there is high frequency oscillation due to the lack of proper decoupling. I have seen this happen in test circuits without decoupling and could solve it by adding a proper decoupling cap. Usually 100nF does the trick.Replacing the LDO with an other one could have changed the dynamics of the circuit and solved the problem that way.

author: Faranight
author_rank: Unknown
timestamp: April 26, 2024, 12:46:24 pm
content: Yep, you definitely want to add a decoupling cap for the microcontroller - a 100nF ceramic (MLCC, X5R/X7R, 16V) will do fine. You always want to use one for each separate power pin of the uC and put them very close to the pins. See theAVR040 application notefor more information on EMC design (read chapter 4.6, or better yet, the whole document).