[SOLVED] avr to breadboard help?

HI all, I have an arduino UNO, with the atmega 328p-pu micro-controller. I am trying to use the tutorial: Minimal Circuit (Eliminating the External Clock) http://arduino.cc/en/Tutorial/ArduinoToBreadboard but I persistently get errors, such as:

 avrdude: stk500_recv(): programmer is not responding

I have avrdude installed. I use Linux, and have tried versions 1.0.3 and 1.5.2 of the sketch compiler. The breadboard file is in: /home/user/.arduino/hardware/breadboard/boards.txt'

The programmer is set to Arduino as ISP. the board is set to ATMEGA328 on breadboard (8MHz internal clock)

When trying to burn the boot-loader I get:

avrdude: stk500_recv(): programmer is not responding

When trying to just compile a sketch I get:

In file included from sketch_mar17b.ino:1:
/home/user/sketchbook/hardware/arduino/cores/arduino/Arduino.h:213:26: error: pins_arduino.h: No such file or directory

Which I understand, the pins_arduino.h header isnt in the /home/lol/sketchbook/hardware/arduino/cores/arduino/ folder... but what pins_arduino.h file am I supposed to use?

What I want to do is use the arduino as an ISP. I'm getting confused... do i need 2 micro-controllers to burn a boot loader on to one? (looking and comparing: http://arduino.cc/en/uploads/Tutorial/SimpleBreadboardAVR.png vs http://arduino.cc/en/uploads/Tutorial/ArduinoUSBSerialSimple.png )

can some one please extent some help to me? I cant believe Im the only one having these problems, but I haven't found a solution I can understand yet. Please.

Well the problem may be the state of the fuse bytes on your specific target 328P chip. If it was in prior service set up to use an external crystal then it's fuse bytes were set up for such and will not be able to program it to work with it's internal R/C clock until you can change the fuse bytes, which you can't do without an external crystal for the target chip. It's kind of a catch 22.

So was the chip ever in service using an external crystal?

Lefty

Add LEDs (plus appropriate resistors) on pins 7, 8, and 9 on the Uno. These will show the status of ArduinoISP, or at least provide a sanity check that you actually have ArduinoISP running on the board. Also check the output from “dmesg” to ensure your USB connection to the Arduino isn’t going haywire – I get that problem a lot.

Comparing http://arduino.cc/en/uploads/Tutorial/SimpleBreadboardAVR.png to http://arduino.cc/en/uploads/Tutorial/ArduinoUSBSerialSimple.png, the first one is using a chip that already has the Arduino bootloader installed. You want to be using the second example and can stick with that when burning the fuses, writing the bootloader, or uploading the sketch. Uploading sketches via a serial connection is a feature of the bootloader, but when you’re building your own breadboard versions you won’t be using it unless you specifically want to upload via serial.

In my installation, the two header files are in the same directory in (arduino home)/hardware/arduino/cores/arduino. I’m not sure how or why your hardware/ directory is located under your sketchbook/ directory.

Stuff about breadboarding: http://www.gammon.com.au/forum/?id=11637

It's kind of a catch 22.

That was the part blowing my mind most. Thanks for pointing out Im not going crazy.

