I have a Question: Why does Adc_Read() need more than 40-80ms? It also has effect an other thread with higher priority, where i read I²C-Devices for digital in- and output and rises the latancy of that thread, which is a big Problem. If I deactivate Adc reading the I²C thread needs 4-6ms but when I activate it, I have times from 5-50ms. When I look to visual Studio Output it seems, that all Adc-functions load and unload two dll´s (libnvrm.dll, libnvos.dll). Could that be the problem?
Here is a sample Code (I uses all 4 Adc-Channels → complete reading needs up to 400ms):
HANDLE hADC1 = Adc_Init(L"ADC1"); bool cofig01 = Adc_SetConfigInt(hADC1, L"BitResolution", 12, StoreVolatile); bool cofig05 = Adc_SetConfigInt(hADC1, L"AvgSamples", 10, StoreVolatile); DWORD ReadValue1 = 0; int TimeBegin = getMilliCount(); DWORD RetVal = Adc_Read(hADC1, &ReadValue1, 4); int TimeSpan = getMilliCount(TimeBegin); // Here I messured 40-80ms