Should I go on and upload my sketch to the Attiny by using the UNO as Programmer?
after upload completed, is it something I have to do before the code start running?
Sorry is this is a silly question... But what I'm thinking is that
when upload completes, Attiny13A will immediately begun to run the code and thus it will send e.g. 5v from PIN 5 back to Arduino UNO (that I'm using as ISP).
I think that this will damage arduino PIN 11 (that it connected to attiny PIN 5 for the programming)
My code also uses Pins 5,6 and 7 for some kind of use (e.g. 5 flashes an LED and 6,7 are inputs)
Should I go on and upload my sketch to the Attiny by using the UNO as Programmer?
Yes, assuming that your electronics is correct (eg you have a current-limiting resistor for the LED.)
For example, the standard Arduinos prior to Uno had an LED connected to SCK (equiv to pin 7.)
after upload completed, is it something I have to do before the code start running?
Nope. You should probably disconnected the wires from the "programmer", but even that isn't necessary.
westfw:
Yes, assuming that your electronics is correct (eg you have a current-limiting resistor for the LED.)
For example, the standard Arduinos prior to Uno had an LED connected to SCK (equiv to pin 7.)
Hello, thank you for your reply.
Yes, i'm using the correct Ohm Resistor.
but my concern is that for example:
1.Arduino Uno will send the code to PINs 1,5,6,7 of aTtiny
2.ATtiny will start functioning and executing the code prior to disconnect from UNO
3.during the execution, Attinh PIN 5 will send 5 volt to lit the LED
but LED is not yet connected because PIN 5 is still connected to Arduino UNO PIN 11
because is doing the ISP programming thing
so, if arduino uno get 5 volt back from Attiny, will this damage it?
Is there any way to prevent attiny from runinning the code immediately after programming
so i can disconnect UNO and connect LEDs etc and then let it run??
Gask:
2.ATtiny will start functioning and executing the code prior to disconnect from UNO
3.during the execution, Attinh PIN 5 will send 5 volt to lit the LED
but LED is not yet connected because PIN 5 is still connected to Arduino UNO PIN 11
because is doing the ISP programming thing
so, if arduino uno get 5 volt back from Attiny, will this damage it?
Is there any way to prevent attiny from runinning the code immediately after programming
so i can disconnect UNO and connect LEDs etc and then let it run??
ive been programming attiny45's 85s and 84s on home made shields using my arduino uno, alot of the time the pins i use to run leds and motor controls are on the same pins the uno uses to send the program to the chip. i've never had an issue where the chip has caused any damage to the uno after programming.
During programming, the "programmer" puts the target into "reset" mode. When programming is done, the programmer resets all of the output signals to "inputs" before taking the target out of reset mode. That should mean that they don't interfere with anything...
Here is the relevant code from the arduinoISP sketch:
void end_pmode() {
SPI.end();
// We're about to take the target out of reset so configure SPI pins as input
pinMode(PIN_MOSI, INPUT);
pinMode(PIN_SCK, INPUT);
reset_target(false);
pinMode(RESET, INPUT);
pmode = 0;
}
And with off-the-shelf ISP programmers (ex USBAsp, USBTinyISP), there is generally a ~1k resistor in series with each programming pin so the target and programmer cant harm eachother if fighting over an I/O pin, no matter what the two devices try to do.