Other Parts Discussed in Thread: ENERGIA
Hello,
I wanted to inquire about a proper register configuration and measurement procedure for both single channel measurement and continuous multi-channel measurements.
Single channel measurement
If I want to measure 4 channels at 100Hz with CHB disabled, then:
1). configure Measurement Configuration Registers(0x08, 0x09, 0x0A, 0x0B) to be {0b0001110000000000, 0b0011110000000000, 0b0101110000000000, 0b0111110000000000}, respectively;
2). configure FDC Configuration Register(0x0C) to measure first channel/measurement by setting {0b0000010010000000} (0x480 in hex);
3). wait till register0x0C:bit[3] is equal to 1 (about 10 ms at 100 Hz &3 ms at 400 Hz), indicating measurement is ready;
4). read out data;
5). trigger second channel measurement by setting (0x0C) register to {0b0000010001000000}(0x440 in hex);
6)...wait...read-out...& so on...
Is it correct?
For some reason, I'm accumulating another 2 ms between measurements-any suggestions how to get rid of it?
Continuous multi-channel measurement
To measure 4 channels at 100Hz with CHB disabled:
1). configure Measurement Configuration Registers(0x08, 0x09, 0x0A, 0x0B) to be {0b0001110000000000, 0b0011110000000000, 0b0101110000000000, 0b0111110000000000}, respectively;
2). configure FDC Configuration Register (0x0C) to measure channels/measurements in repeat mode by setting it to {0b0000010111111111} (0x5FF in hex)
(we tried to set last 4 DONE_x fields to 0 and got same result)
3). read out measurements?!!!
Question: how do I know that measurements are ready for read out? Are they measured and read-out sequentially or simultaneously?
When I check the DONE_x fields seem always to be set to 1 in repeat mode, indicating measurements are complete, but I would expect sometimes they should not be ready (which what I observe with FDC1004EVM GUI).
Moreover, when I check for appropriate DONE_x field is 1 (register 0x0C:bits[3:0] depending on channel), I can read out channels 2-3 ms in between (1->2->3) and with 38ms between rounds (channel 4->1).
But it looks like something wrong here, because individual measurements dont take 10ms as they should at 100 Hz. Eventually results look much noisier than with FDC1004EVM GUI.
What is the right way of doing it?
Is there a sample code that could walk us through configuration and measurements (except for the Energia code).
Thank you,
Alex