Build my own arduino

Dear Everyone,

I followed "Nick Gammon" guides for managing power for Arduino on your website.
but some of my problem was remained.
1-what is the frequency of bare bones atmega328?
2-how can I change its crystal to 3.6864MHz?
3-If I change the crystal, can I communicate with Arduino software or I must change boot-loader and fuse-bits?

If I want to explain more clearly, I want to make a battery powered logger with atmega168pa and external crystal 3.6864MHz. And I want to program it with Arduino software. So my problem is fuse-bits and value of crystal and communicating with Arduino Software.

Best Regards,

1-what is the frequency of bare bones atmega328?

It uses the 8 MHz internal RC oscillator and a pre-scale of 8 so it runs at 1 MHz.

2-how can I change its crystal to 3.6864MHz?

If you use a clock speed other than 8, 16, or 20 then the Arduino libraries won't work properly.

3-If I change the crystal, can I communicate with Arduino software or I must change boot-loader and fuse-bits?

If you change the system clock to a value other than 8, 16, or 20 MHz you will need to write a custom bootloader.

WHY do you think you want to run the system clock at 3.686 MHz?

Changing the fuse byte to use external crystal and editing the F_clock value to 3686400 in the board's entry in the boards.txt file is pretty simple to do. However changing the bootloader to work at that frequency is more difficult. You would probably find it simpler to utilize a hardware programmer (like another arduino board running the arduinoISP sketch) and using the IDE's upload sketch using programmer option.

Thanks for your reply retrolefty,
can you explain more about your first suggestion or give me some useful links?(mention about 3.6864Mhz crystal)
I'm trying to change the bootloader to work with 3.6864Mhz.
If I can solve the problem, I will post here for every one.
Now my problem is to compile ATmegaBOOT_168.c file in Arduino IDE folder. I could make hex file for atmega1280 but can't make it for atmega168 and 328.
When I run "Command Window" in this folder and I use "make" command , I will receive below ERROR:

C:\Users\ali\Desktop\BL>make atmega328_pro8
avr-gcc -g -Wall -O2 -mmcu=atmega328p -DF_CPU=3686400L '-DMAX_TIME_COUNT=F_CPU>>4' '-DNUM_LED_FLASHES=1' -DBAUD_RATE=57600 -DDOUBLE_SPEED -c -o AT
megaBOOT_168.o ATmegaBOOT_168.c
ATmegaBOOT_168.c: In function 'main':
ATmegaBOOT_168.c:586: error: 'EEWE' undeclared (first use in this function)
ATmegaBOOT_168.c:586: error: (Each undeclared identifier is reported only once
ATmegaBOOT_168.c:586: error: for each function it appears in.)
make: *** [ATmegaBOOT_168.o] Error 1

Hi John,
Thanks for your reply,
I want to make a low power logger, So I bought a NANO, an UNO and a Pro-Mini to test. In my test I can not reach less than 38 mA.
So I decided to make my own PCB with Atmega168PA. (I attached its Picture)
Now I don’t know How Can I communicate and program it with arduino IDE?(with internal clock 8mhz with pre-scale of 8)
My problem is how can I burn fusebits with Arduino IDE? And what is the instruction for applying Gammon methods for fusebits?
I use to work with CodevisionAVR and IAR, but now I decided to use arduino IDE for running simple projects.
Thanks,

mega168pa.jpg