Hi
Regarding use of TMF8801.
I am aiming for making a distance measurement between approximately 25 mm to 175 mm (changing distance). I have two question/problem.
- What is the max. ODR?
Ive seen it listed as 30 Hz / 33 ms. But isn’t that just the nomimel as described in DS p.16. Ranging Time Default Settings, nom. 33 ms. (default p.18).
One can set the CMD_DATA2 = repetition_period in mSec, and it seems to be able to go lower, is there a problem in doing so?
I have tried changing from library setting 100 ms to 25 ms, it seems to be working.
- Why does the measurement make a jump at 99 mm?
Tried with/without calibration. Calibration is done as in the library ex. 4. And (nearly) following the guidelines from DS, “calibration test shall be done in a housing with minimal ambient light and no target within 40 cm in field of view of the TMF8801”.
Without calibration, readings vary from being approximately 30-75 % to big (getting less and less to big, the more the distance), and it makes this jump at around an actual distance of 75 mm, TMF is reading from 99 and then jumps to ~131 mm, see image 1.
With calibration, readings are almost OK, and it jumps at around distance 99 mm, TMF is reading from 99 and then jumps to ~105 mm, see image 2.
With calibration, and CMD_DATA6 = 0x03 (default sparkfun 0x23) meaning “Bit 5= 1 When 1 combine the capture of the short and long distance histogram for maximum speed” NOW set to NOT combine, readings are still almost OK , readings now make a big jump again TMF reading from 99 and jump to ~131 mm, see image 3.
Ive noticed that the TMF8701, is an almost identically chip, with the possibility of shifting between two modes, Proximity and distance mode. Which maybe would make somehow sense explaining this. But this should not be the case with the TMF8801. (cant check for correct chip, since the IDs are the same, REGISTER_ID = CHIP_ID_NUMBER= 0x07).
This code I added in ex. 1 og 4 from the library/github, to change ODR.
delay(500); // OBS must be 500 (50 didnt work (after calibrate) else just stops)
// OBS this must be after calibrating, because setCalibration makes a resetDevice
tmf8801.setRegisterValue(REGISTER_CMD_DATA2, 0x21); // 0x28= 40 ms, 0x21= 33 ms, 0x19= 25 ms
tmf8801.setRegisterValue(REGISTER_CMD_DATA6, 0x03); // sparkfun default, 0x23= 0b 0010 0011
// Bit 5= 1 When 1 combine the capture of the short and long distance histogram for maximum speed (0x03) ikke combine
// Bit 7= 0 When 1 do not go to standby between measurements (faster measurement times but higher (0xA3) ikke standby
tmf8801.setRegisterValue(REGISTER_COMMAND, COMMAND_STOP); //
delay(500);
tmf8801.setRegisterValue(REGISTER_COMMAND, COMMAND_MEASURE);
delay(500);