I just bought an ArduinoMega and am keen to start programming it. However, I was wondering if it is possible to use AVR Studio with the ArduinoMega's bootloader to program it. If it is, will the bootloader not be overwritten when it is programmed or would that require intentional fiddling with the fuse settings?
Is the bootloader's flash area protected by default? I am asking because right now I don't have a programmer that I could use to reprogram the ATmega1280 on that board. Apparently the one I have doesn't support that chip. I have a mySmartUSB MK2.
Thanks in advance!
Quick look into my AVRstudio isn't showing any options to connect through the FTDI chip to program.
You would have to pickup an ISP programmer that supports that chip, and that AVRStudio supports as far as I can tell.
Having said that, you can wire the FTDI to bit bang program the Atmel, and use AVRDude directly outside of AVRStudio using the .HEX you compiled from within.
Programmer Type : STK500
Description : Atmel STK500
Hardware Version: 2
Firmware Version: 1.16
Vtarget : 0.0 V
Varef : 0.0 V
Oscillator : Off
SCK period : 0.1 us
avrdude.exe: AVR device initialized and ready to accept instructions
I’ve had it working for a few days now, thanks, though This is what I have in my Makefile:
#---------------- Programming Options (avrdude) ----------------
# Programming hardware
# Type: avrdude -c ?
# to get a full listing.
#
AVRDUDE_PROGRAMMER = stk500v1
# com1 = serial port. Use lpt1 to connect to parallel port.
AVRDUDE_PORT = com3
AVRDUDE_PORT_SPEED = 57600
AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex
#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep
# Uncomment the following if you want avrdude's erase cycle counter.
# Note that this counter needs to be initialized first using -Yn,
# see avrdude manual.
#AVRDUDE_ERASE_COUNTER = -y
# Uncomment the following if you do /not/ wish a verification to be
# performed after programming the device.
AVRDUDE_NO_VERIFY = -V
# Increase verbosity level. Please use this when submitting bug
# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude>
# to submit bug reports.
AVRDUDE_VERBOSE = -v -v
AVRDUDE_NO_AUTOERASE_FLASH = -D
AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -b $(AVRDUDE_PORT_SPEED) -c $(AVRDUDE_PROGRAMMER)
AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY)
AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE)
AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER)
AVRDUDE_FLAGS += $(AVRDUDE_NO_AUTOERASE_FLASH)
A little further down the Makefile I have a target called “program”:
# Program the device.
program: $(TARGET).hex $(TARGET).eep
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
I’ve been programming the Arduino without weird side effects for about 2 days now using the bootloader.