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: Konrad Rosenbaum
Subject: Re: Inverting RST pin (using configuration file) not working on Raspberry Pi?
Date: Tue, 1 Jun 2021 23:59:03 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.2

Hi,

On 01/06/2021 22:01, John Klimek wrote:
Interesting ideas, thanks!

How would I connect a second transistor to re-invert the signal?
Also, could I use a PNP transistor instead?

Okay, some transistor basics. Sorry, if you already know these basics.

This is how:


BC817 is a cheap NPN signalling transistor. You can use any NPN signal transistor.

Assuming you have an input signal that toggles between 3.3V and 0V the transistor Q1 will switch its Collector at "InvertedSignal" between  0V and 3.3V exactly inverting your signal. The R1 resistor is needed to protect the transistor and your power source by limiting the current to about 3.3mA in this case.

R3 has a similar function limiting the input to Q1's base to 3.3mA. I hope you have this one or both the RPi and the Q1 will get very hot just once.

Any value between 500Ω and 5kΩ should do - the lower the value the more current flows, the hotter things get - the higher the value, the less current flows, the less likely that the transistors actually fully switch.

When the InputSignal is 0V the transistor is off and the R1 resistor pulls "InvertedSignal" up to its connected power source - in this case 3.3V - you can change this to 5V by connecting it to the 5V supply instead. When InputSignal is 3.3V the transistor switches on This is basically what you currently have.

By adding Q2 you invert the signal again - the principle is the same as for Q1, only it works on the inverted signal.

The OutputSignal is an inverted form of the InvertedSignal and thus has the same sign as the InputSignal, it just swings between 0V (Input Low) and 5V (Input High).

If you feel paranoid you'll add another resistor between the Collector of Q1 and the Base of Q2, but don't make it too big or Q2 will not get enough current to amplify. Electrically it is not necessary: if Q1 is on then "InvertedSignal" is close to GND and no current flows, if Q1 is off then R1 limits the current.

OutputSignal can be connected directly to the ~RESET pin of the Arduino, since that pin is CMOS with a large pull-up and only a small current will flow.

In theory you can use a PNP transistor for Q2, but it makes things unnecessarily complicated.


But, the easiest way would be to feed the Arduino 3.3V instead of 5V while programming it - it will probably be fine (I never had problems with that).



    Konrad

Attachment: OpenPGP_signature
Description: OpenPGP digital signature


reply via email to

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