Offline
Newbie
Karma: 0
Posts: 34
|
 |
« Reply #15 on: October 12, 2012, 01:46:08 pm » |
Lefty,
Thanks. This clears up some details for me. As you explained, the second newer method is working fine for me. However, as to the first method, I bootloaded the optiboot.hex bootload to my Atmega328p-pu which I understand to be the bootload for a typical Uno. I also set the fuses according to the Uno. And I have the neccesary 16Mhz exteranl clock and all. By doing so, I would assume that selecting the "Arduino Uno" as my board type in the IDE would satisfy the necessary conditions to allow uploading of a sketch to work. This is what I have tried, but fails. Am I still missing something?
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Boston area, metrowest
Offline
Brattain Member
Karma: 249
Posts: 16540
Available for Design & Build services
|
 |
« Reply #16 on: October 12, 2012, 01:55:14 pm » |
Please confirm you have a 10K reset pullup resistor to +5, 100nF cap between FTDI's DTR pin and the reset pin, and preferably a small diode from reset pin (anode) to +5 (cathode).
|
|
|
|
|
Logged
|
|
|
|
|
Left Coast, CA (USA)
Offline
Brattain Member
Karma: 279
Posts: 15314
Measurement changes behavior
|
 |
« Reply #17 on: October 12, 2012, 02:22:00 pm » |
Lefty,
Thanks. This clears up some details for me. As you explained, the second newer method is working fine for me. However, as to the first method, I bootloaded the optiboot.hex bootload to my Atmega328p-pu which I understand to be the bootload for a typical Uno. I also set the fuses according to the Uno. And I have the neccesary 16Mhz exteranl clock and all. By doing so, I would assume that selecting the "Arduino Uno" as my board type in the IDE would satisfy the necessary conditions to allow uploading of a sketch to work. This is what I have tried, but fails. Am I still missing something?
Does your target circuit contain the needed auto-reset circuitry that the IDE first triggers to force the bootloader to run and listen for a valid upload request? If not you will have to try and use a well timed manual reset switch for the upload to work. When I try and use a manual reset I press and hold down the reset switch, then press upload on the IDE and when I see the compiled sketch size reported in the IDE output window I release the switch. Lefty
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 34
|
 |
« Reply #18 on: October 12, 2012, 04:31:18 pm » |
CrossRoads and Lefty, I think you both are coming to a similar conclusion which I will test. As previously noted, this shows pretty much exactly my layout http://itp.nyu.edu/physcomp/uploads/arduinobload_wires.jpg except for the screw up in the MOSI line. On the FT232R I am not using the RTS or DTR line at all going to the Atmega328 chip. However, the Reset on the Atmega328 is pulled to 5V with a 10k and a manual reset button as shown. Should the FT232R's RST line run to the Atmega328 reset, pin1? And should I go ahead and add the 100nF cap between DTR and RST on the FT232R? I think I get it that I have no reset running over to the Atmega328, as it IS running over from my breakout board to the Pocket Programmer, as shown in the image.
|
|
|
|
|
Logged
|
|
|
|
|
Left Coast, CA (USA)
Offline
Brattain Member
Karma: 279
Posts: 15314
Measurement changes behavior
|
 |
« Reply #19 on: October 12, 2012, 05:18:40 pm » |
CrossRoads and Lefty, I think you both are coming to a similar conclusion which I will test. As previously noted, this shows pretty much exactly my layout http://itp.nyu.edu/physcomp/uploads/arduinobload_wires.jpg except for the screw up in the MOSI line. On the FT232R I am not using the RTS or DTR line at all going to the Atmega328 chip. However, the Reset on the Atmega328 is pulled to 5V with a 10k and a manual reset button as shown. Should the FT232R's RST line run to the Atmega328 reset, pin1? No, do connect the FT232R's reset pin to anything, just leave it as a no connection.And should I go ahead and add the 100nF cap between DTR and RST on the FT232R? No. You need to go from DTR on the FT232R to a series wired cap, then cap to the reset pin of the 328.
LeftyI think I get it that I have no reset running over to the Atmega328, as it IS running over from my breakout board to the Pocket Programmer, as shown in the image.
|
|
|
|
« Last Edit: October 12, 2012, 05:28:45 pm by retrolefty »
|
Logged
|
|
|
|
|
Global Moderator
Boston area, metrowest
Offline
Brattain Member
Karma: 249
Posts: 16540
Available for Design & Build services
|
 |
« Reply #20 on: October 12, 2012, 05:35:16 pm » |
Yes, need the reset connections described for software reset during serial sketch download. Diode keeps weird things from happening with reset button push/release.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 34
|
 |
