Skip to content

Commit

Permalink
Add copies of all Arduino AVR Boards programmers
Browse files Browse the repository at this point in the history
The platform.txt of the selected programmer is used for Sketch > Upload
Using Programmer. This means that the MightyCore avrdude.conf is not
used for Upload Using Programmer when any programmer not in the
MightyCore programmers.txt is selected which causes failure(eg.,
`avrdude: AVR Part "atmega324a" not found.`) for any of the boards that
require the added part definitions. This issue is fixed by selecting the
MightyCore copy added in this commit from Tools > Programmer.

These programmers are copied from Arduino AVR Boards 1.6.9 with only the
name values modified to identify them as the MightyCore copies. I left
off the Atmel STK500 development board programmer because it is
identical to the STK500 as ISP programmer already included with
MightyCore.
  • Loading branch information
per1234 committed Mar 2, 2016
1 parent 699cac7 commit 777c5d6
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 1 deletion.
3 changes: 3 additions & 0 deletions README.md
Expand Up @@ -44,6 +44,9 @@ This core got two different pinout option. The default one is named "Standard",
</br> </br>
<img src="http://i.imgur.com/PF1HWho.png" width="375"> <img src="http://i.imgur.com/fHC5LQK.png" width="430">

##Programmers
MightyCore adds its own copies of all the standard programmers to the "Programmer" menu. You must select the MightyCore copy of the programmer you are using for "Upload Using Programmer" to work with ATmega1284, ATmega324A, or ATmega164A.

##How to install
#### Boards Manager Installation
This installation method requires Arduino IDE version 1.6.4 or greater.
Expand Down
11 changes: 11 additions & 0 deletions avr/avrdude.conf
Expand Up @@ -1111,6 +1111,17 @@ programmer
miso = ~8;
;

programmer
id = "dapa";
desc = "Direct AVR Parallel Access cable";
type = "par";
connection_type = parallel;
vcc = 3;
reset = 16;
sck = 1;
mosi = 2;
miso = 11;
;



Expand Down
64 changes: 63 additions & 1 deletion avr/programmers.txt
@@ -1,6 +1,6 @@


stk500.name=STK500 as ISP
stk500.name=STK500 as ISP (MightyCore)
stk500.communication=serial
stk500.protocol=stk500
stk500.program.protocol=stk500
Expand All @@ -15,3 +15,65 @@ stk500.program.extra_params= -P {serial.port}
#stk500hvpp.program.tool=avrdude
#stk500hvpp.program.extra_params= -P {serial.port}

# The following are the standard programmers from Arduino AVR Boards 1.6.9 with the name values modified to identify them as specific to MightyCore.
# These are required for Upload Using Programmer to work with the MCUs added to the MightyCore avrdude.conf.

avrisp.name=AVR ISP (MightyCore)
avrisp.communication=serial
avrisp.protocol=stk500v1
avrisp.program.protocol=stk500v1
avrisp.program.tool=avrdude
avrisp.program.extra_params=-P{serial.port}

avrispmkii.name=AVRISP mkII (MightyCore)
avrispmkii.communication=usb
avrispmkii.protocol=stk500v2
avrispmkii.program.protocol=stk500v2
avrispmkii.program.tool=avrdude
avrispmkii.program.extra_params=-Pusb

usbtinyisp.name=USBtinyISP (MightyCore)
usbtinyisp.protocol=usbtiny
usbtinyisp.program.tool=avrdude
usbtinyisp.program.extra_params=

arduinoisp.name=ArduinoISP (MightyCore)
arduinoisp.protocol=arduinoisp
arduinoisp.program.tool=avrdude
arduinoisp.program.extra_params=

usbasp.name=USBasp (MightyCore)
usbasp.communication=usb
usbasp.protocol=usbasp
usbasp.program.protocol=usbasp
usbasp.program.tool=avrdude
usbasp.program.extra_params=-Pusb

parallel.name=Parallel Programmer (MightyCore)
parallel.protocol=dapa
parallel.force=true
# parallel.delay=200
parallel.program.tool=avrdude
parallel.program.extra_params=-F

arduinoasisp.name=Arduino as ISP (MightyCore)
arduinoasisp.communication=serial
arduinoasisp.protocol=stk500v1
arduinoasisp.speed=19200
arduinoasisp.program.protocol=stk500v1
arduinoasisp.program.speed=19200
arduinoasisp.program.tool=avrdude
arduinoasisp.program.extra_params=-P{serial.port} -b{program.speed}

## Notes about Dangerous Prototypes Bus Pirate as ISP
## Bus Pirate V3 need Firmware v5.10 or later
## Bus Pirate V4 need Firmware v6.3-r2151 or later
## Could happen that BP does not have enough current to power an Arduino board
## through the ICSP connector. In this case disconnect the +Vcc from ICSP connector
## and power Arduino board in the normal way.
buspirate.name=BusPirate as ISP (MightyCore)
buspirate.communication=serial
buspirate.protocol=buspirate
buspirate.program.protocol=buspirate
buspirate.program.tool=avrdude
buspirate.program.extra_params=-P{serial.port}

4 comments on commit 777c5d6

@bigjosh
Copy link

@bigjosh bigjosh commented on 777c5d6 Nov 11, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The platform.txt of the selected programmer is used for Sketch > Upload
Using Programmer.

This does not seem to always be true, but adding a superfluous programmers.txt seems to be the best way to ensure the right platform.txt pattern is always used on all platforms (seems to work differently on Windows and OSX).

@per1234
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems to work differently on Windows and OSX

@bigjosh My experience is based on Windows. I don't own a Mac. Are you saying that the platform.txt associated with the selected programmer is NOT used for Sketch > Upload Using Programmer on OSX? What is the behavior?

@bigjosh
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@per1234 We did not exhaustively test which combinations of "upload" and "upload via programmer" map to which recipes in which platform.txt files, but it was clear that in some cases OSX picked a different one than Windows did. While ugly, adding this extra programmers.txt seems to force the IDE to always use the one in the board's platform.txt, and this seems to be the way most people get around this problem.

@bigjosh
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also found oddly that adding a rate parameter to the upload tag in the boards.txt file caused the upload recipe from the boards' platform.txt to be used on Windows even if a programmers.txt was not present in the board directory. There must be some hard coded rules in the SerialUploader class in the IDE that special case out some ad-hoc cases, which is frustrating!

Please sign in to comment.