It so happens that i have a bunch of Pro Minis from EBay.
I ordered the 5V/16MHz type as well as the 3.3V/8MHz type. Now being a typical E-Bay source, the modules arrived with no marking whatsoever and have been mixed up subsequently.
Now I want to know which board is which type ( these have some small crystal / resonator which has no marking on them.)
I happened to locate a simple code in this forum by Nick and that seems to return values around 8000 or 16000 .. is this the only way or there is another simpler method to find out ??
/*
* This code returns the Crystal Frequency muiltiplied by 1000.
* ( By Nick Gammon through Arduino Forum )
*/
#include <avr/sleep.h>
#include <avr/wdt.h>
volatile bool wdtFired;
// watchdog interrupt
ISR (WDT_vect)
{
wdt_disable(); // disable watchdog
wdtFired = true;
} // end of WDT_vect
void setup ()
{
noInterrupts (); // timed sequence follows
MCUSR = 0;
WDTCSR = bit (WDCE) | bit (WDE); // allow changes, disable reset, and set interrupt mode and an interval
WDTCSR = bit (WDIE); // set WDIE, and 16 ms seconds delay
wdt_reset(); // pat the dog
wdtFired = false;
interrupts ();
unsigned long startTime = micros ();
while (!wdtFired)
{ } // wait for watchdog
unsigned long endTime = micros ();
Serial.begin (9600);
Serial.println ();
Serial.print (F("Time taken = "));
Serial.println (endTime - startTime);
}
void loop () { }
Define "simpler"?
A simple "Blink" program will operate at "obviously the wrong speed" on boards which mis-match the board setting.
An oscilloscope or frequency counter probing the XOUT pin to the resonator should show it.
If the 8MHz minis are proper, VCC should measure 3.3V, and the 16MHz minis should have 5V, when powered from Vin with ~8V.
You could use a device programmer to read the bootloader and compare it against "known" copies.
You could write a sketch (like optiloader) that loads code (like what you quote) and shows the results without needing the serial console...
Just a simple serial print at a fixed baud rate in your sketch. Compile for e.g. 16MHz. Serial monitor set at fixed baud rate.
If you see correct.data in serial monitor, baud rates match and hence your Arduino is at the specified clock, if you don't see correct data, baud rates do not match and hence Arduino has 'wrong' clock.
Obviously observing the behaviour of a freshly loaded blink would even be easier.
Are the 8MHz versions using 3.3V and the 16MHz 5.0V ? If so and they have the blink sketch loaded as default then just measure the voltage of the LED as it flashes.
This whole thing became a bit winded as regulators on two boards got fried when fed with 9V at Raw input ... not sure what kind of regulators were used.