Hello juergenfalb,

Monday, April 21, 2008, 1:16:50 PM, you wrote:

j> Hello,

j> to clarify my setup:

j> I am using a saxotec A/D changer, which supports 16 Sensors.
j> This is connected via RS232 to ttyS2 or ttyS3 (using foxcom).
j> The A/D works the following way.
j> You send a number to it and it gets the values for the given
j> number of sensors, and sends it back. 
j> If you ask for 4 sensors you should be able to get a sampling 
j> rate of 1000Hz.
j> Using the A/D with a normal PC this is not a problem, but with the
j> FoxBoard it seems that the maximum frequency is 100Hz.

j> I activated the DMA fast timer and I also used without DMA.

DMA will introduce a delay, so better not use it for polling.

j> It seems it does not make a difference (using Kernel 2.4).
j> The fastest sampling rate I can get is 100Hz.

j> In the code I used "select" to wait for the next data on the RS232.

100 HZ is the rate at which the kernel will *force* a task switch
when other processes are ready to run. When you do usleep() or
select() it can do immediate task switches resulting in a much higher
rate. Bottom line some process is probably demanding all CPU. Think
of these 10ms as a timeout for a process to explicitely (via usleep)
give CPU ressources to other processes.

Anyway, if latency is not a problem for you I suggest you keep using
DMA and *asynchroneously* send the commands as fast as you can to
your ADC and just read the values that come in in chunks. With other
words: Send the next command before you got the result and send many
commands at once.

If this works depends on various things, but polling at 400 HZ rate
is not very effective..

Udo

Reply via email to