Well I'm finally getting around to updating to the latest arduino setup and I'm running into an issue I know I've seen before in 1.0.5 but I can't recall how I solved it.
First of all, I'm using Arduino to load a standalone atmega328p on a board with a 10MHz crystal
I've modified the board.txt and avrdude.conf files in the respective directories for each environment to change the clock speed for the UNO board from 16MHz to 10MHz and use an atmega328p as the device. I'm programming using an AVRispv2
In both 1.0.5 and 1.8.6 the programs load into the same microcontroller board but I'm getting very different results. In the original the speed of operation is a factor of 4-10 times faster than that of the 1.8.5 version.
I know I'm close but I can't seem to get over the last hump.
here are snippets of the avr-g++ command for 1.0.5:
avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=10000000 -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -I/Applications/Arduino (original).app/Contents/Resources/Java/hardware/arduino/cores/arduino -I/Applications/Arduino (original).app/Contents/Resources/Java/hardware/arduino/variants/standard
P.S. is there a better way to use the Arduino software to program a standalone microcontroller board? For example, should I make a separate "board" entry in Tools->boards?
You should do this: -DF_CPU=10000000L. Otherwise the number will be treated as an int, which can't hold 10000000.
sonicnuance:
should I make a separate "board" entry in Tools->boards?
That's what I'd do. I'd create my own custom hardware package. That's better than adding a board to Arduino AVR Boards because you don't want to lose your custom board definition everytime Arduino AVR Boards is updated. You can reference pretty much everything from Arduino AVR Boards so there's not much to it:
pert:
You should do this: -DF_CPU=10000000L. Otherwise the number will be treated as an int, which can't hold 10000000.
Thanks Pert for the reply. I was hopeful this was the issue as the symptoms are exactly as would be expected for the clock rate being set too low, but alas, I got the same results Here is a snippet of the avr-g++ command run in Arduino for 1.8.6: