I am using the ATtiny861a and have made it so that the SPI connects to a Radio and an external memory source VIA two different chip select pins but sharing the same MISO/MOSI/CLK line.

Correct me if I am wrong, but are there two different ways that I could wire ISP programming into the circuit? The first way being that I need to put a resistor in each MISO/MOSI/CS/SCK line before the 'Slave' and the other way is that I put a Pull-up/Pull-down resistor into the CS lines. I found this on another site. ( http://www.societyofrobots.com/robotforum/index.php?action=dlattach;topic=10394.0;attach=4420;image )

Which way of programming the circuit would be better(more energy efficient during non-programming/easier installation)? The circuit will be a wireless node so it will not be "functioning" when we are programming it.

(from the link above) If I am using 1.8V to power my circuit, would I change the pull-up resistors to be connected to 1.8V? Is there any downside(more power consumption) to use Pull-up versus Pull-down? Are Pull-up/Pull-down resistors interchangeable or can they only be attached to certain pins? If power consumption is important, what resistor values should I use?

  • \$\begingroup\$ AVRs actively drive their SPI lines. \$\endgroup\$ May 26, 2015 at 18:31
  • \$\begingroup\$ I know they drive the SPI lines, but I am trying to figure out how I should hook up the circuit for ISP. I know the ISP acts as the master when it is connected and the MCU turns into a slave temporarily, however I have other devices connected to the same MISO/MOSI/CLK lines and I do not want them to be receiving anything during the programming, I just want the MCU to be receiving the data. \$\endgroup\$ May 26, 2015 at 18:36

1 Answer 1


If the slave devices are true slave-selected SPI modules, if their Clock Select is pulled high they should put all their outputs to tri-state and stop listening to their inputs.

So the schematic you linked does work. Just imagine the +5V says "VCC", because it should. The pull-up should always go to the VCC of your total device.

In that system only pull-ups will work, because the CS's of the slave devices need to go high in programming mode, when you program an Atmel it goes into reset and its outputs go tri-state (floating). So the resistors will automatically pull the CS high.

What resistor value will still work is dependent on two things: Your programming speed and the capacitance of the CS traces in your device. As I do not know either I cannot advise you fully, but on average I'd estimate 10kOhm should be fine for a small-ish device and a programming speed at or below 250kHz. That'll probably allow the CS of the slave to be charged up to the high before the first useful clock pulse with standard AVR programmers.

Anything much higher than 10k at 1.8V will not offer you savings that you'll notice. At 1.8V the 10k will only drain 180uA when the SS is asserted, and I'm willing to bet that the switching and communications actions in the AVR will use much more than that, let alone the slave device.

You can experiment with 22k and 50k if you want, but stay realistic about all the parameters: When CS is low, you're communicating. Communicating is a reasonable drain in itself.

  • \$\begingroup\$ As for the radio, I will be using a CC2520 from Texas Instruments. I am not 100% sure about which external memory source I will be using. If I have something connected to a pull-up resistor, is that object always consuming power? \$\endgroup\$ May 26, 2015 at 18:40
  • \$\begingroup\$ A radio module (wasn't sure if you really did mean that) will blow the drain of nearly any resistor on the CS line out of the water, so don't worry too much about that. I have to go do some work now, so I can't look at the datasheets for you, but look for what they do when CS is high. If CS is high they should identify their output as tri-state/floating/high-Z. Though from TI I hardly suspect anything other than correct behaviour, as with all other main brands of chips/memories. \$\endgroup\$
    – Asmyldof
    May 26, 2015 at 18:42
  • \$\begingroup\$ I am new to AVR/Microcontrollers/all of this, so sorry if this is a stupid question. What do you mean blow the drain of nearly any resistor? This is what I will be attaching(The chip itself is the cc2520 but it is attached to output pins that I will connect to my MCU) ti.com/graphics/tool/cc2520emk_800.jpg \$\endgroup\$ May 26, 2015 at 18:45
  • \$\begingroup\$ A radio module will use > 10mA (often > 30mA). As I put in the answer a 10k resistor already only uses about 180uA. Resistor drain <<< module drain. No need for huge resistors. "Blow out of the water" is a figure of speech that may have been a bad choice on an international forum (says the Dutch guy ;-) ) on my part. As I said: I also need to make money, so I'm really off for a while now. \$\endgroup\$
    – Asmyldof
    May 26, 2015 at 18:49
  • \$\begingroup\$ Hey, if you ain't dutch, you ain't much! If I have the CS of the radio connected to a pull-up resistor, would the radio always be consuming power? Even if I put the radio to "sleep"?(LPM2 if you look at the datasheet) I know the radio will suck power like crazy and that is ok, but I would like to minimize the power consumption when the radio is not operating. \$\endgroup\$ May 26, 2015 at 18:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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