Pages: 1 [2]   Go Down
Author Topic: Arduino Micro as ISP and atTiny84A  (Read 5417 times)
0 Members and 1 Guest are viewing this topic.
Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 207
Posts: 12919
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

California
Offline Offline
God Member
*****
Karma: 14
Posts: 629
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged


Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 207
Posts: 12919
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

California
Offline Offline
God Member
*****
Karma: 14
Posts: 629
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: March 30, 2013, 02:45:52 am by spcomputing » Logged


Germany
Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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...
« Last Edit: March 30, 2013, 05:42:09 am by Flips » Logged

Wahiawa, Hawaii
Offline Offline
God Member
*****
Karma: 29
Posts: 600
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
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:
#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.





* ArduinoMicroasISP.jpg (26.6 KB, 557x420 - viewed 240 times.)
« Last Edit: March 30, 2013, 07:08:54 am by hiduino » Logged

Germany
Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
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:
#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 smiley


Edit: delay(1000) produced a delay of 8000ms, solved by flashing it with board attiny84 @ 1 MHz ... :-P
« Last Edit: March 30, 2013, 08:15:15 am by Flips » Logged

Pages: 1 [2]   Go Up
Jump to: