I have been here asking for help on how to burn a bootloader onto an AtMega328 before, (previous discussion linked here:http://arduino.cc/forum/index.php/topic,150113.0/wap2.html) and I have gotten the burning step to be successful! Using Nick Gammons program, I was able to run the program and get the proper "success" messages as outlined in his tutorial.
However, the next step, loading a program onto the microcontroller returns the following error message:
In file included from Blink.ino:10:
/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/Arduino.h:213:26: error: pins_arduino.h: No such file or directory
I tried this solution and was not successful, does the collective knowledge of the arduino forum have any input on this matter? Thank you so much for all of your help, I feel like such a neophyte, and I hope my questions don't frustrate the community with what I perceive to be basic complications
(Also, is there an alternative method of hyperlinking? Can I post those links embedded in text instead?)
That message is telling you that it could not find the corresponding pins_arduino.h file specified in the boards.txt file of the board you are trying to load.
Which board do you have selected in the IDE and post your boards.txt file in Arduino/Hardware folder.
I used the Arduino to Breadboard tutorial on the arduino website, and thus have the selected board as "ATmega328 on a breadboard (8MHz internal clock)" It's on the correct serial port, (there is only one it could be)
In an attempt to follow the previously posted solution, I had "svc.build.variant=standard" pasted after the "atmega328bb.name=ATmega328 on a breadboard (8 MHz internal clock)" line (which didn't work).
Keeping track of the number and format of the various build and core specifications in boards.txt has been ... challenging, especially when you want to just use the standard cores. Using a custom core is almost easier!
So you recommend that I just.. stick that line in with the other build statements? I feel like there is an entire level of commands you can talk to a microcontroller with that I'm missing...
I feel like there is an entire level of commands you can talk to a microcontroller with that I'm missing...
Probably. But in this case, you're just talking to the Arduino IDE software, telling it where to get the core source code for the board you have configured. As such, the format has changed as the arduino has gone from putting ALL the core software in
...hardware/arduino/cores/arduino/... (supports Uno and MEGA-like boards) to having "variants" as well (allows Leonardo) to allowing allowing different platforms (for Due) and extensions in the users ...Arduino/hardware/extName/... (tiny, sanguino, etc)
The format of the lines in boards.txt is supposed to be easier to manage than typing full directory paths, but it's been changing at a relatively significant rate as broader options become available, and it's not wonderfully documented since "Arduino is so easy to use that it doesn't need a manual."
And I'm just trying to put blink onto the board and it tells me that the programmer is not responding:
avrdude: stk500_recv(): programmer is not responding
Should I take a picture of my setup? (I am using an Uno and removing the Atmega on that to program the microcontroller on the board)
If you are coming straight off an Uno, I'm not sure why you didn't just copy the Arduino Uno entry from the boards.txt and just change only the relevant bits.
You are using an internal RC clock instead of a crystal, you are using 8MHz instead of 16. And the only other bits to change are the name and the identifier (atmega328bb)
atmega328bb.name=Atmega328 on a Breadboard
atmega328bb.upload.protocol=arduino
atmega328bb.upload.maximum_size=32256
atmega328bb.upload.speed=57600
atmega328bb.bootloader.low_fuses=0xE3
atmega328bb.bootloader.high_fuses=0xDE
atmega328bb.bootloader.extended_fuses=0xFF
atmega328bb.bootloader.path=optiboot
atmega328bb.bootloader.file=optiboot_atmega328.hex
atmega328bb.bootloader.unlock_bits=0x3F
atmega328bb.bootloader.lock_bits=0x0F
atmega328bb.build.mcu=atmega328p
atmega328bb.build.f_cpu=8000000L
atmega328bb.build.core=arduino
atmega328bb.build.variant=standard
But, perhaps we need to backup a bit. What bootloader do you have installed? Is this a 328 or a 328P? Are you changing anything with the pin mapping? How are you handling the reset needed to start the bootloader?
Notice that bootloader.path and bootloader.file are different than they were in yours. This is what the Uno uses. From the settings that you posted, it almost looks like you are mimicking a duemilanove.
To get this right, we definitely need to know what bootloader you programmed into your chip at least.
I used Nick Gammons bootloader that was posted in response to my initial questions on these boards, I'm using a 328PN, I'm not changing any of the pins and I'm connecting the reset socket on the Uno to pin 1 of the atmega, If you need any more information, I can try to outline everything I've done/ take a picture! Thank you guys for your help
I am now using the example code you posted instead of the original boards.txt file I was using, and I uploaded Nick Gammons bootloader (indeed using an internal 8MHz clock) and after burning it and receiving success messages, I attempt to load blink onto the 328P. Using the boards.txt provided by Retroplayer, when I try to upload any sketch (in this case, specifically blink), I get this error:
Blink.ino:10:21: error: Arduino.h: No such file or directory
Blink.ino: In function 'void setup()':
Blink:15: error: 'OUTPUT' was not declared in this scope
Blink:15: error: 'pinMode' was not declared in this scope
Blink.ino: In function 'void loop()':
Blink:20: error: 'HIGH' was not declared in this scope
Blink:20: error: 'digitalWrite' was not declared in this scope
Blink:21: error: 'delay' was not declared in this scope
Blink:22: error: 'LOW' was not declared in this scope
Furthermore, in interest of providing as much info as I can, using the chip detector sketch by Nick Gammon, I receive this message (as far as I can interpret, confirming that nothing is wrong?)
I am unsure of what I am doing wrong at this point, as always I appreciate your help so much, this is the final step in getting my senior project to work!
The filepath for the boards.txt file is /Users/[My account name]/Documents/Arduino/hardware/breadboard
To explain it, I'm using a computer running OSX, and it's in the Arduino folder created by the program inside a folder that I made called hardware when prompted to while following this tutorial: http://arduino.cc/en/Tutorial/ArduinoToBreadboard under the "Minimal Circuit (Eliminating the External Clock)" header
I'll read the link you posted, and hope I can find a fix, thank you!
Edit: I forgot to tell you the version of the IDE I am using, I am using 1.0.3 because I heard that custom boards were dealt with differently in 1.5, but since my project also needs a Due, I have both IDE's (could this be part of the problem? I never have both running at the same time...)
I think with that location, the build will end up looking for Arduino.h in /Users/[My account name]/Documents/Arduino/hardware/breadboard/cores/Arduino.h
which presumably doesn't exist (nor do you want it to exist.)
try adding the "arduino:" prefix to the build.core line as in my previous message, and it should work.
Interestingly if I omit the atmega328bb.build.variant=arduino:standard line and replace it with atmega328bb.build.variant=standard I actually get the exact error you specified (that it looks in the cores folder which does not exist), however, with the boards file I included below (with the variant as well as the core line with the arduino: prefix) I still get this error:
avrdude: stk500_recv(): programmer is not responding
I will include my boards.txt file in the hopes that it helps:
atmega328bb.name=Atmega328 on a Breadboard
atmega328bb.upload.protocol=arduino
atmega328bb.upload.maximum_size=32256
atmega328bb.upload.speed=57600
atmega328bb.bootloader.low_fuses=0xE3
atmega328bb.bootloader.high_fuses=0xDE
atmega328bb.bootloader.extended_fuses=0xFF
atmega328bb.bootloader.path=optiboot
atmega328bb.bootloader.file=optiboot_atmega328.hex
atmega328bb.bootloader.unlock_bits=0x3F
atmega328bb.bootloader.lock_bits=0x0F
s
atmega328bb.build.mcu=atmega328p
atmega328bb.build.f_cpu=8000000L
atmega328bb.build.core=arduino:arduino
atmega328bb.build.variant=arduino:standard
Would it be possible for you to post a screenshot of your Arduino folder structure with the subfolders expanded? I think you might have gotten your folders all mucked up by following parts of a windows tutorial.
This is where your boards.txt file should be placed.
/Users/[My account name]/Documents/Arduino/hardware/arduino/
Inside that folder above you should have boards.txt, programmers.txt, and folders bootloaders, cores, firmwares, and variants.
Well, that's one possibility. I'd claim that in this case the boards.txt file should be in
/Users/[My account name]/Documents/Arduino/hardware/breadboard/
and that ALL that should be needed is boards.txt, since we want to use the standard cores/variants/firmwares.
In theory, the "arduino:" prefix tells the IDE to search the original Arduino Install directories instead of the user directorys for the core or variant info.
Having the "cores" item of boards.txt be wrong results in the
Blink.ino:10:21: error: Arduino.h: No such file or directory
error (and subsequent problems.)
The "avrdude: stk500_recv(): programmer is not responding" error has many possible causes, but it SHOULD mean that the cores/variants part of boards.txt is correct, or you wouldn't have gotten that far.