[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference 49.910::kav30

Title:VAX on VMEbus: KAV30
Notice:Could have been as fast as 68K but its a VAX!
Moderator:CSSVMS::KAV30_SUPP
Created:Thu Apr 18 1991
Last Modified:Fri Aug 02 1996
Last Successful Update:Fri Jun 06 1997
Number of topics:159
Total number of notes:645

127.0. "Timer value used in kav$timers" by ZYDECO::REDDY () Fri May 27 1994 02:29

Hello,



In the KAV30 manual, it gives the following for timer count, if one wants the 
timer to expire every second:

	    timer_count = (65536 * (1000 - 1)) + 2500

    kav$timers (NULL, 			/* Return Status */
      timer_functions, 			/* Timer functions to perofrm */
      KAV$K_CTMR0, 			/* Timer number to use */
      &timer_count, 			/* value to load into timer register */
      NULL, 				/* AST address */
      NULL);				/* AST parameter */


One of cur customers used the following calculation so that the timer would
expire every 1/10 of a second:

                timer_count = (65536 * (100 - 1)) + 2500

When using this calculation they found their timing to be off about 3 seconds 
every 5 minutes.  They discovered that removing the "- 1" from the above 
algorithm corrected the timing problem.  They want to know if this is a 
documentation problem, or something they are doing?

Based on the documentation, if they remove "-1", aren't they waiting for a 
little more than a 1/10 of a second?

Any ideas on why they might be losing time using the timer isrs would be 
appreciated.

Thanks,

Sumithra
                                                                                
    
T.RTitleUserPersonal
Name
DateLines
127.1I guess Docu...EICMFG::KAV30_SUPPFri May 27 1994 12:334
    I would guess a documentation problem, but I check it anyways
    
    	Julian.
    
127.2ZYDECO::REDDYFri May 27 1994 16:233
    
    Thanks
    
127.3Docu is wrong.EICMFG::KAV30_SUPPTue May 31 1994 17:135
    The documentation is wrong. It should have been corrected in the ELN
    V4.4 docset, but it is obviously not....
    
    	Julian.
    
127.4ZYDECO::REDDYTue May 31 1994 19:0414
    
    Julian,
    
    When you say that the documentation is wrong, does it mean that if I
    wanted the timer to expire after one second, I would have the following
    for the timer_count?  
    
    	timer_count = (65536 * 1000) + 2500
    
    
    Thanks,
    
    Sumithra
    
127.5YES!EICMFG::KAV30_SUPPMon Jun 06 1994 16:1211
    Sumithra,
    
    the answer is yes - the formula we supplied to the technical writer is:
    
    	timer_count = (65536 * ((1000 - 1)+1) + 2500
    
    but somehow the +1 got lost (probably it was too difficult to
    understand....)
    
    Thomas (for Julian)
    
127.6ZYDECO::REDDYWed Jun 08 1994 22:219
    
    Thomas and Julian,
    
    Thanks.  I will let the customer know that te correct formula is
    timer_count = (65536 * ((1000 - 1)+1) + 2500.
    
    
    Sumithra