This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

OPT3101EVM: Developing OPT3101 SDK in C

Part Number: OPT3101EVM
Other Parts Discussed in Thread: OPT3101,

Hello all,

Here is a little bit information about what I've done so far, to understand where I'm stuck right now.

So I need to develop a sub-system which will give the distance from surface to main application. For that purpose, I selected OPT3101 and using EVM board for codebase development.

I've gone through the SDK provided in software section for OPT3101EVM. But we have "Only C" policy. As a result, I've been developing a basic SDK which can serve my purpose.

So far I've done,
1. Register bank abstraction in a header file as register_map.h
2. I2C abstraction to modify or read certain field from register abstraction as reg_modify(addr, lsb, msb, val) ;
3. Functions to initialize the system, select operation mode(monoshot or continuous), start measurement in case of monoshot, get distance.

I'm testing system in Auto HDR mode. While testing system gets initialised properly, but when I try to read the distance(Phase Out), I don't get proper distance even though I've been using same conversion formula given in datasheet.
If you want to check codebse it's here.

Now the question.
I've been reading something about calibration in forum and datasheets, but when I read through C++ SDK I don't get what are all the things that are needed to be calibrated. Can you help me out here?
Do you have any particular set of values or set of registers which are needed to be changed every time on reboot or periodically to make system more reliable and accurate?

  • Hi Tejas,

    We have a number of resources online (training videos, how to calibrate document, etc.) so first I wanted to check which you have seen and are using.

    For your questions

    In terms of what is needed for calibration you want to configure the device for regular operation before doing calibration. There is a configurator tool that will generate a configuration.cpp file. This you would have to translate to c. Then the SDK calibration routines do all needed config for each calibration. There is a low level calibration doc online http://www.ti.com/lit/pdf/sbau310 that also talks about needed registers and settings. Best might be just converting what is in SDK to your c code.

    How to calibrate doc: www.ti.com/.../slau791

    Training videos: https://training.ti.com/zero-hero-time-flight-training-series

    Also why are you only able to run with C code rather than C++? Is it a limitation on the MCU you are using? Because we have found C++ will run on most MCUs we have encountered so want to double check the reason with you.

    Best,

    Alex

  • Hey Alex,

    Thanks for your help.

    From going through those PDFs and datasheet I figured I could have used data that is stored in external EEPROM. But unfortunately there is no EEPROM on OPT3101EVM board.

    And to answer your question, we have been using open source license and the SDK provided by TI has a restrictions in the license. 

    If you guys can provide the SDK with BSD 3-clause  license for commercial use I can study OOP concepts and use TI's SDK itself.

    And that will be great help.

    Thanks,

    Tejas

  • Hi Tejas,

    I want to clarify that the EVM is calibrated already in production by us. Calibration values are stored in the MSP430 flash and loaded when initialized by latte GUI.

    If you are not modifying the EVM (swapping optics, etc) then no calibration is necessary.

    I am not sure about the license but can check into this. I may have follow up questions so may be posting later with them.

    Best,

    Alex

  • Hey Alex, 

    Can you please share those calibration values with me? We are using EVM board it self and I just want to test my SDK functionalities.

    So I can use TI's calibration values for now and then later on when we develop our own application board I can do calibration. 

    When I do that calibration later on I just want to be sure that my firmware is working fine as it should be..

    Thanks,

    Tejas 

  • Hi Alex,

    So I found a way to read register values from Latte software.

    I'm planning to use calibration values copied from Latte in C SDK that I'm developing.

    Is it okay to use those value or does it go against TI's policy? If it does please let me know. I'll close this question now.

    Thanks,

    Tejas

  • Hi Tejas,

    It is okay to use these values, but of course we cannot guarantee any performance so you will need to test to see if they are working well enough on your board or if you need to do a full calibration process.

    Best,

    Alex