From: phil@naic.edu (Phil Perillat Rm 407 X286)
Newsgroups: comp.os.vxworks
Subject: vmechip2  prescaler control reg
Date: 6 Nov 92 12:33:54 GMT
Organization: Lawrence Berkeley Laboratory, Berkeley CA
NNTP-Posting-Host: 128.3.112.16
Originator: daemon@vxw.ee.lbl.gov

Fred Roeber writes:
-----------------------------------------------------------------------------
Hello,  Back in august, there was some discussion on initializing the timer
control registers correctly on a MVME167 card.  Well, now I have to use a
167 card so I was going through the information that was discussed.  One thing
came up that seems very important but never seemed to get resolved.  Phil
Perillat of Arecibo Observatory wrote:
-------------------------------------------------------------------------------

	I guess i've been a bit negligent in following up on this on the 
network. I submitted the following tsr to wind rivers:

                 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

DESCRIPTION OF PROBLEM  : The vmechip2 prescaler control register is not
setup. This is address  0xfff404c in the m167 memory map (bits 0-7).
sysLib.c currently has:

  *VMECHIP2_TIMEOUTCR         = (TIMEOUTCR_VGTO_64US  |
                                   TIMEOUTCR_VATO_1MS   |
                                   TIMEOUTCR_LBTO_64US  |
                                   TIMEOUTCR_WDTO_16MS) ;

but it should have:

  *VMECHIP2_TIMEOUTCR         = (TIMEOUTCR_VGTO_64US  |
                                   TIMEOUTCR_VATO_1MS   |
                                   TIMEOUTCR_LBTO_64US  |
                                   TIMEOUTCR_WDTO_16MS) |
                                   ((256 - BCLK) & 0xff);

To paraphase the m167 programmers ref guide pg 2.62:

"if the prescaler is not correctly programmed, the bus timers do not generate
their specified values and the VMEbus reset time may be violated..."

In other words, your board won't work properly as a vmebus system controller
(bgrant timeouts etc...) if you don't set it up.

                         xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

And i got the following response:

                         xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
SPR #1578 has been submitted.

      Synopsis: mvm167 vmechip2 prescaler adjust for timer not setup.
         Group: BSP and Drivers
        Leader: theo
        Status: assigned
      Priority: 1-fix in next rel

  Submitted by: davidj
Submitted date: Aug 18 1992
      
                       xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx   

So wind river is onto the problem. In the meantime you should include the

(256 -BCLK)  

in the setup of VMECHIP2_TIMEOUTCR.



By the way (or maybe covering my ass), if anyone decided to use the 147/167 
timer routines i put out on the net: 
(From phil Thu Oct  8 13:25:08 1992
 To: vxwexplo@lbl.gov
 Subject: Timer routines for mv147/mv167 boards.....
)
They have a race condition that can occur if you call the timerValue when
the timer interrupt is occuring (i found this out the hard way!).  I've 
fixed them up by copying some code from the posting of:

     Eric L. Schott,    HRB Systems, Inc.

and they seem to work ok now. If people are interested i can post the new 
version.



phil perillat
arecibo observatory
phil@naic.edu
Newsgroups: comp.os.vxworks