[quote author=Nick Gammon link=topic=154870.msg1161199#msg1161199 date=1363586943] Stuff about breadboarding: http://www.gammon.com.au/forum/?id=11637 [/quote]

The pictures at this post made it so I can understand what is going on. I think the documentation on http://arduino.cc/en/Tutorial/ArduinoToBreadboard is most confusing. So i guess I have to order some new ATMEGA micro-controllers, the one I have has a boot-loader on it, and its been programed. Thanks everyone, Ill post back when I get some more chips so i can try these solutions.

Add LEDs (plus appropriate resistors) on pins 7, 8, and 9 on the Uno. These will show the status of ArduinoISP, or at least provide a sanity check that you actually have ArduinoISP running on the board. Also check the output from "dmesg" to ensure your USB connection to the Arduino isn't going haywire -- I get that problem a lot.

Thanks Chagrin, I will try setting up indicator lights, and keeping a tail on dmesg, that's a good idea. as for why things are setup as they are, Im not sure either.... Is /home/user/.arduino/hardware/breadboard/boards.txt' where the boards.text file should be? (provided my arduino home directory is at /home/user/arduino/

Ok, So I finally got some new, never-before programed AVR Atmega328p-pu microcontrolers, and I re-tried the http://arduino.cc/en/Tutorial/ArduinoToBreadboard tutorial. when I use /dev/ttys0 I get an error: "avrdude: stk500_recv(): programmer is not responding" ok fine, I usually use /dev/ttyACM0 to program things. But thats an error too! "avrdude: stk500_getsync(): not in sync: resp=0x98"

I am confounded, nothing seems to work within that tutorial... I can program the original chip just fine, the programmer works fine until I try to upload a boot-loader dmesg reads:

[105249.537906] usb 2-2: USB disconnect, address 10 //reset the arduino

[105694.916021] usb 2-2: new full speed USB device using ohci_hcd and address 11
[105695.147162] usb 2-2: configuration #1 chosen from 1 choice
[105695.150151] cdc_acm 2-2:1.0: ttyACM0: USB ACM device

Voltages on pins 7,8,9 are all 0volts.

So I got an 8MHz boot-loader on a microcontroler! using this: http://www.gammon.com.au/forum/?id=11637 but that forum goes on to say that

We can disconnect our breadboard from the Uno we used to program the bootloader, and using hook-up wire, connect it to the FTDI cable

but I dont want to do that, I still want to use the arduino as my programmer. but this tutorial doesnt seem to go there (maybe i am missing something?) So I am looking back at the arduino to breadboard tutorial but it again doesnt work, I keep gettting the error:

avrdude: stk500_recv(): programmer is not responding

how can I continue to use the arduino to program this micro-controller? I still want to upload and test sketches on it, even though I am going to put it into non-arduino circuits..

What are your fuse settings?

You can find that out from:

http://www.gammon.com.au/forum/?id=11633

Atmega_Board_Detector returns:

Atmega chip detector.
Entered programming mode OK.
Signature = 1E 95 0F 
Processor = ATmega328P
Flash memory size = 32768
LFuse = E2 
HFuse = DA 
EFuse = FD 
Lock byte = EF 
Clock calibration = 89 
Bootloader in use: Yes
EEPROM preserved through erase: No
Watchdog timer always on: No
Bootloader is 2048 bytes starting at 7800

...

OK, you are using the 8 MHz internal oscillator.

the programmer works fine until I try to upload a boot-loader

...

We can disconnect our breadboard from the Uno we used to program the bootloader, and using hook-up wire, connect it to the FTDI cable but I dont want to do that, I still want to use the arduino as my programmer.

I'm confused about these two statements. You want to upload a bootloader, but you want to use the Arduino as a programmer? They are mutually exclusive.

This was referring to the page: http://arduino.cc/en/Tutorial/ArduinoToBreadboard and trying to use that example. I cant get anywhere with that.

the programmer works fine until I try to upload a boot-loader

I want to write sketches to the ATMega328 which is using the internal clock, using the arduino Uno. Then I want to remove the chip and put it in a separate circuit, not needing to use a crystal oscilator. I got the idea this was possible from http://arduino.cc/en/Tutorial/ArduinoToBreadboard.

Am I wrong?

I'm confused about these two statements. You want to upload a bootloader, but you want to use the Arduino as a programmer? They are mutually exclusive.

You can do that, for sure.

If you use my "bootloader installer" sketch here:

http://www.gammon.com.au/forum/?id=11635

And upload the "lilypad (8 MHz)" bootloader, then it should be fine for that purpose.

Thank you MR. Gammon, for all your help! How do I send pizza to your house?

I had some more difficulties after installing the boot-loader. When I read the atmega328 data-sheet, I assumed that D13 was pin 28 (ADC5/SCL/PCINT13) on the micro controller. That was wrong. So today, i traced the etches, and figured out where to place the corresponding wires, and all is well.

Thank you so much! Dead serious about the pizza too.

Glad it's working for you. It is satisfying when these minimal systems work.

You eat the pizza for me, enjoy!