*warning* untested as I do not have an MPGuino
If you have installed WinAVR and it's in your PATH, then open a command prompt and copy/paste:
this should compile the .cpp file to a .elf, it's one line only so make sure the copy/paste works well!
Code:
avr-gcc -mmcu=atmega328p -I. -fno-tree-loop-optimize -morder1 -funsigned-char -funsigned-bitfields -fshort-enums -fpack-struct -ffunction-sections -fdata-sections -fno-split-wide-types -Wl,--relax,--gc-sections -fno-inline-small-functions -mcall-prologues -gstabs -DF_CPU=20000000 -Os -Wall -Wstrict-prototypes -std=gnu99 -Wa,-adhlns=mpguino.lst -o mpguino.elf mpguino.cpp -L.
this transform the .elf to a .hex
Code:
avr-objcopy -O ihex -R .eeprom mpguino.elf mpguino.hex
check the size of the executable against the chip specs (optional step)
Code:
avr-size -C --mcu=atmega328p mpguino.elf
burn fuses, change "usbasp" with your programmer. Also double check the fuse value but I think they are correct for a 328p
Code:
avrdude -p atmega328p -c usbasp -U lock:w:0x3f:m -U efuse:w:0xfc:m -U hfuse:w:0xd4:m -U lfuse:w:0xdf:m
burn the .hex to the chip
Code:
avrdude -p atmega328p -c usbasp -U flash:w:mpguino.hex
it's ready