What is the best way to load sketch on breadboard Atmel3

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
opamp
 
Posts: 13
Joined: Tue Oct 02, 2012 11:55 am

What is the best way to load sketch on breadboard Atmel3

Post by opamp »

Hi,
I setup an AtMega 328p-pu on my breadboard with 16MHz crystal, 22pf caps, voltage regulator etc and burned the bootloader onto the chip using my Arduino Uno (Arduino as ISP) with the MISO, MOSI, SCK and reset pins brought over to the corresponding pins on the breadboard 328p-pu. The Ardiuno IDE indicated the bootloader was burned successfully.

I then went to upload the blink sketch to the chip on the breadboard (wires left in place between Uno and 328p-pu on breadboard) and everything seemed to work (breadboard LED blinking as expected) until I removed the wire from pin 13 on the Arduino board and the LED stopped blinking on the breadboard. I removed all the connections between the Arduino Uno and the 328p-pu on the breadboard, pressed the reset button for the 328p-pu and my activity light blinked per the reset but was dark after that.

So I am guessing that my sketch was loaded onto the Uno and not the 328p-pu chip on the breadboard, because the LED started blinking again when pin 13 was reconnected.

My question is, while I can use the Uno to help burn the bootloader, is that same setup supposed to work for uploading sketches to the breadboard chip or do I need something like the FTDI friend or FTDI cable to run the serial connection directly from the IDE/laptop to the pins on the breadboard?

I don't have an AVR programmer and it would be great if I could just leverage my existing Uno to provision new chips and get sketches on them for permanent projects. I started this all trying to use the Arduino Micro to achieve the above but it would not even load the bootloader. What are the limitations? Do only certain boards work in this respect? I was able to get a sketch working on breadboard ATTiny85 chip (Look Ma, no wires!) and thought the 328p-pu would be just as easy.

There does not seem to be much good documentation around bootloading from a board to breadboard target and uploading sketches. I just purchased the FTDI friend, not sure if that was a waste of $15. I want to be able to burn a variety of chips and upload sketches without a bunch of additional hardware, cables programmers, friends etc. Confused, can someone set me straight?

User avatar
Franklin97355
 
Posts: 23910
Joined: Mon Apr 21, 2008 2:33 pm

Re: What is the best way to load sketch on breadboard Atmel3

Post by Franklin97355 »

Once you burn the bootloader you can communicate using the FTDI friend or FTDI cable to the 328 on the breadboard or you can load the sketch into the 328 on the uno and then remove it and put in in your circuit then replace the chip on the uno and burn a new bootloader although I would burn the bootloader to the new chip then swap out your known good uno chip and put it in a safe place and work with the new chip in case you screw something up, I know that never happens but why chance it...

User avatar
opamp
 
Posts: 13
Joined: Tue Oct 02, 2012 11:55 am

Re: What is the best way to load sketch on breadboard Atmel3

Post by opamp »

I think you are getting me closer to an understanding. Where would the pins from the FTDI go to on the breadboard 328, MOSI, MISO, SCK and RST? Or TX, RX and RST? I guess I'll use the FTDI since I bought it but still curious if I really needed it in the event I don't want to pull the chip out of my Uno.

One last question, will the FTDI Friend work for direct bootloading as well or just loading sketches to chips that already have the bootloader?
Thanks,
-opamp

User avatar
opamp
 
Posts: 13
Joined: Tue Oct 02, 2012 11:55 am

Re: What is the best way to load sketch on breadboard Atmel3

Post by opamp »

So my Adafruit FTDI Friend just arrived today I have it hooked up VCC-Power 5v, GRD-GRD, RST-RST, RX-TX, TX-RX. FTDI Friend shows up as serial port in Arduino IDE and was selected. I tried to upload the blink sketch - no go. The error is "avrdude: stk500_recv(): programmer is not responding". The target board was set as Uno. I confirmed my wiring multiple times against an Arduino/ATMega328 pinout chart. The breadboard ATMega328 has power etc. I notice that when I attempt to upload the sketch that only one of the LEDs on the FTDI board light up, the red one, should I see activity on both LEDs?

Driver was installed and verified. I hit the reset button right before I uploaded, made no difference. Can someone please confirm this is the proper setup? The Adafruit tutorial goes into painful detail about how to use the FTDI Friend to burn a bootloader and explains it will take hours (not sure that would be a popular use case) but it does not touch on using it to upload a sketch onto a 328 chip w/bootloader on a breadboard. I have to imagine that would be a very common use.

