Hi,
I got the following setup to flash a sketch to the ATMega328P-PU with the USBTinyISB v3.0.
Linux, Arduino IDE 1.0.5, ATMega328P-PU on a separate board with no additional hardware (like the quartz, capacitors), 5 Volts to the Vcc and GND Pins is measured.
The wires go from the USBTinyISB 6-PIN header to the ATMega328P-PU like this.
I get the following error when I try to upload the sketch:
avrdude: Error: Invalid -P value: '/dev/ttyS0'
Use -P usb:bus:device
Seems to me that I choose the wrong port. But: When I hook up the ATTiny2313 it works great.
I am not offered to choose a different Serial Port in the menu of the Arduino IDE.
Do the AVCC (PIN 20) and GND (PIN 22) have to be connected additionally ?
How can it be possible that the same hookup does not work for the ATMega328 ? Maybe it's the board entry ??
Thanks for any pointers to solve that problem ?
Regards
AgeBee
Adding power and GND didn't solve the issue.
However, I get another response:
avrdude: stk500_recv(): programmer is not responding
What still troubles me is the fact that it works with ATTiny2313 but not with the ATMega328P. I strongly believe that the entry in boards.txt is wrong.
Ray,
thanks for posting me your settings but neither one did help.
When I used your 'internal' breadboard ATmega328 settings I get the error:
Arduino.h:213:26: error: pins_arduino.h: No such file or directory
When I use the ATmega328 on a breadboard (16MHz Xtal) I get:
avrdude: stk500_recv(): programmer is not responding
There must be one setting which prevents reaching my ATMega328.
BTW, I took another chip and tried with that one. Same negative result. The chip however could flawlessly flashed within an Arduino UNO.
I will keep on searching and let you know when I found a solution.
Regards, AgeBee
I own USBTiny 2.0 and have flashed Atmega168 and Atmega328 without trouble. The programmer powers up the micro so no need for external source. I power both pin 7 and pin 20 with VCC and pin 8 and 22 with GND, conecct the 10k pull-up resistor on RESET pin. Wire up SCK, MISO, MOSI. I also conect a 16MHZ crystal as external oscilator (because I use the same configuration as Arduino), but I don't know if it is really necesary.
Then I use this command on avr dude to burn the .HEX on the chips:
You may try erasing first the chip and then flashing.
Regards.
EDIT: You said your Atmega328P flashes properly on the Arduino UNO? That means the fuses are set to 16 MHZ external oscilator, then you must connect a 16 MHZ crystal to the Atmega in order to flash with the USBTiny. Hope this works.
I know many swear by the Atmel professional programmers, but for attiny45/85 and atmega328P-PU, the Adafruit ZIF shield for UNO is a good $20 investment and in nearly 3 years, I have not had a single issue.
Hi,
thanks mart256 and Ray for your interest in my problem.
@mart256:
The programmer powers the chip up, yes, that's correct and I wired it up as you described it. PIN 7 and PIN 20 with Vcc and PIN 8 and 22 with GND.
However, I did not use a 10k pull-up resistor for the RESET PIN. I connected it directly to RESET of the ISB 6-pin header (PIN 5). Could this be the solution ?
And yes, the chip flashes properly within the Arduino UNO. In one of my tries I used a 16 MHz quartz together with two capacitors to GND. But this did not help.
I'll try two things tonight. First, the 10 k pull-up resistor and then the 'direct' flash with avrdude, i.e. not using the Arduino UNO between it. Just your posted command line.
You suggested erasing it beforehand. This works with the -e switch, right ?
@Ray:
I got me the USBTinyISB because it was said that it works flawlessly. Actually it did and I can remember using it for the ATMega328 nearly two years ago with the Arduino IDE 1.0.0. But since then a couple of things had changed (at least my operating system, Arduino IDE).
AgeBee:
However, I did not use a 10k pull-up resistor for the RESET PIN. I connected it directly to RESET of the ISB 6-pin header (PIN 5). Could this be the solution ?
Regards, AgeBee
Yep, I guess it may be. Conect the reset of the Atmega328p to a 10kpull up and also to the RESET of the ISB 6-pin header (with the crystal with 22pf capacitors and the other suplpy pins connected). Tell us how is it going then.
With Rays ...
ATmega328 on a breadboard (16MHz Xtal)
... I get the answer:
avrdude: stk500_recv(): programmer is not responding
With Rays ...
ATmega328 on a breadboard (8 MHz internal clock)
... I get the answer:
In file included from Blink.ino:10:
Arduino.h:213:26: error: pins_arduino.h: No such file or directory
With my entry mentioned above I get:
avrdude: Error: Invalid -P value: '/dev/ttyS4'
Use -P usb:bus:device
However, I get it on the chip with the command line version:
sudo ./avrdude -c usbtiny -C avrdude.conf -p m328p -U flash:w:Blink.cpp.hex
The quartz and the two capacitors were necessary, however it was not necessary to use the 10 k pull-up from RESET to Vcc. It worked with and also without the resistor. The RES of the USBTinyISB was directly connected to PIN 1 of the ATMega328.
So it seems to me that the problem is in the boards.txt where I do not use the prober values.
Nevertheless it works now.
I'll still keep on working for a solution with/over the Arduino.
Thanks guys for your kind help.
Regards, AgeBee