2

I am designing a board for my electronics project and i am using a number of ATTiny85 for it. The ATTiny's will be SMD so i will not be able to remove them for programming.

Moreover all of the pins of my uCs will be used for connections (apart from reset).

Is it possible in this case to achieve that, any ideas and suggestions are welcome

EDIT: Well, Vcc and Ground will be common, i will be using an external oscillator for all of them, the reset pin will be free, the other three pins will be used for gpio communication between the attinys. I am connecting about 10 attiny in a daisy chain kind of thing

  • Lots more detail needed. You may be in substantial 'trouble' here and may not. How many uCs? What state are the MOSI/MISO/SCK in on other processors when you program one of the,? Are they "hard connected (wire) and do they have to be? - eg could you add resistors between uCs so you can drive a MISO or MOSI or ... pin high or low ehen it is held in a fixed state on other boards? May it be possible to have an "enter programming" mode where all processors explicitly deload all commoned pins as much as possible during programming of 1 of N. | If you reset ALL uC's and SCK is able to be ... – Russell McMahon Jan 29 '15 at 14:10
  • ... clamped low at all but one IC then you could program one only most signals applied to all except SCK which is low for all but the target uC. You MAY be able t do similaar;y and clamp MISO low on all but one but that is getting dangerous as all will clock in the all-0 MISO state. This probably does no harm but would need to be checked. ||| It will be possible to do something which meets your need with minimal disturbance of the design BUT we need much better details in order to be able to interact with you usefully. [I was in Mumbai a few days last March. I'd like to visit longer someday.] – Russell McMahon Jan 29 '15 at 14:15
  • 1
    See table 3 in AVR910 ICSP App Note - resetting all uCs and clamping (or pulling) MOSI high or low on all except target uC should safely isolate all others from programming action. So the ability to isolate MOSI as required on all except target uC would address your requirement. Loading can still be an issue. – Russell McMahon Jan 29 '15 at 14:22
  • @RussellMcMahon I think you have given lots of relevent info here and you should form it up into an answer. As far the the board designing is concerned the entire design is upto me so i can add resisters wherever required as long as it does not cause drop in high and low levels. As far as design is concerned one of the three pins left (MISO MOSI and SCK), one will be common to all uCs (10 Attiny85 that is) and others will form daisy chain. My concern is that all of them will not be input (one input from previous and one output to next. As far as driving is concerned i am not worried ) – Rishabh Jan 29 '15 at 16:55
  • but as you pointed out having another input on same line is an issue. I am willing to add other resistors, capacitors, but adding any other IC will be a problem. It would be highly preferable to not have any jumpers or switches of the kind because we are trying to make the circuit so that any novice can program it. I would love if you want to get into electrical design concepts (me studying EE ofcourse). Do visit college if you come to mumbai again, you may find pretty interesting stuff here :) – Rishabh Jan 29 '15 at 16:59
3

As long as whatever you're connecting the MISO, MOSI, and SCK pins to doesn't mind being driven externally, you can still program the ATTiny in-circuit - just break out those pins with reset to a standard 6 pin header and program them that way.

If one or more of those pins can't be driven externally (eg, because they're connected to another device that drives them and has no output disable), you'll need to add a tristate buffer IC between the MCU and the other device, or some jumpers you can remove when you want to program them.

| improve this answer | |
  • The pins i am connecting them are MISO, MOSI and SCK of other ATTiny, so will putting other attiny in reset work?? i do not want to add a tristate buffer IC :P – Rishabh Jan 29 '15 at 13:34
  • 1
    Sure - as long as you separate the reset pin for each MCU, it doesn't matter if they share the SPI pins; only the one the programmer holds in reset will get programmed. – Nick Johnson Jan 29 '15 at 13:57
  • @Rishabh Note that your query re reset and Nick's answer reflected opposite understandings between you of the state of reset during programming. – Russell McMahon Jan 29 '15 at 13:59
  • @Rishabh - Here is Atmel's ICSP programming guide. atmel.com/images/doc0943.pdf.|It notes "To enter and stay in Serial Programming mode, the AVR microcontroller reset line has to be kept active (low). Also, to perform a Chip Erase, the Reset has to be pulsed to end the Chip Erase cycle. To ease the programming task, it is preferred to let the programmer take control of the target microcontroller reset line to automate this process using a fourth control line (Reset)." ie the device being programmed has reset asserted and the ones not being programmed are NOT reset. ... – Russell McMahon Jan 29 '15 at 14:02
  • 1
    @Rishabh You need to look at the loads provided on MISO MOSI and SCK by the other processors when they are not being programmed. IF a given line is an input all MAY be well. If it is an output you may have problems. Even inputs plus enough cabling etc plus a low drive capability programmer may cause problems. If you want assistance with the electrical aspects here you need to provide a more detailed description. How to connect them may be mainly Arduino related but you are getting into the lectrical design aspects. (I'll play :-) ). – Russell McMahon Jan 29 '15 at 14:05
-1

Well you need access to pins 0 & 1 to program them, so you either do it off-board, or design in a way to access them - perhaps a PCB hole you can wire to temporarily, or a link you can fit/remove that changes the connection.

You will probably need to program them before the rest of the board gets filled up?

You havn't said what you will be connecting to these pins nor how many is an "array" which kind of limits how specific we can be here!

| improve this answer | |
  • Sorry, but this is not a meaningful answer. – Chris Stratton Jan 29 '15 at 16:02
  • Lookin' forward to your answer then... I don't quite see why you feel that way though, you DO need to access those pins & if you're going to wire up an array of linked processors, you have a problem - hence the question. It is short on detail to provide a terribly definitive reply though. – Mark Williams Jan 29 '15 at 16:06
  • Quite simply, you have not addressed the question actually asked. Also, your one specific statement about pins is not accurate for the ISP programming that is the topic. When a question is short on detail, start with comments - not a change of topic "answer". – Chris Stratton Jan 29 '15 at 16:10

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.