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: Capturing data on the USB Data Port

Part Number: OPT3101EVM

Our preferred use case for the OPT3101EVM would be to capture the data stream directly over the USB port.  Reading the documentation, it appears that's what the Latte-based GUI uses.  Is it possible to capture the data from the USB port without using the GUI?  In other words, is the data format of the data port published?

If that's not tractable, we can write our own app using the published API -- I believe "dev.liveDataView()" is the function I'll want.  But then how do we push the data out over the USB line?  Or is that a question specific for the MSB forum?

  • Robert,

    The SDK does spit out this data in a readable format. So you have two options.

    1. Use SDK through launchpad hooked to EVM, you will need to run through calibration or you can read out all device registers in latte and write in using SDK to maintain the calibration.

    2. You can use com ports (control and data). the data is sent over the data com port and data stream is started by writing “CAPS” on the control port. You have access to all the code – captureDataStructure.py file contains the code for parsing this data off the data port. The mMSP430Capture python file if you look for the start() method you should see this “CAPS” command.

    Let me know if you have any questions.

  • The USB approach sounds most promising.  Although I do see mMSP5503Capture.py in the OPT3101EVMrecE3_Demo directory, I don't see captureDataStructure.py.  Is that in a different directory or different version?

    Here's what I see in the Documents subdirectory:

    r@NUC-10 MINGW64 ~/Documents/Texas Instruments/Latte/projects
    $ find . -name "*.py"
    ./OPT3101/OPT3101EVMrevE3_Demo/01-variablesSetup.py
    ./OPT3101/OPT3101EVMrevE3_Demo/02-loadCalibrationFromFlash.py
    ./OPT3101/OPT3101EVMrevE3_Demo/03-Initialization.py
    ./OPT3101/OPT3101EVMrevE3_Demo/04-writeCoeffecients.py
    ./OPT3101/OPT3101EVMrevE3_Demo/05-launchGUI.py
    ./OPT3101/OPT3101EVMrevE3_Demo/correctPhaseOffset.py
    ./OPT3101/OPT3101EVMrevE3_Demo/devInit.py
    ./OPT3101/OPT3101EVMrevE3_Demo/Functions.py
    ./OPT3101/OPT3101EVMrevE3_Demo/mEVMSelector.py
    ./OPT3101/OPT3101EVMrevE3_Demo/mMSP5503Capture.py
    ./OPT3101/OPT3101EVMrevE3_Demo/mMSP5503Programmer.py
    ./OPT3101/OPT3101EVMrevE3_Demo/readAllRegisters.py
    

    ... and in Program Files:

    r@NUC-10 MINGW64 /c/Program Files/Texas Instruments
    $ find . -name "*.py"
    ./Latte/bin/editor/asterixEditor.py
    ./Latte/bin/editor/asterixShell.py
    ./Latte/bin/editor/baseTextCtrl.py
    ./Latte/bin/editor/codeeditor/base.py
    ./Latte/bin/editor/codeeditor/extensions/appearance.py
    ./Latte/bin/editor/codeeditor/extensions/autocompletion.py
    ./Latte/bin/editor/codeeditor/extensions/behaviour.py
    ./Latte/bin/editor/codeeditor/extensions/calltip.py
    ./Latte/bin/editor/codeeditor/extensions/__init__.py
    ./Latte/bin/editor/codeeditor/highlighter.py
    ./Latte/bin/editor/codeeditor/manager.py
    ./Latte/bin/editor/codeeditor/misc.py
    ./Latte/bin/editor/codeeditor/parsers/cython_parser.py
    ./Latte/bin/editor/codeeditor/parsers/c_parser.py
    ./Latte/bin/editor/codeeditor/parsers/python_parser.py
    ./Latte/bin/editor/codeeditor/parsers/tokens.py
    ./Latte/bin/editor/codeeditor/parsers/__init__.py
    ./Latte/bin/editor/codeeditor/style.py
    ./Latte/bin/editor/codeeditor/_test.py
    ./Latte/bin/editor/codeeditor/__init__.py
    ./Latte/bin/editor/codeparser.py
    ./Latte/bin/editor/editor.py
    ./Latte/bin/editor/iep.py
    ./Latte/bin/editor/iepLogging.py
    ./Latte/bin/editor/menu.py
    ./Latte/bin/editor/resources/tutorial.py
    ./Latte/bin/editor/shell.py
    ./Latte/bin/editor/ssdf.py
    ./Latte/bin/editor/__init__.py

  • I can simplify my question: can you tell me the format of the data stream?  I can use Latte to configure the OPT3101EVM, then quit out of it and open data com and data stream ports from my app -- works fine.  I can send "COMS" and "COME" to start and stop the stream.  For now, I don't need more than knowing the format of the data stream.

    Thanks!

  • Hi Robert,

    You can grep in the files for the unpack function. Relevant functions will be capture and unpack. In particular unpack shows how the data is parsed from the data port. Like Gordon mentioned you will have 2 COM ports. Send CAPS and CAPE on control port to start and stop data stream. Data will come on the other com port (data port). You will of course also need to configure the IC registers to get device to power up as well.

    See line #512 (line number may differ slightly if we have different versions of code) in launch GUI file: self.data.unpack(data,tIllum=self.tIllum,time=now)

    line # 503 launch GUI file: data = capDev.capture()

    Functions.py line #97:  def unpack(self,data,tIllum=0,time=0):

    and line #67 in mMSP5503Capture.py:  def capture(self,timeOut=10000):

    Let me know if this helps

    Best,

    Alex

  • That's helpful - thank you.

    On the data stream USB port, I'm seeing six byte packets.  And looking over the OPT3101Data.unpack() method, I believe the packets are formatted as follows.  Let me know if there's any obvious error:

    When self.captureRegMode==1:
    
            +--------+--------+--------+--------+--------+--------+--------+--------+
        bit |       7|       6|       5|       4|       3|       2|       1|       0|
            +--------+--------+--------+--------+--------+--------+--------+--------+
    data[0] |                              phase_lo                                 |
            +--------+--------+--------+--------+--------+--------+--------+--------+
    data[1] |                              phase_hi                                 |
            +--------+--------+--------+--------+--------+--------+--------+--------+
    data[2] |frameCt0| ambOvl |deAlFreq|framStat|   ledChannel    |illumDac|phaseOv1|
            +--------+--------+--------+--------+--------+--------+--------+--------+
    data[3] |                               ampli_lo                                |
            +--------+--------+--------+--------+--------+--------+--------+--------+
    data[4] |                               ampli_hi                                |
            +--------+--------+--------+--------+--------+--------+--------+--------+
    data[5] |            dealiasBin             |phaseOv2| sigOvl |frameCt2|frameCt1|
            +--------+--------+--------+--------+--------+--------+--------+--------+
    
    
  • Hi Robert,

    Apologies, have not had a chance to check this today. Will get back tomorrow.

    Best,

    Alex

  • Hi Robert,

    On quick glance I don't see any issue

    Best,

    Alex