Help on programming new Atmega328 with 8Mhz external crystal

I built my own board using Atmega328 with 8Mhz external crystal. A fresh Atmega328 default fuse uses internal 8Mhz. Unfortunately, my board uses 8Mhz external crystal. After I soldered the Atmega328 onto the board, does it mean I can no longer upload new hex file because the fuse does not match the crystal? Does this mean in such a situation, I am forced to program the Atmega328 before mounting onto the board? May I ask the experts how would they solve this kind of problem?

lightaiyee:
I built my own board using Atmega328 with 8Mhz external crystal. A fresh Atmega328 default fuse uses internal 8Mhz. Unfortunately, my board uses 8Mhz external crystal. After I soldered the Atmega328 onto the board, does it mean I can no longer upload new hex file because the fuse does not match the crystal? Does this mean in such a situation, I am forced to program the Atmega328 before mounting onto the board? May I ask the experts how would they solve this kind of problem?

If the chip is set to use internal oscillator it will completely ignore the crystal.

fungus:
If the chip is set to use internal oscillator it will completely ignore the crystal.

But will the presence of the external crystal cause Atmega328 to stop working if the fuse is set to use internal oscillator?

lightaiyee:

fungus:
If the chip is set to use internal oscillator it will completely ignore the crystal.

But will the presence of the external crystal cause Atmega328 to stop working if the fuse is set to use internal oscillator?

No, it will completely ignore it.

another benefit is having two more io pins available.

lightaiyee, do you know this fuse calculator : AVR® Fuse Calculator – The Engbedded Blog
Do you want to use Arduino code ?

john1993, I succeeded with ATmega8 and internal oscillator today ( [SOLVED] Bootloader for ATmega8 with internal oscillator doesn't work. - Microcontrollers - Arduino Forum ). Is there a nice way to use those extra PB6 and PB7 in Arduino style ?
Or do I have to use them like this:

bitSet (DDRB, 6);
bitClear (DDRB, 7);
bitSet (PORTB, 6);
bitClear (PORTB, 7);

Using digitalWrite() seems impossible, values above 13 are for analog pins. I think those pins can not be used for a display with the LiquidCrystal library.

yeah... all the "official" arduinos use crystal so apparently theres no easy way to use them w/o modfying the libs/pinsdef. m8 is my favorite chip because you can buy several for the price of one m328. also you can change fuses from code which m328 cant do. and, after all, it was the ORIGINAL arduino chip (ng).

I made macros for those two pins: [SOLVED] Bootloader for ATmega8 with internal oscillator doesn't work. - #7 by system - Microcontrollers - Arduino Forum