Hi Gert,
> 1. we like to sample complete vibration time-waveforms, sampled at 64kHz
lets try some calculations for the sample rate. I use the following clock frequencies from my system:
- tBus = 1 / 66 MHz = 0.015 µs
- tADC = 1 / 33 MHz (66 MHz / 2) = 0.030 µs
- SFCAdder = 3 tADC + 1 tADC + 2 tBus = 0.150 µs
- AverageNum = 1
Single Conversion Time = SFCAdder + AverageNum x (BCT + LSTAdder) = 0.150 µs + 1 x (0.75 µs + 0.090 µs) = 0.99 µs
So the maximum sample rate for this conditions would be 1 / 1 µs = 1 MHz. Now lets try to find suitable parameters for 64 kHz. Lets decrease the ADC frequency:
- tADC = 1 / 4.125 MHz (66 MHz / 2 / 8) = 0.24 µs
- SFCAdder = 3 tADC + 1 tADC + 2 tBus = 1 µs
- BCT = 25 tADC = 6.06 µs
- LSTAdder = 3 tADC = 0.73 µs
- Single Conversion Time = 1 µs + 1 x (6.06 µs + 0.73 µs) = 7.79 µs = 128 kHz
After further adjusting the sample time (LstAdder) and the AverageNum, you should be able to get something around 64 kHz (but only approximately, not exactly).
> 2. preferably this is done on both ADC inputs simultaneously
One ADC cannot convert multiple channels simultaneously. Depending on the i.MX6UL(L) model you are using, you may have to ADCs. These ADCs are not coupled in hardware, but you should be able to start conversions on both ADCs with only some CPU cycles delay. For instance the SDMA is clocked with 66 MHz. Even if you would need 10 SDMA clock cycles to start the 2nd channel, this would be 0.15 µs (about 1% of the conversion time).
> 3. the length of the time-waveform would be max. 2 seconds = 128k samples
The count field in a SDMA buffer descriptor is limited to 16 bit (65535). But in a custom script this wouldn't matter. Only the size of the memory allocated by kmalloc must be big enough, that shouldn't be a problem.
> 4. I've been reading the nxp manual on this chip but didn't read about the sdma also able to work with the ADC.
In IMX6ULLRM.pdf, section 3.3 – "SDMA event mapping", you can see that both ADCs have event lines connected to the SDMA. I think the SDMA scripts provided by NXP are not usable for ADC, but you could write you own ones. In my current project, I use ADC1 together with the SDMA.
> 5. I also haven't found a ready driver which can pick-up complete time-waveforms at a high frequency
Similar answer as for question 4: The provided driver (vf610_adc) is not suitable for this. If you have some experience in writing Linux drivers, you could write you own driver which receives the 2x128k samples from the SDMA (after the conversion has been completed).
> 6. We would want to pick-up such a time waveform once / minute.
If you are able to process the data within this time, this shouldn't be an issue.
Conclusion:
I assume that your application can be implemented using both ADCs together with the SDMA. There is no pre-built solution for your task, so you would have to build you own. If I would do the task myself, I would calculate about 2 weeks full time for this (I have already some experience with Linux device drivers and also with SDMA). If you start from zero, I would calculate much more.
If you want to go this way, for SDMA development you have 3 options:
- Ask NXP for paid support.
- Use the assembler provided by Eli Billauer.
- Ask me for development tools! I have ported GNU binutils (as, ld, objcopy, ...) for SDMA. I'm willing to mainline this work soon, but I'm still looking for someone who wants to sponsor this work. Additionally I have ported Lauterbach's Trace32 debugger for SDMA. Without using this debugger, none of my scripts would work today!
regards
Christian