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: Implentation of Monoshot mode / trigger in GUI

Part Number: OPT3101EVM
Other Parts Discussed in Thread: OPT3101

Hi there,

We want to modify the supplied OPT3101EVM GUI python code so that the LED turns on only sufficiently long enough to perform a measurement, with the LED being turned off for long periods in between measurements.  From the manual it appears that the Monoshot mode does what we want it to do, but it is not clear how to modify the GUI code to implement this. Part of the problem is we are not sure whether the card has functionality for producing trigger signals for the Monoshot mode. 

Is there anyone that can help us solve this?

  • Hi Peter,

    Out OPT3101 expert will get back with you on this topic.

    Thanks

  • Peter,

      The python GUI is written to run in continous mode by default. The code to run in monoshot mode does not exist in the python GUI. The MSP430 is conneted using a GPIO pin on the MSP430 to the OPT3101 GP1 and GP2 pins. You can program GP1 to be the trigger in the OPT3101 and then write code to toggle the GPIO in the MSP430. The timing is critical for the trigger pulse or it will reset the device. The same pin is used for both so chech the data sheet for the timing. You can also write a trigger in software by setting a register bit. No hardware GPIO required.

    In devInit.py, lines 20-30 run the various device/GUI scripts at startup of Latte. 03-Initialization.py is where the register settings of the device are actually set. The default settings put it into continuous mode (it doesn’t write to the monoshot_mode field so it is in continuous by default). You can change these to set the device settings to monoshot mode and then read the result registers after setting monoshot_bit.

    The OPT3101 has to initialize in monoshot mode or it will not work. 

    Let me know if you have any questions. I will try to help, but I have not written code to do this, so I can only tell you what you need to do at this time. 

  • Peter,

    There are two ways we can set monoshot mode in OPT3101. Both require that J17 pin-7 must be pulled up to 3.3V.

    1. External
      1. J17 pin-7 (VSYNC_RST), give an active low pulse (pulse width range min = 0.1us and max = 1us)
      2. You can verify from dev.frame_count1 field in latte. It updates it value after every new reading (3 -> 2 -> 1 -> 0 cyclic)
    2. Using Register
      1. Connect J17 pin-7 (VSYNC_RST) to VDD (3.3V)
      2. Now set dev.monoshot_mode field to 3 in latte.
      3. Now every time setting dev.monoshot_bit field to 1 will trigger a new reading.
      4. You can verify from dev.frame_count1 field in latte. It updates it value after every new reading (3 -> 2 -> 1 -> 0 cyclic)

     

    Latte Code to set monoshot mode

     dev.monoshot_mode = 3

    dev.monoshot_bit = 1

    frameCount = dev._frame_count1.getValue()

    log(frameCount)