Arduino force 12Mhz crystal

is it possible to reduce the frequency of the external oscillator to 12Mhz without replacing the onboard crystal entirely?
I've read it is possible to reduce the frequency by adding a small capacitor in parallel with the crystal.

I need this to use an Arduino Mini with a V-USB project.

To try putting a small C across the built in resonator you may as well just replace the resonator.
Arduino AVR cores tend to only support 8 & 16MHz so if you alter the speed to 12MHz delay and other timing related things won't work as expected.
I'm sure the arduino port of V-USB supports 16MHz

I've done a lots of V-USB work on the 328P... the 16MHz crystal and the USBkeyboard.h library work just fine.
http://forum.arduino.cc/index.php?topic=135623.0
http://code.rancidbacon.com/ProjectLogArduinoUSB
http://code.rancidbacon.com/files/UsbKeyboard.h

Ray

PS: Trinket and Digispark are t85 implementations of VUSB. There are significant libraries available for play.

Oh, and if you really want to use a 12MHz and follow the old guidelines, you may find everything you need here:
http://eleccelerator.com/usnoobie/
I've breadboarded the above and just used a 12MHz and 22pF load caps... works great.

Basically i need to flash in V-USB project that was written (not by me) for 12Mhz.

The usnoobie looks a nice alternative, but i prefer a more compact and pre-assembled board like the Arduino Mini.

eadmaster:
is it possible to reduce the frequency of the external oscillator to 12Mhz without replacing the onboard crystal entirely?
I’ve read it is possible to reduce the frequency by adding a small capacitor in parallel with the crystal.

I need this to use an Arduino Mini with a V-USB project.

You can “pull” a crystal to a lower frequency using a small amount of capacitance, but the percentage from fundamental is rather small, typically being only a few kilohertz. From 16MHz to 12MHz will require a crystal/resonator replacement.

Ray

Ok, thank you for the tips!

Do you know any other pre-built board as small as the Arduino Mini but without the external oscillator ?

What about the Adafruit Pro Trinket here. It's 3.3V though so your hardware may need tweaking if you was expecting to use 5V.

Keep in mind the standard Arduino core doesn't work right at 12 MHz. Only 8 or 16

The Adafruit Pro Trinket has an internal logic of 3V which is not compatible with my project.

I don't mind if the Arduino core does not run at 12Mhz, i need to flash an V-USB project with a different bootloader...

eadmaster:
<…>
Do you know any other pre-built board as small as the Arduino Mini but without the external oscillator ?

If you have hot-air or are very good with a pencil soldering tool you may be able to just remove the 16MHz from a Pro Mini and replace it with a 12MHz crystal (or resonator) since you are going to re-flash the whole thing anyway.

But, you may also just want to look for 328P SMD bare-boards and assemble your own in a reflow over (mod toaster oven.) 328P SMD

Or, just do point-point wiring with a 328P-PU chip:
FLAT-duino

You can even buy the the QFP-32 and a breakout from Adafruit: QFP-32 Breakout

Crossroads may also have something: Crossroads

The other option for VUSB is to use the internal oscillator and tune it to 12.8MHz. You can set it up so the oscillator self tunes based on the USB.

I like the sound of that. Do you have links or examples on how to do this?

Riva:

[quote author=Tom Carpenter link=msg=1935603 date=1414282769]
The other option for VUSB is to use the internal oscillator and tune it to 12.8MHz. You can set it up so the oscillator self tunes based on the USB.

I like the sound of that. Do you have links or examples on how to do this?
[/quote]

This page gives specifics:
Clocking V-USB
And
This places discusses the voltage issues:
V-USB hardward

For most of us, however, Rancidbacon's USBkeyboard.h for the UNO is the safest approach,IMO. Just search the forum for rancidbacon's implementation.

Ray

Thanks Ray

@mrburnette: thank you for the breakout board links, just what i was looking for!
@Tom Carpenter: Unfortunately i cannot use the internal oscillator for this project.

btw, if i want to try replacing the 16MHz oscillator on a regular Arduino Mini, can i do the following instead of resoldering:

  1. cut the 2 board lines going to the oscillator with a small knife;
  2. expose the metal conductor near the cuts with the same knife by scratching the lines;
  3. bridge the new oscillator using this conductive glue
    ?

side questions:

  • can i use a bigger-sized oscillator like this?
  • do i need to replace the 22pf capacitors too?
  • once done can i test if the new oscillator is working correctly via software?

eadmaster:
@mrburnette: thank you for the breakout board links, just what i was looking for!
@Tom Carpenter: Unfortunately i cannot use the internal oscillator for this project.

btw, if i want to try replacing the 16MHz oscillator on a regular Arduino Mini, can i do the following instead of resoldering:

  1. cut the 2 board lines going to the oscillator with a small knife;
  2. expose the metal conductor near the cuts with the same knife by scratching the lines;
  3. bridge the new oscillator using this conductive glue
    ?

side questions:

  • can i use a bigger-sized oscillator like this?
  • do i need to replace the 22pf capacitors too?
  • once done can i test if the new oscillator is working correctly via software?

I took a look at the adhesive, if this statement is true,

The resistance is lower than 0.02 ohm /sq film thickness of 12 microns

Then IMO, it will likely work.
The oversized crystal will work but you must epoxy it to the board before applying the silver conductor adhesive as any little stress is likely to break the glue.

My personal preference would be to find someone with hot-air rework and have them remove the old resonator/crystal.

Generally, crystals will have external load capacitors that will not require removing (assuming a value of 15-22pF) but resonators haves internal caps... Replacing a resonator with a crystal will likely require the addition of proper load caps. You will need to closely inspect your particular board to determine the specific course of action.

Just as an opinion, I am not very fond if the silver adhesive ... Its use is generally to bridge a scratch/cut circuit run. Even with the xtal epoxied in place, temperature changes could break the bond.

Ray