I've been working on this for a month or so and I cant seem to figure it out for the life of me.
I need to load a bootloader onto an ATMEGA328P-AU (The SMD TQFP version). It also needs to run at 3.3v, and 8Mhz. I think I have uploaded the bootloader onto one of my chips, but at the end of this process it says something along the lines of "one bytes of lock verified". After a few hours of research I determined I have no idea what this means. When I tried uploading a sketch to the chip, it gave me the "Programmer out of sync error" which from my experience can mean almost anything. (Im using SparkFun USB to Serial Breakout - FT232RL - BOB-12731 - SparkFun Electronics this board to program)
What I did to upload that bootloader was solder all the chip specific stuff (the atmega328p itself,8 Mhz cystal, the 2 22pf caps that go with it, the resistor to pull reset high, and the button to actually reset) I then used jumpers to go from the required pins to the matching pins on an arduino uno with the ArduinoISP sketch uploaded to it. I also had a 120 ohm resistor from reset to 5v on the uno. I then "burned bootloader" with "Arduino as ISP" as the programmer. If I remember correctly I did this in Arduino 1.6.4. (I've tried a few other versions since then)
If anyone has any information about what I'm doing wrong, or what you think I should try it would be MUCH appreciated. Specifically, what exactly are lock bits, and should I care about them? Why is it giving me a programmer out of sync error? Also if anyone knows how to upload the bootloader onto this specific chip and is willing to write and detailed set of instructions I will be EXTREMELY grateful!
I can also supply pictures of my setup, and /or screenshots of the verbose from the arduino software
Well I don't know the whole story of what you did so far, but things to think about:
Select from the menu Tools, Board, Arduino Pro or Pro Mini ATmega328 3.3V 8MHz before you do Burn Bootloader. That will make sure you are using a bootloader which is compatible with your board frequency and you get the right fuse settings. Your board sounds close in specs to Pro Mini ATmega328 3.3V 8MHz.
Make sure you have the auto reset with DTR through a 0.1uF capacitor to reset set up, or at least understand about manual reset at the beginning of upload.
What is auto reset with DTR? And I assume that manual reset at the beginning of upload is when you hit the reset button right before the program starts to upload?
Yes, the bootloader only runs right after a reset. Back when Arduino was invented you had to press reset at the beginning of the upload process, and you had to get the timing right or try again. More recently in Arduino history the otherwise unused DTR line of the serial connection has been used to send a pulse to reset the Arduino automatically when you try to upload. So if you are designing a board you may want to study how the factory-made Arduinos are designed. Google it to read, look at the schematics of boards such as Uno, and perhaps get a factory-made Arduino board and observe how it works and study it.
On Nick Gammon's website he talks a little about the auto reset (here he's calling it RTS)
Anyway back to the subject at hand, I don't know if you're getting a Programmer out of sync error because you are not using auto reset by sending the DTR signal from your FTDI adapter through a 0.1uF cap to the reset pin of the ATmega328P chip, or because you are not timing a manual reset button push just right during upload, or if you just have the wrong bootloader or no bootloader on the chip.
I'm very confused on where that .1 cap is supposed to be. From 3.3v to reset? I will try uploading to it after pressing the reset button. Also is it a safe assumption that I should be able to do this on arduino version 1.6.4?
Another question I had too, using the programmer, should my computer recognize it as an arduino? Because I've just been setting the com port to "COM6"
Let's take inventory on what you have, and figure out what you want to do, because I am not clear. I think I may have confused matters because I assumed some things and I should not have done that.
You have this ATMEGA328P-AU on a board. Can you upload a picture of the board please and a schematic of the board if you have one?
You have an UNO in working condition and you can upload sketches to it, is that right?
Do you have an USB-to-serial adapter such as an FTDI breakout or basic or something like that? If so, can you upload a picture of that?
Just a little update. I just reburned to bootloader to two of my boards. Using the "Arduino pro or pro mini(3.3 v 8Mhz)" Both said "done burning bootloader", both also said (a few lines up in the verbose) "avrdude: 1 bytes of lock verified" I still have no idea what this means, but I think it may be the problem. When I tried to upload something, it said "Done uploading" but the last line in the verbose was "avrdude: stk500_getsync(): not in sync: resp=0x30" do you think think this is still a problem with the bootloader? or possibly something else?
I'm using jumper wire soldered to headers to connect it.
I have the FTDI board from sparkfun.
I have a schematic, but at this point a lot has changed, so it is wrong. For example, it has a 16Mhz crystal on it, and its set up as the DIP package
Its not letting me post pictures
The message 1 bytes of lock verified just means it set the lock bit ok. If you are getting the done burning bootloader message it is burning the bootloader fine, but it appears you are having trouble using the bootloader to load sketches.
My recommendation at this point is to not try to use a bootloader or your FTDI board at all, and just load sketches using ISP programming. Since you can successfully burn a bootloader that means you can program the chip. Set up the wiring as if you are burning the bootloader, and instead of burning the bootloader open the sketch you want to upload to your ATMEGA328P-AU (such as the blink sketch if you have a resistor and LED connected to the appropriate pin) and click File, Upload Using Programmer (or Sketch, Upload Using Programmer on more recent versions of the Arduino IDE).
oh, I'm an idiot, I was clicking upload using programmer before when using FTDI. I tried uploading it normally and got "avrdude: stk500_getsync(): not in sync: resp=0x00", I also did try what you just suggested and that did work, however it's incredibly inconvenient for what I'm trying to accomplish. Do you know what the cause of that error is?
When you upload a sketch using ISP programming, you don't have a bootloader on the chip any more. So to resume troubleshooting FTDI programming you need to re-burn the bootloader. I'm afraid I have exhausted many of the ideas I have and you may just need to use ISP programming to upload to this particular board.
You can probably get a USBASP programmer to make it more convenient so you won't need to use an Arduino as ISP all the time.
There are a million things that can cause errors with FTDI uploading. When you are changing stuff around such as changing the crystal and SMD to DIP, you are kind of making a moving target so I get kind of lost trying to help. Whatever bootloader you burn, you need to make sure it was written for the configuration of chip and crystal you have, and that means you need to figure out how to make the correct board selection.
You may need to make a proper schematic of your board, study the schematics available online for commercially available boards such as Pro Mini, perhaps get a 3.3V 8MHz Pro Mini and a 5V 16MHz Pro Mini and get familiar with programming them with FTDI. It takes a lot of studying.
It may be a good idea to rewind a little and make an Arduino on a breadboard and get thoroughly familiar with that. Do the Gammon Breadboard I gave you the link to earlier:
Make sure your soldered board follows the same principles as on your Gammon Breadboard.
More stuff to read:
I do have a couple more tricks you can try. One of the sticky posts near the top of the Installation & Troubleshooting forum is Loop-Back Test Instructions. Do that test to make sure your FTDI adapter is working ok.
Do you have a reset button on your ATMEGA328P-AU board? When you attempt to upload to the board using FTDI, have you tried holding the reset button down and right when the IDE changes from saying Compiling to Uploading, release the reset button? (Don't forget to burn the bootloader on your board before going back to working more on FTDI troubleshooting.)
Yeah, I definitely have some more homework to do on the subject.
I tried the two things that you suggested. It passes the loop-back test, and the reset button didn't do it. I'm going to go ever EVERYTHING very carefully on Monday, and maybe I'll find something, but even if not, I think it works uploading with programmer, so I might just have to make that work.
Thank you very much for your time, help