I’m looking to make a circuit board for programming standalone 328 processors .
I’d like to switch between 8 and 16 MHz crystals - is a simple switch in the connections to two crystals likely to work ?
I think it is. I had those crystals working even when just plugged in a breadboard. If one leg of them is disconnected I can't think of a reason how it would be able to resonate.
For programming, the target shouldn’t need a crystal. ![]()
it's advised to keep the distance between the cristal and the chip as short as possible and capacitance of that connection (and capacitors) will impact the precision of the cristal.
may be using jumpers to select which cristal is connected will be better than a mechanical switch
I never tried
You can design an USBASP.
USBASP supports all AVR chips including the ATmega328. I am posting only one design. You can find more. Some designs include a Zif socket. Those are more user-friendly.
Serial programming (through an ICSP header, for example) requires a working system clock so if the chip fuses are set for a crystal oscillator, the crystal (or resonator, or external clock) must be present.
If you just want to program chips and then move them to a board with a crystal, the crystal attached to the target chip doesn't have to match the crystal in the board.
I would apply an external clock instead of a crystal.
Hadn’t thought of that , I’ll look into it
I was thinking of this connection:
The UNO at the top is burning the bootloader to the chip at the bottom.
From the factory, the chip is set to use the internal 8 MHz RC oscillator, not a crystal. If you upload, for example, the Arduino UNO bootloader, the chip will be configured to use a crystal. If you then try to re-burn the bootloader, the attempt will fail. This may not be true of the recent "ATmega326P-compatible" chips but it is true of the Atmel/Microchip chips.
You should be able to program a 328 for either 8MHz or 16MHz operation with an 8MHz crystal in the programmer; there is no need for the frequency used during programming to match the frequency that will be used in the final circuit. (for instance, as Johnwasser points out, the initial programming of any 328 is done using a 1MHz internal clock.)
I can program to use 8 or 16Mhz .
After boot loading I wish to upload via serial and test on either 16 or 8Mhz as I wish .
So for convenience I want to be able to switch the frequency to match its intended final use .
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
