Re: NI6602

Hi Frank,

> It seems like a problem with the CounterSwap bit in the=20
> ClockConfigRegister.  The initialization of the register in the driver is=20
> a bit strange.  I would try moving all the enable_chip() calls to the end=20
> of  ni_660x_attach().

Although we can't figure out _why_ it works, it works :)  Thx!
The attached patch for ni_660x.c solves this issue.  However, putting the 
enable_chip() in ni_660x_attach() means that the option of using the 
second TIO for output on channels 0-4 is not possible anymore.  I can't 
think of possible uses of that option though (I never understood why the 
counterswap was necessary).

The patch also fixes a small bug in the configuration of the TIO to serve 
as an encoder:  There was a copy-paste error in the code for taking into 
account the index pulse or not.

Furthermore
- as stated in the updated Register level manual (the
   version of november 2002) and at
   <https://cvs.comedi.org/pipermail/comedi/2002-November/003800.html>,
   The 6602 and 6608 cards require a slightly different initialization of
   the mite chip on the card than other NI cards such as the
   E series MIO.

- During our search for the encoder problem, we also noticed that
   lspci reports an 8k memory region size for the DAQ chip on both the
   NI6601 and NI6602 boards.

0000:04:07.0 ff00: National Instruments: Unknown device 1310 (rev 01)
 	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV+ VGASnoop- ParErr- Stepping- SERR+ FastB2B-
         Status: Cap- 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort+ <TAbort- <MAbort- >SERR- <PERR-
         Latency: 64, Cache Line Size: 0x40 (256 bytes)
         Interrupt: pin A routed to IRQ 9
         Region 0: Memory at efdff000 (32-bit, non-prefetchable) [size=4K]
         Region 1: Memory at efdfc000 (32-bit, non-prefetchable) [size=8K]

   All other NI boards we have and the comedi mite source code
   (PCI_DAQ_SIZE) appear to use a 4k buffer.  We've also modified this in
   the mite code.

The attached patches of mite.c and mite.h code to reflect these two
changes in the mite-initialisation code.

klaas

Received on 2005-03-25Z14:44:22