M2i uses internal clock for sampling generation

This commit is contained in:
astromech 2017-03-09 22:30:10 +01:00
parent 1dcf82aa28
commit f0e9f43f2e
2 changed files with 12 additions and 8 deletions

View File

@ -165,9 +165,12 @@ SpectrumM2i40xxSeries::SpectrumM2i40xxSeries(const ttlout& t_line, int ext_refer
else else
throw SpectrumM2i40xxSeries_error("Could not open card"); throw SpectrumM2i40xxSeries_error("Could not open card");
// clock mode setup
spcm_dwSetParam_i32(default_settings.hDrv, SPC_CLOCKMODE, SPC_CM_EXTREFCLOCK); // external clock
spcm_dwSetParam_i32(default_settings.hDrv, SPC_REFERENCECLOCK, default_settings.ext_reference_clock); //spcm_dwSetParam_i32(default_settings.hDrv, SPC_CLOCKMODE, SPC_CM_EXTREFCLOCK);
//spcm_dwSetParam_i32(default_settings.hDrv, SPC_REFERENCECLOCK, default_settings.ext_reference_clock);
spcm_dwSetParam_i32(default_settings.hDrv, SPC_CLOCKMODE, SPC_CM_INTPLL);
spcm_dwSetParam_i32(default_settings.hDrv, SPC_CLOCKOUT, 1);
spcm_dwSetParam_i32(default_settings.hDrv, SPC_CLOCK50OHM, 1); // ToDo: test this spcm_dwSetParam_i32(default_settings.hDrv, SPC_CLOCK50OHM, 1); // ToDo: test this
fprintf(stderr, "\nADC card initialized\n"); fprintf(stderr, "\nADC card initialized\n");

View File

@ -18,8 +18,9 @@ add_custom_command(OUTPUT ${SPC_HEADERS}
# Kernelmodule is build from NDA source code. # Kernelmodule is build from NDA source code.
# just go to the current directory and tar xfz drvsrc_all_V*.tgz # just go to the current directory and tar xfz drvsrc_all_V*.tgz
# this will usually create a "linux" folder # this will usually create a "linux" folder
# the actual kernel source file is in the src_all/micx_drv subfolder # the actual kernel source file is in the src_all/micx_drv subfolder.
# If the "linux" folder exists the driver will be build # If the "linux" folder exists the driver will be build.
# Alternatively you can set the SPC_SOURCE environment variable to the micx_drv folder
if(DEFINED ENV{SPC_SOURCE}) if(DEFINED ENV{SPC_SOURCE})
message(STATUS "SPC_SOURCE environment variable set" $ENV{SPC_SOURCE}) message(STATUS "SPC_SOURCE environment variable set" $ENV{SPC_SOURCE})
@ -44,12 +45,12 @@ if(EXISTS ${SPC_SRC})
install(FILES ${DRIVER_FILE} DESTINATION /lib/modules/${CMAKE_SYSTEM_VERSION}/kernel/damaris) install(FILES ${DRIVER_FILE} DESTINATION /lib/modules/${CMAKE_SYSTEM_VERSION}/kernel/damaris)
else() else()
message("Spectrum MI40xx kernel driver not found " ${SPC_SRC} " unpack and configure it") message(WARNING "Spectrum MI40xx kernel driver not found " ${SPC_SRC} " unpack and configure it (i.e. set SPC_SOURCE variable")
endif() endif()
add_library(Spectrum_MI40xxSeries STATIC Spectrum-MI40xxSeries.cpp GatedData.cpp ${SPC_HEADERS}) add_library(Spectrum_MI40xxSeries STATIC Spectrum-MI40xxSeries.cpp GatedData.cpp ${SPC_HEADERS})
#add_executable(hw_test_ext hw_test_extclock.cpp GatedData.cpp) add_executable(hw_test_ext hw_test_extclock.cpp GatedData.cpp ${SPC_HEADERS})
#target_sources(hw_test_ext PRIVATE ${SPC_HEADERS}) #target_sources(hw_test_ext PRIVATE ${SPC_HEADERS})
#add_executable(hw_test_int hw_test_intclock.cpp GatedData.cpp) add_executable(hw_test_int hw_test_intclock.cpp GatedData.cpp ${SPC_HEADERS})
#target_include_directories(hw_test_int ${SPC_HEADERS}) #target_include_directories(hw_test_int ${SPC_HEADERS})