Some confirmation and troubleshooting tips beyond what I have outlined here would be helpful. Many Thanks,
-opamp

User avatar
opamp
 
Posts: 13
Joined: Tue Oct 02, 2012 11:55 am

Re: What is the best way to load sketch on breadboard Atmel3

Post by opamp »

Ok, I hooked up my FTDI Friend to the appropriate ports on the Arduino Uno, VCC-VCC, GRD-GRD, TX-RX, RX-TX and RST-RST. Tried uploading the Blink sketch, same error, same issues. Only the red LED blinks on the FTDI board and the Arduino IDE reports that the programmer is not responding.

This test rules out a host of issues such as breadboard wiring, bad chip etc. For the record, I swapped out all my jumper wires just to be safe. The only time the green LED on the FTDI Friend blinks is when I plug the USB cable into my computer. Starting to look like FTDI board is no good...???

User avatar
Franklin97355
 
Posts: 23910
Joined: Mon Apr 21, 2008 2:33 pm

Re: What is the best way to load sketch on breadboard Atmel3

Post by Franklin97355 »

Ok, I hooked up my FTDI Friend to the appropriate ports on the Arduino Uno,
You lost me. I thought you were connecting to a chip on a breadboard. You would connect to that chip (with a bootloader and use the IDE to download a sketch over the FTDI friend com port.

User avatar
opamp
 
Posts: 13
Joined: Tue Oct 02, 2012 11:55 am

Re: What is the best way to load sketch on breadboard Atmel3

Post by opamp »

My original purpose was to use the FTDI Friend to upload a sketch to the ATMega328 chip on a breadboard. The reason I tried using the FTDI on the Arduino board was to test in a way that would eliminate any possible config/connection issue on the breadboard.

I have since moved my FTDI wires back to the breadboard chip. From everything I have read, I have this hooked up properly to the breadboard but I consistently get the programmer is not responding error. My pin 13 (19 on the chip) LED blinks when I hit my breadboard reset button so I know the reset function works. I've been at this several hours now and just getting frustrated with the whole Arduino experience. I swapped out chips, wires etc, checked, double check, triple checked to isolate out any mistake or fault and my $15 (FTDI Friend) seems to be a waste as I am no further along. I should at least see the green LED on the FTDI board blink when I try to upload no???? I just see the red LED blink 3 times.
-opamp

User avatar
Franklin97355
 
Posts: 23910
Joined: Mon Apr 21, 2008 2:33 pm

Re: What is the best way to load sketch on breadboard Atmel3

Post by Franklin97355 »

Could you post clear pictures of your board and the connections to it?

User avatar
opamp
 
Posts: 13
Joined: Tue Oct 02, 2012 11:55 am

Re: What is the best way to load sketch on breadboard Atmel3

Post by opamp »

Will post some pics tonight. Looking for explicit instructions on changing the logic jumper on the FTDI board to 5v (comes default with 3.3v) but I see nothing on the Adafruit site. Even though it says 5v compliant in most cases, I don't trust it and no one has confirmed that 3.3v logic will work with the Uno rev. 3. That might be the problem. The subject could really use a good tutorial, including modifying the jumpers, confirmation of which boards you can upload sketches to etc.

User avatar
Franklin97355
 
Posts: 23910
Joined: Mon Apr 21, 2008 2:33 pm

Re: What is the best way to load sketch on breadboard Atmel3

Post by Franklin97355 »

Looking for explicit instructions on changing the logic jumper on the FTDI board to 5v (comes default with 3.3v)

Turn the FTDI Friend over and read instructions. Cut the little trace between the two pads on the 3.3 side and solder the two pads on the 5 side together. Done.

User avatar
opamp
 
Posts: 13
Joined: Tue Oct 02, 2012 11:55 am

Re: What is the best way to load sketch on breadboard Atmel3

Post by opamp »

FTDI Friend is now configured for 5V logic, tested again, same failed results. Posting some pics of my setup...
board1.jpg
board1.jpg (294.48 KiB) Viewed 265 times
board2.jpg
board2.jpg (353.12 KiB) Viewed 265 times
Attachments
board3.jpg
board3.jpg (634.41 KiB) Viewed 265 times

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: What is the best way to load sketch on breadboard Atmel3

Post by adafruit_support_mike »

Double-check your switch connection to make sure you haven't shorted the RESET pin to GND.

In most of the tact switches I know, the pins opposite each other (coming out of different sides) are shorted together, and the switch makes/breaks a connection between the pins that come out the same side.

If your switch works like that, you have a direct connection through the switch to GND.

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”