1
\$\begingroup\$

Alright so there is a question that I need to ask. I am designing a PCB and I plan to include a ISP header for programming. Now one of the programming pins (PB3 - MOSI) is connected to a push button which I take input from. According to the application note (AVR042) I need to connect a 330ohm resistor between the button and the pin. I wanted to ask if it will cause any problem with the button input or not. Also, is my reset connected correctly?

EDIT: The labels are not correctly showing up in EAGLE, my pin config is as follows:

PB3- MOSI

PB4- MISO

PB5 - SCK

PC6 - RESET

Also, the jumper JP_SPST connects to the buttons. enter image description here

\$\endgroup\$
  • \$\begingroup\$ If you are concerned, why don't you connect the push button to a different pin? You have for example PD7 available. Also, why do you ask about the RESET line? \$\endgroup\$ – nickagian Jul 25 '17 at 10:48
  • \$\begingroup\$ That would add unnecessary complications to the code I wrote if I moved on button to another port. My intuition tells me that it should be fine even without the resistor as long as the switch is open. About the reset line, I wanted to ask if the programmer will pull it down correctly due to the connected resistor. \$\endgroup\$ – hacker804 Jul 25 '17 at 10:57
  • 2
    \$\begingroup\$ @hacker804: your diagramm doesn't show where the ISP Header pins are connected to. They are just labeled (MOSI, RESET, SCK, MISO). Do you really expect us to look up where those lines are on this specific ATMEGA chip? Also: where is the button you are talking about? Please put some minmal effort into your question (including diagram) to make it possible to give a qualified answer. \$\endgroup\$ – Curd Jul 25 '17 at 10:59
  • 3
    \$\begingroup\$ Err, I'd think it'd be easier to change the code instead of unnecessarily doubling up pin functionality. GPIO code isn't really too complicated anyways. Code is super easy to change, hardware isn't (I say this as a professional embedded software engineer). \$\endgroup\$ – Phyllostachys Jul 25 '17 at 12:47
  • 1
    \$\begingroup\$ For the first question, the 330Ohms resistance on the button pin does not interfere with the programmation and the input voltage detection. As you have a default open button on the MOSI pin, the resistor is optionnal. For the RESET pin, if you don't use external reset signal, you can omit the pull up resistor (R3). \$\endgroup\$ – Foxrider83 Jul 25 '17 at 13:11
0
\$\begingroup\$

As Foxrider83 correctly pointed out, a resistor is unnecessary between the button and MOSI because the button will never drive the line. It's essentially a dead-end piece of wire when it is not being pressed.

Regarding the reset circuitry, there are other passive components you could add for extra reliability, but you should be okay without them. I have even implemented a reset button without a series resistor (creating a short between the reset pin and ground), and it worked just fine. Since in your design, only an ISP programmer and not a button will be asserting the reset line, it should work fine.

\$\endgroup\$
  • \$\begingroup\$ By the way, even the Arduino UNO does not use a series resistor on the reset button. \$\endgroup\$ – HaLailah HaZeh Jul 28 '17 at 17:20
  • \$\begingroup\$ 4.7k on reset is too strong. 10k as a minimum. Otherwise many programmers will be unable to drive reset down. \$\endgroup\$ – P__J__ Jul 30 '17 at 11:20
  • \$\begingroup\$ @PeterJ The AVR042 document states: "The recommended pull-up resistor value is 4.7kΩ or larger when using STK®600 for programming. For DebugWIRE to function properly, the pull-up must not be less than 10kΩ." \$\endgroup\$ – HaLailah HaZeh Jul 30 '17 at 18:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.