Replies: 6 comments 8 replies
-
Drawing too much current from an individual pin can result in:
I've never observed flakiness in behavior due to this as you describe it. There is also a limitation on total current used among all pins, (i think it was 200mA), did you check that? You could also check that the input voltage is not too close to the brown out voltage, and if you are powering it via usb remember there's a protection diode that lowers the voltage half a volt or so. What flakiness do you observe? Resets or fluctuating gpio voltage? In any case, 30mA per pin is probably too high if you want reliability. |
Beta Was this translation helpful? Give feedback.
-
I'm working on a documentation of the differences bewtween LGT8Fx and their Atmel / Microchip counterparts for some time now. Maybe the following citation helps here. "All high-current capable GPIOs are accessible on all three packages. However, when using the The following table shows the internal resistance in Ohm of the LGT8F328P ports at Vcc= 5V in comparison to the Atmega168/328. Taking these values into account, the limit of 12 resp. 80 mA cited in the datasheet seem very conservative. However, while the Atmega will withstand a momentary external short-circuit of one GPIO at 5V , since the peak current does not exceed 200 mA, a short-circuit of one of the LGT8F328P outputs, specially in the high current mode, has the potential to destroy the chip, if the Vcc supply doesn‘t limit the current to safe values of i.e. 500 mA. Besides the danger of thermally overloading the chip, high sink /source currents can distort the voltage distribution between the functional units of the MCU, leading for instance to a shift oft the H/L threshold for digital inputs and the offset of analog functions like ADC, DAC and comparators. This is aggravated by the fact, that the QFP32 and the SSOP20 packages have just one Vcc and one GND connection for all functions . (QFP48 has two of each for the digital functions and an additional AVcc and AGND for the analog part. ). A conservative upper limit for the total sink/source current per package seems to be 200 mA. |
Beta Was this translation helpful? Give feedback.
-
Ummm, no. Turning off the high and low side switches at the same time will
not prevent EMF from inducing a voltage across the coil. The voltage will
be present across the coil and will both overvoltage the high side and
undervoltage the low side. If you're not seeing this on the scope, it may
be that your scope is just loading the circuit enough to supress it--or
your scope has insufficient bandwidth to see the peaks. If you really want
to drive an inductive load directly with a uC, you may want to look into
adding some diodes to all of the driving pins to protect them from >Vcc and
<GND. Two diodes/GPIO will do it. There are small diodes on the uC die,
but they're not meant for taking this much energy and will fail and that
can lead to other problems with your chips.
…On Sun, Nov 19, 2023 at 12:23 PM John Harrison ***@***.***> wrote:
Yes I am using GPIO as H bridge. There is an inductive component as the
pins are powering coils. I've been worried about flyback voltage and
suspected that first when I started to see problems. My understanding is
there will be no flyback voltage from the coils if both ends of the coil
are floating after being charged so I always make sure to do that in the
software and not leave one side at GND or Vcc. From my oscilloscope
readings it appears this trick is preventing flyback but it's worth keeping
this on the radar as a potential issue for sure.
If you use the QFP48 package, it is essential to connect all 3 GND pins to
ground and the 2 Vcc and the AVcc to the supply voltage.
Yikes that didn't even occur to me to do. I have one Vcc pin and 1 GND pin
connected. AVcc is currently connected to a .1uF cap that connects to GND.
I feel silly that I missed that the pins are not connected internal. Did I
miss this in the datasheet or did you figure this out through emperical
evidence?
—
Reply to this email directly, view it on GitHub
<#305 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACPEX7EM7FBQZRH6RTOAKHDYFI6B7AVCNFSM6AAAAAA7QWDUVSVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM3TMMJSGI4DI>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Protecting a H bridge is not a simple task. Look at this complex protection: https://i.stack.imgur.com/aVFr3.jpg
It is recommended that these be fast schottky diodes. |
Beta Was this translation helpful? Give feedback.
-
In case you can still modify the design, I had success with DRV8833, they are very cheap low voltage mosfet double h-bridges (2.7-10.8v, around half an ohm rds-on) |
Beta Was this translation helpful? Give feedback.
-
Or a BDR6122TC if you like'em cheap and tiny.
…On Sun, Nov 19, 2023 at 3:17 PM David Buezas ***@***.***> wrote:
In case you can still modify the design, I had success with DRV8833, they
are very cheap low voltage mosfet double h-bridges (2.7-10.8v, around half
an ohm rds-on)
—
Reply to this email directly, view it on GitHub
<#305 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACPEX7B4ZMGAD2A7YEQZMGTYFJSNJAVCNFSM6AAAAAA7QWDUVSVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM3TMMJTGI2TI>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
There seems to be a lot of seemingly conflicting information online and in the datasheet about what current the pins of the MCU can and should be able to handle. Referring to this datasheet:
I'm deep into trying to understand flakey behavior on a project which currently requires many of the pins to deliver 20ma (160 ohm load at 3.3V) and I'm trying to determine if the load on the pins could be a factor here.
Beta Was this translation helpful? Give feedback.
All reactions