Go Down

Topic: Arduino Micro as ISP and atTiny84A (Read 14201 times) previous topic - next topic

Coding Badly

I red the data sheet (http://www.atmel.com/Images/8183S.pdf) of the 84A to find the right pins, and so I connected arduino-pin 10 to RESET-pin of the 84A, 11 to MOSI, 12 to MISO and 13 to SCK.


Is this the board you have...
http://arduino.cc/en/Main/ArduinoBoardMicro

If yes then you have to use the ICSP header (or modify the ArduinoISP sketch to use bit-bang SPI).  From that same webpage...
Quote
SPI: on the ICSP header. These pins support SPI communication using the SPI library. Note that the SPI pins are not connected to any of the digital I/O pins as they are on the Arduino Uno, they are only available on the ICSP connector and on the nearby pins labelled MISO, MOSI and SCK.

spcomputing

Or...

Micro pin 8 (SS) to ATtiny Reset Pin
Micro pin 9 (SCK) to ATtiny SCK
Micro pin 10 (MOSI) to ATtiny MOSI
Micro pin 11 (MISO) to ATtiny MISO
http://arduino.cc/en/uploads/Main/arduino-micro-schematic.pdf

Nice catch Coding Badly, I keep thinking of the mini when I see micro.

Coding Badly

Micro pin 8 (SS) to ATtiny Reset Pin
Micro pin 9 (SCK) to ATtiny SCK
Micro pin 10 (MOSI) to ATtiny MOSI
Micro pin 11 (MISO) to ATtiny MISO


I think those are physical pins.  I think the diagram in the upper-left corner is the one of interest...  MOSI is top-left; SS is next to MOSI; SCK is top-right; MISO is next to SCK.

I suspect the ArduinoISP sketch will have to be modified for the SS pin.

Quote
Nice catch Coding Badly, I keep thinking of the mini when I see micro.


Thanks.

spcomputing

#18
Mar 30, 2013, 08:28 am Last Edit: Mar 30, 2013, 08:45 am by spcomputing Reason: 1
Quote
I think those are physical pins.  I think the diagram in the upper-left corner is the one of interest...  MOSI is top-left; SS is next to MOSI; SCK is top-right; MISO is next to SCK.

I suspect the ArduinoISP sketch will have to be modified for the SS pin.


I checked, and the pins on the board and chip coincidentally correspond (Yeah, that does not happen often enough).

The SS/Reset trigger (D10 on the Uno) was a concern for me as well, but I can not find "D10" in the sketch.  It appears to be a SPI hardware call (SS or chip select) and must be in the avr library.  Gammon's programmer would need adjusting from D10 to D8, like the Mega2560.  I will check it out with my Leonardo this weekend.

Edit ---

My bad, SPI is PB0-3.  I put my brain back in and realize your correct on the pin-outs.  Check the pins_arduino

Only access is through the ICSP header.

Flips

#19
Mar 30, 2013, 11:36 am Last Edit: Mar 30, 2013, 11:42 am by Flips Reason: 1
Ok the icsp header are the pins near to the reset button.
Is the conclusion now that on other arduinos, those pins (which were described in the isp sketch comments) are icsp-able but on my micro, I have to use the icsp header?

Edit:
Quote

[...] they are only available on the ICSP connector and on the nearby pins labelled MISO, MOSI and SCK

...ok icsp header or those pins.
(In Germany you say: Reading - Thinking - Posting...;-) )
I'll try that this evening...

hiduino

#20
Mar 30, 2013, 01:06 pm Last Edit: Mar 30, 2013, 01:08 pm by hiduino Reason: 1
The Micro operates like a Leonardo so you will need to define a new programmer to use the arduino protocol instead of stk500v1.  Create a programmers.txt in the sketch folder \hardware\microfix\:
Code: [Select]

arduinoispmicro.name=Arduino as ISP on Micro
arduinoispmicro.communication=serial
arduinoispmicro.protocol=arduino
arduinoispmicro.speed=19200


I used a tip from Nick Gammons site to modify a 6-pin ICSP cable.  You disconnect the reset pin from one side to breakout to connect to the Arduino pin D10.  This trick works well also with the Micro ICSP header.

I modified the ArduinoISP sketch to use D10 instead of SS:
Code: [Select]

#define RESET     10

