0

BACKGROUND

I have made my own Arduino PCB based on the circuit of the Arduino Pro Mini (below) (including the external oscillator).
Picture of Arduino Pro Mini

I have already written the firmware and the code is stable. The code uses the millis() function which uses Timer 0. I also have changed the frequency of the PWM output on pins 3, 9, 10, 11, using the clock select bits (bits 2:0 in TCCR1B & TCCR2B). See http://playground.arduino.cc/Main/TimerPWMCheatsheet

I have an ISP 6-pin programming port on the board and this is my only method of uploading code.

I want minimize on components (and avoid EMC issues), so I have been considering removing the external 16MHz crystal and instead using the internal 8MHz oscillator.

QUESTIONS

  1. What do I need to change to use the internal oscillator?

I suspect that I need to change the board.txt file, the clock select bits and the fuses to accommodate for the new frequency.

  1. Can I leave the external crystal in place or do I have to remove it?

  2. If I do leave the external crystal in place and set the fuses to use the internal oscillator, will the crystal continue to resonate or does it get powered down somehow?
    (I wish to know this for EMC reasons)

2

1 Answer 1

2
  1. What do I need to change to use the internal oscillator?

You'll need to change the fuses on the chip, and you probably want a new 8MHz entry in boards.txt so that timing functions still work as expected.

  1. Can I leave the external [resonator] in place or do I have to remove it?

  2. If I do leave the external [resonator] in place and set the fuses to use the internal oscillator, will the [resonator] continue to resonate or does it get powered down somehow? (I wish to know this for EMC reasons)

From the datasheet:

If the Internal Calibrated RC Oscillator is used as chip clock source, PB7...6 is used as TOSC2...1 input for the Asynchronous Timer/Counter2 if the AS2 bit in ASSR is set.

Also:

When AS2 is set, pins TOSC1 and TOSC2 are disconnected from Port B. A crystal can then be connected between the TOSC1 and TOSC2 pins to serve as an independent clock source for Timer/Counter2. The Oscillator is optimized for use with a 32.768kHz crystal.

Therefore if AS2 is not set, the two pins act as normal GPIOs and the resonator is disabled.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.