« Reply #21 on: October 12, 2012, 05:57:33 pm » |
OK, I hooked up a 100nF cap in series from the FT232R DTR to the 328 pin1 Reset. A 10k is still pulling up 328 pin1 to 5V. Still same error from IDE... avrdude: Version 5.11, compiled on Sep 2 2011 at 19:38:36 Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/ Copyright (c) 2007-2009 Joerg Wunsch
System wide configuration file is "C:\Program Files (x86)\arduino-1.0\hardware/tools/avr/etc/avrdude.conf"
Using Port : \\.\COM4 Using Programmer : arduino Overriding Baud Rate : 115200 avrdude: Send: 0 [30] [20] avrdude: Send: 0 [30] [20] avrdude: Send: 0 [30] [20] avrdude: Recv: . [00] avrdude: stk500_getsync(): not in sync: resp=0x00
avrdude done. Thank you.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 34
|
 |
« Reply #22 on: October 12, 2012, 06:03:29 pm » |
I also added a diode IN4148 from Reset to 5V. Leaving the 100nF cap in series from DTR to Reset and 10k pullup. Same result.
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Boston area, metrowest
Offline
Brattain Member
Karma: 249
Posts: 16540
Available for Design & Build services
|
 |
« Reply #23 on: October 12, 2012, 06:13:22 pm » |
Are Tx & Rx swapped by any chance?
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 34
|
 |
« Reply #24 on: October 12, 2012, 07:05:59 pm » |
No, not swapped. Again, I can successfully receive Serial data from the 328 through the FT232R on COM4 onto the Serial Monitor in Arduino IDE. So, they must be correct. Plus I double checked anyway.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 7
|
 |
« Reply #25 on: January 27, 2013, 01:06:22 pm » |
Hi, can some one explain maybe in short, what is actually going on, bootloading arduinos? 2 Usb connections! I finally got it working, but why so complicated? When I bought the avr pocket programmer I thought thats all I would need, connect it to the ISP connector of the chip e.g.ATmega328P, add a resonator and programm it. Instead of using an IDE I thought I`ll be using the Arduino Software. I got it working, but don`t have a clue how. Thanks for any explainations, John 
|
|
|
|
|
Logged
|
|
|
|
|
Left Coast, CA (USA)
Offline
Brattain Member
Karma: 279
Posts: 15314
Measurement changes behavior
|
 |
« Reply #26 on: January 27, 2013, 01:19:59 pm » |
Hi, can some one explain maybe in short, what is actually going on, bootloading arduinos? 2 Usb connections! I finally got it working, but why so complicated? When I bought the avr pocket programmer I thought thats all I would need, connect it to the ISP connector of the chip e.g.ATmega328P, add a resonator and programm it. Instead of using an IDE I thought I`ll be using the Arduino Software. I got it working, but don`t have a clue how. Thanks for any explainations, John  Well you have paid your dues that's for sure. But as you imply you really haven't mastered the art until you can do it twice in a row separated by six months.  Lefty
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Boston area, metrowest
Offline
Brattain Member
Karma: 249
Posts: 16540
Available for Design & Build services
|
 |
« Reply #27 on: January 27, 2013, 03:14:14 pm » |
can some one explain maybe in short, what is actually going on, bootloading arduinos?
The 2 USBs are for 2 interfaces into the memory area. When you install the bootloader via the ISP interface, the Flash area is being accessed pretty directly by the programmer. Same for File:Upload Using Programmer, when a sketch is loaded and the bootloader is wiped out; the Flash is accessed by the programmer. When you install sketch via the serial interface, the bootloader is running as a sketch and receiving the data and putting it into Flash. There is way more detail you can read about in the '328P datasheet, Section 27 and 28.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 7
|
 |
« Reply #28 on: January 28, 2013, 09:45:53 am » |
Thanks, `ll have to look up section 27-28, but I still don`t understand, why I`m not simply programming the bootloader. It`s only a little programm, executing instruction after instruction. I also wonder why this proramm is nowhere to be found, it`s got to be a .hex file. Ok, there are different ones for different controllers. As far as my understanding on µcontrollers goes, the `328 must receive and give commands over its serial interface through its usb from the Ardu sw, to and through the programmers usb to the programmer, which not only talks back and forth to the Ardu sw, but also flashes the `328`s memory with data from the bootloader.hex. So 2 usb`s communicating, and the `328 communicates with Ardu sw while being programmed, with data comming from Ardu sw. Maybe Ardu sw is telling the prorammer where the boot.hex is? I found out about how to install the bootloader from this source: http://itp.nyu.edu/physcomp/Tutorials/ArduinoBreadboard Is there any Arduino publication about it? I mean this is so far out, ... I`ve never even heard of anything like it, if someone would have told me, I would not have believed it. Very complicated. Thanks anyway John
|
|
|
|
|
Logged
|
|
|
|
|
|