background image

ClockMaster

8/8/2002

11

www.spincore.com

// This sample application uses the PM02PC01 DLL to control the
// ClockMaster-100 board through the cm_set_freq DLL function call.
//
// SpinCore Technologies, Inc.
// August 2002
// http://www.spincore.com
//
// Notes: Remember to include PM02PC01.lib in your Project settings when
//

using the PM02PC01 DLL

//

#include <stdio.h>
#include <math.h>

#define KILO

1000

#define MEGA

1000000

#define FREQ_BITS

32

#define CLOCK_RATE

100*MEGA

// Imported Function from PM02PC01
extern "C" __declspec(dllimport) int cm_set_freq(double Freq_to_Output,
double Clock_Rate);

int main(int argc, char* argv[])
{

double

Freq, TempFreq;

Freq = 125.500;

// Freq to output in kHz

// The Output to ClockMaster
int cm_ret = cm_set_freq(Freq, CLOCK_RATE);

// Check Function Return for Success
if (cm_ret == -1) return -1;

// For Display Purposes Only, Convert to Hex and Back to get the Rounded

True Value Output

TempFreq = Freq * pow(2, FREQ_BITS - 1) * KILO / (CLOCK_RATE / 2);
TempFreq = (unsigned int) TempFreq;
TempFreq = (float) TempFreq / pow(2, FREQ_BITS - 1) * (CLOCK_RATE / 2) /

KILO;

printf("Now Outputting --\nFrequency: %.4f kHz\n", TempFreq);
return 0;

}

Appendix I: Example C Program

Summary of Contents for ClockMaster CM2-100-PCI

Page 1: ...Owner s Manual for the ClockMaster Models CM2 100 PCI SpinCore Technologies Inc 3525 NW 67th Avenue Gainesville Florida 32653 USA Phone 352 271 7383 http www spincore com ...

Page 2: ...ore Technologies Inc reserves the right to make changes to the product s or information herein without notice PulseBlasterDDS PulseBlaster PulseBlasterPlus ClockMaster SpinCore and the SpinCore Technologies Inc logo are trademarks of SpinCore Technologies Inc All other trademarks are the property of their respective owners SpinCore Technologies Inc makes every effort to verify the correct operatio...

Page 3: ...Section II Installation 1 Quick Installation Guide Section III Physical Description 1 Connector Information Section IV Programming Information 1 Using the PM02PC01 DLL 2 Ordered Byte Output Description Section V Troubleshooting Appendix I Sample C program ExampleApp cpp Appendix II Available Options 3 4 5 6 7 7 9 11 12 ...

Page 4: ...ge range of the digital signal is 0V to 2 5V It is controlled by a simple PCI interface The system runs off of a 100 MHz reference clock and has 31 bits of frequency data which provides for a frequency resolution of 47 mHz Its valid frequency operating range is from 0 Hz to 70 MHz When the frequency selected is zero Hz the output of the system will remain at ground Section I Introduction ...

Page 5: ...erter The DAC s output is then filtered amplified and routed to the SMA output connector For the purpose of generating low jitter digital output signals the ClockMaster is also equipped with a fast Schmidt trigger that extracts the sign bit information of the generated analog waveforms The sign bit is the digital output signal of the system By generating analog waveforms low pass filtering them an...

Page 6: ...k Browse 9 Browse to the newly created folder containing the drivers 10 Click Open and then Next 11 The next dialog box should say that an appropriate driver was found ClockMaster PM02PC01 100 12 Click Next and Finish until installation is complete 13 Open an MS DOS window in the directory of the unzipped files 14 Run install bat The following messages should appear Creating driver entry OK Starti...

Page 7: ...of its pins are described below Pin 1 This pin contains the output signal The output signal is a square wave with a low voltage of 0V and a high voltage of 2 5V The frequency of the signal is set through the PCI interface Pin 2 Ground On the cable provided by SpinCore Technologies Inc one of the two lines has stranded silver cable exposed This is the ground pin and should be connected to pin 2 of ...

Page 8: ...r must take place in the following manner The top four bits of each output word must start at 0xF and toggle between 0xF and 0x0 for each byte output The lower four bits of each output word are the bits of the desired output word starting with the most significant 4 bits Example Output The following is an example of the output sequence to program the ClockMaster Explanations are included in bracke...

Page 9: ...put of the program would be Output 0xF6 to port base 0x0C Output 0x04 to port base 0x0C Output 0xF9 to port base 0x0C Output 0x00 to port base 0x0C Output 0xF8 to port base 0x0C Output 0x01 to port base 0x0C Output 0xFC to port base 0x0C Output 0x03 to port base 0x0C ...

Page 10: ... PM02PC01 device look for PCI Card with an exclamation mark on it Select Properties for the PCI Card and reinstall the driver using SpinCore s drivers Reboot your computer 3 Double click on this device to make sure it is working properly If it is not working properly you should see one of the following messages Error message 1 Device is not present or is not working properly Check to make sure tha...

Page 11: ...ng cmster exe or your own developed application Solution 1 See Solution to II IV Failed opening WinDriver device message received upon running cmster exe or your own developed application Solution 1 Check to make sure that the card is properly inserted into the PCI slot and reboot your computer 2 Re run Install bat If the problem persists please be sure you are running the latest ClockMaster drive...

Page 12: ...ported Function from PM02PC01 extern C __declspec dllimport int cm_set_freq double Freq_to_Output double Clock_Rate int main int argc char argv double Freq TempFreq Freq 125 500 Freq to output in kHz The Output to ClockMaster int cm_ret cm_set_freq Freq CLOCK_RATE Check Function Return for Success if cm_ret 1 return 1 For Display Purposes Only Convert to Hex and Back to get the Rounded True Value ...

Page 13: ...osure with internal power supply 3 Input for external hardware gating control 4 Frequency modulation frequency hopping 5 Internal timing engine for pre programmed execution of arbitrary sequences of output pulses of arbitrary duration with complex program flow control statements including nested loops subroutines etc For more information and or to request a quotation please contact sales spincore ...

Reviews: