Skip to main content

External Clocks

Firmware Requirement

These functions require firmware version 1.32.52 or higher. You can check your firmware version with the Arduino example "Device Info" under the "Testing" category. If you have an earlier firmware revision, please contact qNimble to get upgrade instructions.

The following functions are available for configuring the clocking inside the Quarto

useExtClock

bool useExtClock(bool active, uint8_t trigger_pin);
bool useExtClock(bool active);

This function enables or disables using an external 10 MHz clock to generate all the clocks inside the Quarto. The external clock input must be on either trigger 1 or trigger 2 and must be at a frequency of 10 MHz (within a few kHz). If the clock input is not present or the frequency not correct, the Quarto will use its internal 10 MHz reference to generating all timing. The function returns readExtClockEnabled function. The function takes the following arguments:

  • active Set to true to activate external clock, set to false to disable.
  • trigger_pin Optional argument, default is to use trigger 1. Set to 1 to use trigger 1 and 2 to use trigger 2.

Example

useExtClock(true,2)  //Use External 10 MHz Clock from Trigger 2 to drive all Quarto clocks
useExtClock(true); //Use External 10 MHz Clock from Trigger 1 to drive all Quarto clocks
useExtClock(false); //Use Internal 10 MHz Clock 2 to drive all Quarto clocks

readExtClockEnabled

bool readExtClockEnabled(void);

This function returns true if the external clock is enabled and false if it is not active.

bool status = readExtClockEnabled();
if (status) {
Serial.print("External Clock Enabled\n");
} else {
Serial.print("External Clock Not Enabled\n");
}

readExtClockActive

bool readExtClockActive(void);

This function returns true if the external clock is enabled and active and false otherwise. The external clock will can be enabled but inactive if the input clock is not within a few kHz or 10 MHz, in which case the external clock will be inactive and the Quarto will use an internal 10 MHz reference.

Example

bool status = readExtClockActive();
if (status) {
S.print("External Clock Enabled and Active\n");
} else {
S.print("External Clock is not Active\n");
}

useExtADCClock

bool useExtADCClock(bool active, uint8_t trigger_pin);
bool useExtADCClock(bool active);

This function enables or disables using an external clock to drive the ADC acquisition. When disabled, the Quarto uses an internal 1 MHz clock for timing all ADC measurements. The function returns readExtClockEnabled function. The function takes the following arguments:

  • active Set to true to activate external clock, set to false to disable.
  • trigger_pin Optional argument, default is to use trigger 1. Set to 1 to use trigger 1 and 2 to use trigger 2.

Example

useExtADCClock(true); //Use External Clock from Trigger 1 to trigger ADC measuments.
useExtADCClock(true,2); //Use External Clock from Trigger 2 to trigger ADC measuments.
useExtADCClock(false,2); //Use Internal 1 MHz Clock to trigger ADC measuments.

readExtADCClockEnabled

bool readExtADCClockEnabled(void);

This function returns true if an external clock is used to drive the ADC measurements and false if the internal 1 MHz clock is used.

Example

bool status = readExtADCClockEnabled();
if (status) {
S.print("External Clock Drives ADC measurements\n");
} else {
S.print("Internal 1 MHz Clock Drives ADC measurements\n");
}