I want to check about making double use of ICSP pins of an AVR chip when soldered to a custom circuit board. That is to say I want to be able to use these pins to bootload/program with an Arduino-as-ISP programmer during setup, and then during operation I want these pins to serve other purposes.
In previous projects I've gotten round this by having the AVR chip as a DIP type which could be placed in a ZIF socket to program then plugged in to a DIP carrier on the custom PCB, but that won't work given I'm wanting to use the SMD version here. And I don't want to add removable jumper connectors or switches to change the connectivity around these pins when programming as vs when in use.
In particular for the ATTiny84 I'm interested in being able to use ALL the analog input channels during operation, but physical pins 7,8 and 9 are the ICSP pins too. I looked at the AVR042 app note but it only has one paragraph about this stuff and seems more focused on situations where one wants to dual use the ICSP pins as output pins to provide high or low voltages to other circuit elements, whereas I want them to serve dual purposes as analog inputs reading voltages from other circuit elements. Circuit elements which would probably be operating, though proper reading obviously wouldn't be needed at the time, at the time the PCB was powered on for programming.
I want to analog read of some outputs of RC lowpass filters, filters with R=10K and C=10nF. That 10K is probably high enough impedance to be ok? Even if the other end of it were going straight to a place which could swing all the way no negligible resistances away from the +5V and/or Gnd rails? The cap is perhaps more of a problem, would putting 1K of series resistance between the cap and an ICSP pin be enough?
Is there any more detailed advice than just AVR042 about how to make use of the ICSP pins for both programming and other uses when the AVR is in use?
Thank you
Besides Rst pin all other ICSP pins can be used as regular pins during the program run. You don't need any special precautions for it, it may be cause why you didn't found any instruction regarding the subject.
I know that being an ICSP pin won't affect how they run during operation of a program, but the fact that they must connect with parts of the circuit they interact with when they are in operation, and remain connected in such fashion (SMD, custom PCB) during the programming procedure means that some types of circuit they could attach to could be such as to affect the programming procedure, this is what I'm trying to mitigate against. I know that if one of them wer say digital reading the output of a logic gate chip, directly, and this logic gate got powered on whenever the ATTiny was powered on 9that means during programming as wella s during use), then that logic gate's output is going to be giving very strong pulls on the arduino input pin, which would make it difficult for the programming procedure to work if that pin was one of the ICSP pins. I'm wanting to analog read and can hopefully get a bit more resistance in series from the pins that one would have if wiring them directly to logic gate outputs, but the same principle surely applies?
Thanks
Can sufficient resistance between an ICSP pin used as an analog input and whatever analog circuitry typically drives that pin during operation be enough, squeezing a jumper or analog switch IC on to this highly compact board design wouldn't be pleasant. Atleast for analog input pins it won't matter that they float when the AVR is held in reset, external circuitry is controlling their voltage already, the question is whether an arduino-as-ISP can overcome this external ciricuitry's control of those pins' voltage? Analog input use is, I hope, less demanding than if those pins went straight to a low impedance output of some sort which they were reading from?
That would mean soldering between the programming and use, fine for a finished device I suppose, but not so goodwhen you're still double checking the software and will have to flash new programs to it several times, having to desolder and resolder those each time would be bothersome.