Jump to content

As of July 17, 2015, the LabJack forums here at forums.labjack.com are shut down. New registrations, topics, and replies are disabled. All forums are in a read-only state for archive purposes.

Please visit our current forums at labjack.com/forums to view and make new posts. To post on the current forums, use your labjack.com login account. Your old LabJack forums login credentials have been retired. There are no longer separate logins for labjack.com and LabJack forums.


Photo

Maximum Divisor (Timer Mode 7), Frequency Output


  • Please log in to reply
4 replies to this topic

#1 Heiner

Heiner
  • Members
  • 11 posts

Posted 26 October 2006 - 06:20 AM

hi @all what is the maximum divisor e.g. used in: AddRequest(lngHandle, LJ_ioPUT_CONFIG, LJ_chTIMER_CLOCK_DIVISOR, ?????, 0, 0); Sorry for my bad english i am from germany:)

#2 Heiner

Heiner
  • Members
  • 11 posts

Posted 26 October 2006 - 10:47 AM

ähm is it posible that the maximum Clock_Base (Divisor) is 64 and die maximum Clock_Divisor is 256????

#3 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 26 October 2006 - 11:57 AM

If I understand your question correctly, you are asking for the maximum timer clock base and divisor. The maximum timer clock base is 48 MHz. It can also be set to 6 MHz or 750 KHz. Both the 48 MHz and 6 MHz clocks are the system clock, depending on whether the control power level is set as high-power (factory default) or low-power. To set a timer clock base of 48 MHz, you will need the following AddRequest: AddRequest (lngHandle, LJ_ioPUT_CONFIG, LJ_chTIMER_CLOCK_BASE, LJ_tcSYS, 0, 0); The maximum timer clock divisor is 256. The divisor range you can pass is 0-255, where 0 is a divisor of 256.

#4 Etteplan

Etteplan
  • Members
  • 1 posts

Posted 23 June 2015 - 06:55 AM

Hi, many combinations seems to be invalid. Can you please specify what combinations that works on the UE9?

 

I use the following setup and gets some combinations to work and some not.

 

For example tthe combination below should give about 45 Hz but the output is set to 5.7 Hz

 

 

 

            //Set the timer/counter pin offset to 0, which will put the first timer/counter on FIO0. 
            LJUD.AddRequest (handle, LJUD.IO.PUT_CONFIG, LJUD.CHANNEL.TIMER_COUNTER_PIN_OFFSET, 0, 0, 0);
 
            // use 12 MHz clock base with divisor = 12 to get 1000 kHz timer clock. For UE9 only SYS (48MHz), 6MHz and 750kHz works?
            LJUD.AddRequest(handle, LJUD.IO.PUT_CONFIG, LJUD.CHANNEL.TIMER_CLOCK_BASE, (double)LJUD.TIMERCLOCKS.MHZ6_DIV, 0, 0);
            LJUD.AddRequest(handle, LJUD.IO.PUT_CONFIG, LJUD.CHANNEL.TIMER_CLOCK_DIVISOR, 256, 0, 0);
 
            //LJUD.AddRequest(handle, LJUD.IO.PUT_CONFIG, LJUD.CHANNEL.TIMER_CLOCK_BASE, (double)LJUD.TIMERCLOCKS.KHZ750, 0, 0);
            //LJUD.AddRequest(handle, LJUD.IO.PUT_CONFIG, LJUD.CHANNEL.TIMER_CLOCK_DIVISOR, 75, 0, 0); 
 
            // Enable 1 timer.
            LJUD.AddRequest(handle, LJUD.IO.PUT_CONFIG, LJUD.CHANNEL.NUMBER_TIMERS_ENABLED, 1, 0, 0);
 
            // Configure Timer0 as Frequency out.
            LJUD.AddRequest(handle, LJUD.IO.PUT_TIMER_MODE, 0, (double)LJUD.TIMERMODE.FREQOUT, 0, 0); 
 
            // Set the second divisor to 50 output freq=(timer clock/(2*x)) => divisor = (timer clock/(2*output freq)), yielding a frequency of 10khz 
            LJUD.AddRequest(handle, LJUD.IO.PUT_TIMER_VALUE, 0, 0, 0, 0); 
 
            // Execute the requests. 
            LJUD.GoOne(handle);


#5 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 23 June 2015 - 01:35 PM

The two valid clock bases are  LJ_tc750KHZ (750 kHz) and LJ_tcSYS (system). The system clock is 48 MHz by default, and if the control power level is set to low (LJ_ioPUT_CONFIG, LJ_chCONTROL_POWER_LEVEL, value = 1) the system clock is lowered to 6 MHz. I would expect LJUD.TIMERCLOCKS.MHZ6_DIV (LJ_tc6MHZ_DIV) constant to cause an LJE_INVALID_PARAMETER error with the UE9.

 

Valid divisor values are 0-255, where 0 = 256. The same values apply for the frequency output value.

 

If you want a frequency output of about 45, set the timer clock base to 750 kHz with a 256 divisor (value = 0), then set your frequency output value to 32 (freq = (750000/256)/(2*32) = 45.7 Hz). The lowest frequency you can set is 5.7 Hz which you seem to be seeing.

 

To see the timer/counter constants that can be used with the UE9, refer to the time and counter pseudocode in the User's Guide.

 

Also, LJUD.CHANNEL.TIMER_COUNTER_PIN_OFFSET (LJ_chTIMER_COUNTER_PIN_OFFSET) does not apply to the UE9. Timer and counters always start on FIO0.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users