Hi,
this is my first post here, so I apologize if I post in the wrong sectionr right away!
My problem is the following: I designed a curcuit where I use an atmega168.. for which I already layouted and "printed" my circuit board.. I also mounted all the parts except the atmega.
On the circuit I want to use a 16mhz quartz oscillator (+18pf capacitors). Before I mount the atmega I have to burn a bootloader and upload my programm, but my problem is I dont have capacitors wich I could use for a breadboard ( the only ones I have are smd).
So my question is: can I upload a bootloader without a quartz that uses one on my board?
Before I mount the atmega I have to burn a bootloader and upload my programm, but my problem is I dont have capacitors wich I could use for a breadboard ( the only ones I have are smd).
There are a number of ArduinoISP sketches which supply a clock so that the chip does not require a crystal. A good source of info on building your own Arduino compatible is here: Nick Gammon
Thank you I think that will help me alot!
Just on very basic question:
If I use another Arduino as an "clock source", as it says in the "chapter" "Alternate clock source" it is propably not necessary that it runs faster as the internal clock or?
So if I use the Arduino as a first clock source for uploading the bootloader I can also use the "8mhz" alternate clock source to programm it once and run it later with my 16mhz oscilator or?
It is able to burn bootloader to chip running only under its conditions which are in setting, it means if it uses already a crystal then it is needed. If you want to burn bootloader to raw chip or chip running on internal clock (which is default for raw) then it doesn't matter if with or without crystal connected, the MCU will not use it.
About frequency: If MCU is set for example for full swing crystal then crystal with any frequency in accepted range can be used for burning process. MCU can be burned with 8MHz and run with 16MHz e.g.
About clock source: If MCU is set for some clock source than this will be used during the next burning process also.
It cannot be changed full swing crystal for external clock e.g. The only exception is internal clock use then it doesn't matter what is connected on XTAL pins.
(I tried it now with the internal oscilator) .. So the problem is the signature is the right one for the Atmega 168A-PU (which is also bought -obvious) But he doesnt know that one
So if I try to upload the bootloader with the "Atmega_Board_Programmer" it says:
########################
Atmega chip programmer.
Written by Nick Gammon.
Version 1.21
Compiled on Nov 8 2014 at 15:05:02
Entered programming mode OK.
Signature = 0x1E 0x94 0x06
Unrecogized signature.
LFuse = 0xFF
HFuse = 0xDD
EFuse = 0xF8
Lock byte = 0xFF
Clock calibration = 0x89
Type 'C' when ready to continue with another chip ...
########################
Fingolin:
Before I mount the atmega I have to burn a bootloader and upload my program,
Well, there is the problem. You have the process backward!
You have made a blunder in the board design, you should be programming the chip after it is mounted on the board. What you need to do this is simply to provide an ICSP header on your board design. Note that you do not have to mount an ICSP pin header - all you require is the group of six plated-through holes (preferably, but not necessarily) in the standard 3 by 2 array to which you can connect with a "Pogo Pin" jig.
Now you refer to burning the bootloader also. If your board has a serial (USB) interface in the final design then you can program it after assembly and the bootloader has been loaded using ICSP. If on the other hand, you do not have such a serial interface, then the bootloader is useless to you and you simply need to burn (with ICSP) the program itself and not the bootloader at all.
Ok thanks so far!
So you're telling me if I upload the programm via ICSP I dont need an programmer at all?
But how do I upload it then in detail? My suggestion would be Put the "ArduinoISP" Programm on my UNO and then I select Arduino as ISP as programmer to upload the code? I tried that and selected the LilyPad with 168 as target. But it gives me the following error:
" avrdude: Yikes! Invalid device signature.
** Double check connections and try again, or use -F to override**
** this check.**
"
P.S.: I did NOT design my board with any kind of USB connection.. its just the "bare" Atmega168 A-PU)
Fingolin:
So you're telling me if I upload the program via ICSP I don't need an programmer at all?
You don't need the bootloader, because you are not going to load programs using USB/ serial.
Fingolin:
But how do I upload it then in detail? My suggestion would be Put the "ArduinoISP" Program on my UNO and then I select Arduino as ISP as programmer to upload the code? I tried that and selected the LilyPad with 168 as target.
That would be the way. It's just a matter of getting the right numbers. I cannot really advise you on that except to check out Nick's tutorials.
Fingolin:
I did NOT design my board with any kind of USB connection.. its just the "bare" Atmega168 A-PU)
But as I said - you should have provided an ICSP interface somewhere.