Here is an update on what we have tested so far:
When reading single inputs one right after another:
mcc128_a_in_read(address[0], CHAN0, 0, &value1);
mcc128_a_in_read(address[1], CHAN0, 0, &value2);
mcc128_a_in_read(address[2], CHAN0, 0, &value3);
This is the timing output:
Read Board 1 time: 171815ns
Read Board 2 time: 175556ns
Read Board 3 time: 175611ns
Loop time: 658814ns
Read Board 1 time: 175315ns
Read Board 2 time: 180148ns
Read Board 3 time: 176000ns
Loop time: 639500ns
Read Board 1 time: 167889ns
Read Board 2 time: 178296ns
Read Board 3 time: 178482ns
Loop time: 639463ns
So each single board read takes ~175us to read. For one board that is below our requirement of 250us. But taking 3 readings in a row that time is too long as well at the readings are not synced like in the continuous mode.
When testing in continuous mode:
result = mcc128_a_in_scan_read(address[0],&scan_status[0],-1,0,&value1_to_be_processed,1000, &samples_read[0]);
result = mcc128_a_in_scan_read(address[1],&scan_status[1],-1,0,&value2_to_be_processed,1000, &samples_read[1]);
result = mcc128_a_in_scan_read(address[2],&scan_status[2],-1,0,&value3_to_be_processed,1000, &samples_read[2]);
The loop time when there is no data (samples_read[n] == 0) is:
Loop time: 9648ns
Loop time: 9741ns
Loop time: 9796ns
The loop time when there is data varies wildly:
Loop time: 25314ns
Loop time: 6231056ns
Loop time: 175686ns
Loop time: 28037ns
These reads contain anywhere from 1 data point to 200 data points and anywhere in between with most of then being less then 3 (which is great);
I edited mcc128.c to take out the usleep(100) on line 2410 and added "info->read_threshold = 1;" on line 1762 to make this possible.
After these changes the boards work speedy and return a small number of data points. We can process the data in "realtime" (less then 5ms). Then after a small amount of time (500ms give or take) one of the boards has a hiccup of sorts and "builds up" 100 data points or more and then makes them available. The delay is then (100 samples * 250us/sample = 25ms) and the program cannot process the data in "realtime" anymore (less then 5ms).
Is there anything else I can do to make the board run "smoother" or use a single read to get simultaneous readings on all 3 boards (faster then 250us)?