I used the modified cable to connect the breakout reset line to D10 on the Micro.
I was able to successfully load sketches to a tiny85.




Flips

#21
Mar 30, 2013, 01:43 pm Last Edit: Mar 30, 2013, 02:15 pm by Flips Reason: 1
First of all: NOW IT WORKS!


Quote

The Micro operates like a Leonardo so you will need to define a new programmer to use the arduino protocol instead of stk500v1.  Create a programmers.txt in the sketch folder \hardware\microfix\:
Code: [Select]

arduinoispmicro.name=Arduino as ISP on Micro
arduinoispmicro.communication=serial
arduinoispmicro.protocol=arduino
arduinoispmicro.speed=19200


I've done this already.

Quote

I modified the ArduinoISP sketch to use D10 instead of SS:
Code: [Select]

#define RESET     10

I used the modified cable to connect the breakout reset line to D10 on the Micro.
I was able to successfully load sketches to a tiny85.

This was the last part of this puzzle.

By using the special MISO, MOSI and SCK pins on the top of the arduino micro (near the reset button) and connecting digital pin 10 to RESET of the tiny, the orignal ISP sketch worked with changing the RESET definition from SS to 10 as you said.

I was able to flash the tiny and the blink sketch seems to work (the delay is longer then 1000ms (around 5000ms) but that's another problem).

Many thanks for your efforts, I'm so happy that it works now :)


Edit: delay(1000) produced a delay of 8000ms, solved by flashing it with board attiny84 @ 1 MHz ... :-P

azgar

#22
Aug 25, 2017, 12:22 am Last Edit: Aug 25, 2017, 12:27 am by azgar
I am trying to program ATtiny85 using Arduino ISP sketch in Pro Micro, the board with 32u4 chip.
Pro micro has being successfully programmed with ISP sketch. The heartbead LED pulses like it is supposed to pulse.
But when I'm trying to get my sketch to ATtiny, nothing happens. Pro Micro Rx led blinks several times and nothing.
No programming nor error LEDs on ArduISP light.
That's how I wired the thing: Pins 7,8,9 are for LEDs, ATtiny socket goes like this:


ATtiny  -- Pro Micro
Reset 1 -- Pin 10
GND   4 -- GND
VCC   8 -- VCC
Pin   7 -- 15 SCK
Pin   6 -- 14 MISO
Pin   5 -- 16 MOSI

Or, looking at ATtiny top side,
10      VCC
       15
       14   
GND      16   


I have tried putting 10 uF capacitor between Arduino reset and ground. But it doesn't seem to be working.

azgar

With help of good people I got my programer defined.

Though Arduino IDE complained that program.tool is missing and I added program.tool=avrdude. Is that correct?
Though even with a programmer defined like
Quote
arduinoispmicro.name=Arduino as ISP on Micro
arduinoispmicro.communication=serial
arduinoispmicro.program.tool=avrdude
arduinoispmicro.protocol=arduino
arduinoispmicro.speed=19200
arduinoispmicro.program.extra_params=
the result is the same
Quote
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x24
And I don't even see any activity on Pro Micro Rx LED.

pert

#24
Aug 28, 2017, 12:02 am Last Edit: Aug 28, 2017, 12:10 pm by pert
I created a 3rd party programmer package that can be installed via Boards Manager to make it as easy as possible to add support for using an ATmega32U4 based board like Micro, Pro Micro, Leonardo for an "Arduino as ISP" programmer:
https://github.com/per1234/ATmega32U4asISP


@azgar, please install and try using that programmer to see if it will solve your problem.

azgar

#25
Aug 28, 2017, 07:22 am Last Edit: Aug 29, 2017, 08:17 am by azgar
@azgar, please install and try using that programmer to see if it will solve your problem.
I made a quick check before work, thanks! It has successfully passed the uploading the sketch.
My sketch actually works on ATtiny, the LED blinks.
That's a great deal of progress. Thank You.

That's how the programmer got defined:
Quote
arduinoasisp4.name=Arduino as ISP(ATmega32U4)
arduinoasisp4.communication=serial
arduinoasisp4.protocol=arduino
arduinoasisp4.speed=19200
arduinoasisp4.program.protocol=arduino
arduinoasisp4.program.speed=19200
arduinoasisp4.program.tool=avrdude
arduinoasisp4.program.extra_params=-P{serial.port} -b{program.speed}

Go Up