RE: [PATCH] staging: comedi: das1800: fix analog input number of channels

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thursday, April 07, 2016 9:48 AM, Hartley Sweeten wrote:
> On Thursday, April 07, 2016 3:16 AM, Ian Abbott wrote:
>> On 06/04/16 19:06, H Hartley Sweeten wrote:
>>> The "hc" type boards have 64 analog input channels with a 64 entry queue.
>>> All the others have 16 channels and a 256 entry queue.
>>>
>>> Currently the boardinfo 'qram_len' is used to initialize the subdevice
>>> 'n_chan' and 'len_chanlist'. This works for the 64 channel boards but
>>> sets the 'n_chan' wrong for the 16 channel boards.
>>
>> I think the 256 QRAM positions is to allow use with a set of EXP-1800 
>> boards, each of which can multiplex one of the single-ended inputs of 
>> the DAS-1800 series into 16 channels.  According to the user's guide, 
>> they can be daisy chained to provide up to 256 channels.
>>
>> Datasheet:
>>
>> http://www.tek.com/sites/tek.com/files/media/media/resources/exp-1800_ds.pdf
>>
>> User's Guide download page (need to fill in contact info!):
>>
>> http://www.tek.com/manual/exp-1800-users-guide-92160b-manual
>>
>>
>> So it's probably best to leave the number of channels alone.

Finally able to get the user's guide to download.

> The EXP-1800 support looks like it will need additional changes to the driver
> in order to work correctly. According to the data sheet:
>
> 1) all board input channels must be configured as single-ended,
>    EXP-1800 inputs can be single-ended or differential. Not sure how
>    the board needs to be programmed to achieve this.
> 2) only gains of 1 and 50 are selectable on a per-channel basis
> 3) resolution is 12-bit, not clear how this works on a 16-bit board
> 4) max ai speed depends on the EXP-1800 gain not the board
>     gain 1 = 312kHz sample rate
>     gain 50 = 150kHz sample rate
> 5) gain must be the same on all channels and the boards gain must be 1 
>
> Additionally, it's not clear how the channel mapping works for each
> EXP-1800 connected to a board input channel.

The channel mapping is a bit warped as far as comedi is concerned.

Each EXP-1800 is jumper configured for what board input channel will
be used to return the 16 channels on the EXP-1800. The hi bits of the
QRAM are output to the EXP-1800 boards to select the channel as the
MUX4-7 pins on the connector.

Channel mapping looks like this:

On-board channel 0	EXP-1800 logical channels 0 to 15
On-board channel 1	EXP-1800 logical channels 16 to 31
...
On-board channel 15	EXP-1800 logical channels 240 to 255

So it looks like the QRAM 'channel' (i.e. the comedi channel) to physical
channel mapping goes:

channel 0	On-board channel 0 / EXP-1800 logical channel 0
channel 1	On-board channel 1 / EXP-1800 logical channel 16
channel 2	On-board channel 2 / EXP-1800 logical channel 32
channel 3	On-board channel 3 / EXP-1800 logical channel 48
channel 4	On-board channel 4 / EXP-1800 logical channel 64
channel 5	On-board channel 5 / EXP-1800 logical channel 80
channel 6	On-board channel 6 / EXP-1800 logical channel 96
channel 7	On-board channel 7 / EXP-1800 logical channel 112
channel 8	On-board channel 8 / EXP-1800 logical channel 128
channel 9	On-board channel 9 / EXP-1800 logical channel 144
channel 10	On-board channel 10 / EXP-1800 logical channel 160
channel 11	On-board channel 11 / EXP-1800 logical channel 176
channel 12	On-board channel 12 / EXP-1800 logical channel 192
channel 13	On-board channel 13 / EXP-1800 logical channel 208
channel 14	On-board channel 14 / EXP-1800 logical channel 224
channel 15	On-board channel 15 / EXP-1800 logical channel 240
channel 16	On-board channel 0 / EXP-1800 logical channel 1
channel 17	On-board channel 1 / EXP-1800 logical channel 17
...
channel 254	On-board channel 14 / EXP-1800 logical channel 239
channel 255	On-board channel 15 / EXP-1800 logical channel 255

So if no EXP-1800 boards are used the comedi channel matches the
on-board channel. But, if any EXP-1800 boards are used the comedi
channel to physical channel gets all screwy. Just using one EXP-1800
board connected to on-board channel 0 results in this comedi channel
map for the 32 'usable' channels:

channel 0	EXP-1800 logical channel 0
channel 1	On-board channel 1
channel 2	On-board channel 2
channel 3	On-board channel 3
channel 4	On-board channel 4
channel 5	On-board channel 5
channel 6	On-board channel 6
channel 7	On-board channel 7
channel 8	On-board channel 8
channel 9	On-board channel 9
channel 10	On-board channel 10
channel 11	On-board channel 11
channel 12	On-board channel 12
channel 13	On-board channel 13
channel 14	On-board channel 14
channel 15	On-board channel 15
channel 16	EXP-1800 logical channel 1
channel 32 	EXP-1800 logical channel 2
channel 48 	EXP-1800 logical channel 3
channel 64 	EXP-1800 logical channel 4
channel 80 	EXP-1800 logical channel 5
channel 96 	EXP-1800 logical channel 6
channel 112 	EXP-1800 logical channel 7
channel 128 	EXP-1800 logical channel 8
channel 144 	EXP-1800 logical channel 9
channel 160 	EXP-1800 logical channel 10
channel 176 	EXP-1800 logical channel 11
channel 192 	EXP-1800 logical channel 12
channel 208 	EXP-1800 logical channel 13
channel 224 	EXP-1800 logical channel 14
channel 240 	EXP-1800 logical channel 15

> I think it's better to set the number of channels to 16 and just support
> the on-board analog inputs for now. Once the EXP-1800 support is
> figured out it can be added.

There is also the issue with the gain when using an EXP-1800 board.
For now I think limiting the channels to 16 is the best option.

Also, the driver doesn't state that the EXP-1800 boards are supported.
I'm not sure the author (Frank Mori Hess) actually thought about or
tested it when he originally wrote the driver.

Regards,
Hartley

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux