I finally got a Due, after near 8 weeks in transit. Unfortunately this board is just writing garbage on serial.print(). I found loads of others reporting similar problem and they solved it by putting a new bootloader on the board. So, I'd like to do the same.
I found this guide for how to use a Uno or Mega to load a new bootloader onto the Due.
However, I don't have any Uno og Mega. What I do have is a Pro Micro. So can it be used for this purpose?
The most obvious is that pin connections must be different.
SCK - 13 (uno) - seems to be D15 on Pro Micro
MISO - 12 (uno) - seems to be D14 on Pro Micro
MOSI - 11 (uno) - seems to be D16 on Pro Micro
slave reset - 10 (uno) - seems to be D17 on Pro Micro - but there is no D17 on the board?
So how can I get around the missing D17 pin?
Are there any other issues I'll run into using a Pro Micro for this?
The scetch refers to the pin by name "SS". On the pinout the pin is also labeled "SS". I guess it wouldn't be labled like that unless there were any special about it. What's special about the SS-pin?
SS stands for slave-select. What pin on your Pro Micro is assigned to this?
I'm inclined to revise my original comment about "any pin will do". I hadn't realized that the Uno uses the SS pin to control reset on the breadboard device being programmed. I had placed too much weight on the fact that the SS pin is not used on the breadboard device while it is being programmed.
Can you provide a link to the Pro Micro as I can only see a Micro or a Pro mini.
According to the schematic it looks like the SS pin is connected to one of the leds.
I don't know if that precludes the board from being used to upload code to another device.
There may be two separate issues - (1) is it possible to redefine the pin that SS points to and (2) will the code work if the pin is redefined, probably not if its usage is required by the Atmel hardware.
I think you would have to use the proper SS pin if the Pro Micro was the slave device, but maybe not if it's the master.
Thanks for pointing out the SS = Slave Select.
As I understand the protocol, slave select is just being used for the slave device to tell it's time to listen for incomming signals. It's not serving any purpose on master device. From that I would guess that any pin would do.
Then my best guess for why the sketch uses "SS" would be that they want to use a named pin in order to make the sketch compatible with (almost) any board, independent of pin numbering.
Guess I'll need to try to understand how the pin is used in the sketch.
I don't want to kill the Due. 8 weeks wait for a new one is not what I'm up for now.
I recently tried to use the pro micro as programmer for an ATTiny85, the principle is the same I suppose, just the wiring is going to be different for the due.
There are some things you need to do in order to get the pro micro to work as programmer:
You need to make a copy of the ArduinoISP program in the example folder. There you need to change the following:
Definition of the SCK pin to 15
Definition of the MISO pin to 14
Definition of the MOSI pin to 16
Definition of the RESET pin to 10
Save the updated ArduinoISP as something else, for example ArduinoISP_for_pro_micro
Upload the ArduinoISP_for_pro_microc sketch to the pro micro
At the bottom of this file you need to add the following:
arduinoispleo.name=Pro Micro as ISP
arduinoispleo.communication=serial
arduinoispleo.protocol=arduino
arduinoispleo.speed=19200
Connect the due to the micro (Micro to Due):
Pin 10 to reset
Pin 15 to SCK
Pin 16 to MOSI
Pin 14 to MISO
Ground to ground
In the IDE, select Pro Micro as ISP to burn your bootloader to the due
I'm writing this from memory, I hope I didn't make any mistakes.