Pages: [1]   Go Down
Author Topic: Unable to use USBtinyISP on a bread board ATMega328p set-up  (Read 91 times)
1 Member and 1 Guest are viewing this topic.
Chard, Somerset UK
Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi all,

I am at my wits end here... This is the set up.

I have been following this http://arduino.cc/en/Main/Standalone and other set-ups. but for speed here is what we have:

New ATMega328p MC on a breadboard.
PIN 1 to RST (also tried with and without the following in various combinations:  Pull-up res 10k and .1uf cap via GND tactile switch
Pin 7 to VCC
Pin 8 to GND
Pins 9 and 10 of the MC connected across 16mhz xtal and 2 x 22 caps which then go to GND.
Pin 17 to MOSI
pin 18 to MISO
Pin 19 to SCK
Pin 20 to VCC
Pin 21 to VCC
Pin 22 to GND
Other end of the comms wires go to a ISP breakout (tried it with out break out as well)
USBtinyISP plugged into USB port.

Now here is odd bit.

If I plug the USBtinyISP into my Uno R3 and select Upload via programmer from the file menu of IDE 1.0.5-r2 it works. (blink sketch)
if I plug the USBtinyISP into my Uno R3 and select Tools > board > Uno then Programmer USBTinyISP then Burn Bootloader. It works.

But I'll be darned if I can get ether feature to work on the breadboard version even with a FTDI usb port powering it + TX/RX and the USBtinyISP power (J3) jumper disconnected.

I just keep getting
Code:
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.

So I tried it via Windows avrdude: -c usbtiny -p M328p still no joy but again if it's on the uno board it works.

I have checked the continuity of the wiring and even soldered one up on a strip board with a DIL socket still the same no wanna play.

This all started because I had this issue with some brand new ATMega644P and PA's that I am building into a prototype that needs more pins than the 328P offers and as I could not communicate with those I figured on Keeping it simple and using tech I already used in the past. I have built lots of stuff using the standalone 328p's in the past but never used an ISP programmer before.

Anyone got any ideas??? cos I am losing the plot, only been at this for like two days - I have read so many web pages on the subject now it's all becoming a haze of MOSI MISO smiley

Would be very grateful if someone can help me out with this one as I am obviously missing something and being daft.

All the best Steve

Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 331
Posts: 16470
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

My first guess:

Fuse bytes not setup to use external crystal clock. Plug new 328p chip into your Uno board and perform a burn bootloader operation on it. Then you should be able to remove the new chip into your breadboard and be good to go.

Second guess:

 Be sure the two crystal caps are 22 pf and not ufds

Good luck and hang in there

Lefty
Logged

Ayer, Massachusetts, USA
Offline Offline
Edison Member
*
Karma: 50
Posts: 1764
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I recall reading in the past that USBtinyISP had some problems in uploading to ATMega328p's due to the ATMega328p's having more memory than USBtinyISP was prepared to deal with.  I did a quick google search and found: http://www.desert-home.com/2012/05/arduino-mega2560-wrapping-up-bootloader.html.

Nick Gammon also had this to say: http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=11357.
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 331
Posts: 16470
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I recall reading in the past that USBtinyISP had some problems in uploading to ATMega328p's due to the ATMega328p's having more memory than USBtinyISP was prepared to deal with.  I did a quick google search and found: http://www.desert-home.com/2012/05/arduino-mega2560-wrapping-up-bootloader.html.

Nick Gammon also had this to say: http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=11357.

I've owned a USBtiny for several years (4?). I've never had any problems programming 328P chips, 644P chips, 1280 chips, and 1284p chips. I do get a verify error when burning bootloader to the my 1280 boards, however the write is correct and it works both burning the bootloader and sketches. Where there is problems with the USBtiny is with the mega2560 chip in that the USBtiny apparently can't work in the protocol needed for chips with flash sizes greater then 128K bytes which the mega2560 has. My only complaint with the USBtiny programmer is how slow it is to write bootloaders to the larger flash chips, 1280, 644, it's like watching paint dry.  smiley-grin

 If I was starting out today with arduino projects I wouldn't bother with getting a USBtiny but just rather buy a cheap Asian nano board and load it with the arduinoISP sketch and make a custom 6 pin ribbon cable/connector. I've used the arduinoISP programmer and it saw no problems with it. However I can't say first hand about programming the current mega 2560 as I don't own one.
 

Lefty
Logged

Grand Blanc, MI, USA
Offline Offline
Faraday Member
**
Karma: 71
Posts: 3503
CODE is a mass noun and should not be used in the plural or with an indefinite article.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Where there is problems with the USBtiny is with the mega2560 chip in that the USBtiny apparently can't work in the protocol needed for chips with flash sizes greater then 128K bytes which the mega2560 has.

Adafruit says USBtinyISP cannot program chips with more than 64K of flash. I'm getting ready to start on a 1284p project, and I was assuming my USBtinyISP wouldn't work.
Logged

MCP79411/12 RTC ... "One Million Ohms" ATtiny kit ... available at http://www.tindie.com/stores/JChristensen/

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 331
Posts: 16470
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Where there is problems with the USBtiny is with the mega2560 chip in that the USBtiny apparently can't work in the protocol needed for chips with flash sizes greater then 128K bytes which the mega2560 has.

Adafruit says USBtinyISP cannot program chips with more than 64K of flash. I'm getting ready to start on a 1284p project, and I was assuming my USBtinyISP wouldn't work.

Yea but keep in mind the difference in AVR flash word size (2 bytes) and flash size given in page one datasheet in bytes. The mega1284p 128kb (64k words) is reachable from the USBtiny, I've done it many times. The mega2560, 256KB (128K words) is not.


Logged

Grand Blanc, MI, USA
Offline Offline
Faraday Member
**
Karma: 71
Posts: 3503
CODE is a mass noun and should not be used in the plural or with an indefinite article.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Where there is problems with the USBtiny is with the mega2560 chip in that the USBtiny apparently can't work in the protocol needed for chips with flash sizes greater then 128K bytes which the mega2560 has.

Adafruit says USBtinyISP cannot program chips with more than 64K of flash. I'm getting ready to start on a 1284p project, and I was assuming my USBtinyISP wouldn't work.

Yea but keep in mind the difference in AVR flash word size (2 bytes) and flash size given in page one datasheet in bytes. The mega1284p 128kb (64k words) is reachable from the USBtiny, I've done it many times. The mega2560, 256KB (128K words) is not.

Ohhhh. They didn't say so I assumed bytes. Well I'll give it a try then. You get some error messages though?
Logged

MCP79411/12 RTC ... "One Million Ohms" ATtiny kit ... available at http://www.tindie.com/stores/JChristensen/

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 331
Posts: 16470
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Where there is problems with the USBtiny is with the mega2560 chip in that the USBtiny apparently can't work in the protocol needed for chips with flash sizes greater then 128K bytes which the mega2560 has.

Adafruit says USBtinyISP cannot program chips with more than 64K of flash. I'm getting ready to start on a 1284p project, and I was assuming my USBtinyISP wouldn't work.

Yea but keep in mind the difference in AVR flash word size (2 bytes) and flash size given in page one datasheet in bytes. The mega1284p 128kb (64k words) is reachable from the USBtiny, I've done it many times. The mega2560, 256KB (128K words) is not.

Ohhhh. They didn't say so I assumed bytes. Well I'll give it a try then. You get some error messages though?

No, not that I recall. Was able to both burn the bootloader and upload sketch using programmer.
Logged

Offline Offline
Edison Member
*
Karma: 28
Posts: 2197
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have never used a USBTinyISP  but I can tell you I breadboarded that same ATmega328 circuit with a $3 chip from DIPMICRO that came with the OPTIBOOT bootloader and all I had to do was plug my FTDI BASIC into it and I was running sketches in 5 minutes.
  http://www.dipmicro.com/store/CPU-ARD328P
I have a 16 Mhz crytal and two 18pf caps and a push button for reset. Everything worked perfectly from the start.have a
TLC5940 with 16 leds running the Knight Ryderback and forth  led sequencer.
Logged

Arduino UNOs, Pro-Minis, ATMega328, ATtiny85, LCDs, MCP4162, keypads,
DS18B20s,74c922,nRF24L01, RS232, SD card, RC fixed wing, quadcopter

Chard, Somerset UK
Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for your reply Lefty,
Quote
My first guess:

Fuse bytes not setup to use external crystal clock. Plug new 328p chip into your Uno board and perform a burn bootloader operation on it. Then you should be able to remove the new chip into your breadboard and be good to go.

Umm. well I thought that was the answer so I double tried this:  
Put the 328p into the chip socket on the UNO board and connected the USBTinyISP, burnt bootloader ok, loaded a sketch ok. Moved the 328p and USBTinyISP to the breadboard, load sketch - fails, burn bootloader - fails.

Set the sketch to blink LEDs on digital Pins 6 and 7 (chip 12 and 13) and put 328p and USBTinyISP  back on Uno, loaded sketch via USBtinyISP and made sure it worked. reconnect USBTinyISP and 328p back on breadboard and ran sketch both LEDs blink ok...  tried writing sketch - failed, tried burning bootloader and again, as expected it failed.

Quote
Second guess:

 Be sure the two crystal caps are 22 pf and not ufds
Double checked the caps are 22pf which they are - (its actually one of three sets I've tried that come as a pair of caps and xtal for these chips.)
Quote
Good luck and hang in there

Lefty
Thanks for the words of encouragement Lefty - feeling really deflated.

Just for clarification; I can upload to any 328p on the breadboard I have tried via my Breakout Board for FT232RL USB to Serial mounted on the breadboard (that is to say 328p on breadboard connected to the PC via the 232RL)  http://www.hobbytronics.co.uk/prototyping/proto-breakout-boards/ft232rl-breakout

I had read the comment about not being able to burn using USBtinyISP to flash sizes larger than 64 and thought that was the problem with the 644p and 644PA which is why I went back to basics with the 328p only to find I had the same issues.

This is so driving mad. but thank you all so much for your comments.

all the best

Steve (about to throw the whole lot in the trash/bin) smiley-sad
« Last Edit: Today at 06:13:11 am by 1studio1 » Logged

Grand Blanc, MI, USA
Offline Offline
Faraday Member
**
Karma: 71
Posts: 3503
CODE is a mass noun and should not be used in the plural or with an indefinite article.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Steve (about to throw the whole lot in the trash/bin) smiley-sad

It must be something simple, don't give up, we do this all the time. How about a picture?
Logged

MCP79411/12 RTC ... "One Million Ohms" ATtiny kit ... available at http://www.tindie.com/stores/JChristensen/

Pages: [1]   Go Up
Jump to: