avr-chat
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Inverting RST pin (using configuration file) not working on Raspberr


From: Martin Stejskal
Subject: Re: Inverting RST pin (using configuration file) not working on Raspberry Pi?
Date: Tue, 1 Jun 2021 21:56:13 +0200

Hi, instead of hacking SW, why not hack HW? Add one more extra NPN, so it will invert signal again?

Depends how brave you are, but there is also another (bit more dangerous) way - add serial resistance. Thing is that every GPIO suppose to have some protection diode (in generic - "every" IC - there are exceptions of course). They typically stand like ~1 mA without problems. I assume that your reset pin on Arduino have 22k pull-up -> use serial resistance ~1/10 of that -> 2k2 -> ~70uA leakage when GPIO on Rpi will be 3.3V. That should not burn Rpi's GPIO. When GPIO on Rpi will be in low, current will be ~200uA, but it will be leaking through switch transistor, which actually can deal with much higher currents.

But before you do any HW changes, make sure you made calculations (worst case) and all necessary measurements before trying on real HW. You have been warned.

When you think about attached schematic, it is just 2 resistors with 2 different power supplies -> quite easy math. If you're not sure, any free simulator can help you out.

Best regards
  Martin S.

On Tue, 1 Jun 2021 at 19:59, John Klimek <jklimek@gmail.com> wrote:
I'm using avrdude (v6.3-20171130) on my Raspberry Pi, but I need the
RST pin to be inverted because I'm using an NPN transistor to protect
the RPi from my Arduino's 5V power.

Here is the command line I'm using for testing:

avrdude -C /root/hid/.platformio/packages/tool-avrdude/avrdude.conf -C
+avrdude-rpi.conf -P /dev/spidev0.0:/dev/gpiochip0 -c rpi -p m32u4 -v
-v -v -v

Here is avrdude-rpi.conf:

programmer
        id = "rpi";
        desc = "RPi SPI programmer";
        type = "linuxspi";
        reset = ~25;
        baudrate = 400000;
;

Here is the avrdude output:

avrdude: Version 6.3-20171130
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is
"/root/hid/.platformio/packages/tool-avrdude/avrdude.conf"
         User configuration file is "/root/.avrduderc"
         User configuration file does not exist or is not a regular
file, skipping
         Additional configuration file is "avrdude-rpi.conf"

         Using Port                    : /dev/spidev0.0:/dev/gpiochip0
         Using Programmer              : rpi

avrdude done.  Thank you.

I've checked the RST pin (25) on my oscilloscope and it's not
triggering at all when I use the inverted (~) syntax.  If I remove the
(~) then it does trigger the RST pin but not inverted as I need.

Attachment: Screenshot_20210601_214314.png
Description: PNG image


reply via email to

[Prev in Thread] Current Thread [Next in Thread]