SBOU274 December   2021 OPT3004

 

  1.   1
  2.   2
    1.     3
    2.     4
  3.   5
    1.     6
    2.     7
  4.   8
    1.     9
    2.     10
    3.     11
    4.     12
    5.     13
      1.      14
      2.      15
  5.   16
    1.     17
      1.      18
      2.      19
      3.      20
    2.     21
      1.      22
      2.      23
      3.      24
  6.   25
    1.     26

Feature Descriptions

Lux Plot

In the center of the GUI window you will see a plot showing the lux reading from the device on the y-axis and the sample number on the x-axis. The plot settings can be tweaked by right clicking on the plot. The x-axis and y-axis options under the right-click menu allow the range of x and y-axes displayed to be changed. There is also an auto option that will dynamically change the range to match the data. Scrolling will zoom in to or zoom out from the plot. Left-clicking and dragging will display a yellow rectangle that will, upon releasing the mouse, zoom the data to the rectangle drawn. Right-clicking and dragging up or down zooms the y-axis. Right-clicking and dragging right or left will zoom the x-axis. Right clicking and selecting "View All" will reset the view.

Drop down Selectors

At the top left of the plot are two drop down selectors.

The operation select dropdown allows device operating mode to be switched between power down and continuous capture modes. The oneshot mode of the device is not exposed by the EVM GUI.

The mode select drop down changes the device gain range setting mode. The device supports automatic gain control (ACG), which is the recommended mode setting for most use cases, or the gain range of the device can be selected manually using this dropdown.

The device supports two conversion times: 100ms and 800ms, which can be selected using the respective dropdown.

The display sample count selects how many samples are displayed on the x-axis of the plot.

Save to file

The set save to file name check box allows the data captured in the GUI to be dumped to a CSV file. Clicking this check box will display a windows file selector screen. Select the directory to store the CSV and set the name for the CSV. After clicking save the GUI will wait for you to click the start capture button to start saving data and susequently it will wait for a click on the stop capture button to copy all the data into the indicated CSV file. When capturing data with save enabled, the GUI will initially dump the data to temporary .npy files. After clicking stop capture this data is written over to the CSV file and .npy files removed.

Mean, Std, and the Blue Slider

There is a blue slider on the lux plot shown on the right side of the plot in the figure. Mean and Std columns in the table where capture data is displayed are calculated from only the data within the blue slider. Left-clicking on the middle of this slider and dragging moves the slider. Left-clicking on the edge of either side of the slider and dragging will adjust the size of the slider. This allows the mean and standard deviation of the distance, phase, and amplitude to be computed for any continuous portion of the displayed data. If capture is running this data updates in real-time along with the data in the Live column.

Scripts Window

When Latte is launched the GUI window appears front and center. However, there is a second window that is minimized at launch. This is the scripts window and exposes some more advanced features of the Latte platform that will be described below.

GUID-20211012-SS0I-LGG1-JW64-64KXVVRBHNFH-low.jpg Figure 4-14 Latte Scripts Window

The scripts window also provides access to the device registers view that displays the stored value of the device registers and allows them to be changed directly. Launch the registers view by double clicking on the "Registers View" button under the "Device List" box on the right side of the screen.

GUID-20211012-SS0I-BM6Q-PRMN-8RVZ375GHZV6-low.jpgFigure 4-15 Registers View

Overview of Device Registers

Register x00 is the result register and provides the output data from the device as an exponent and mantissa value indicated as e and r in the register view.

Register x01 is the configuration register and provides feedback about the state of the device; the bit names and full descriptions are shown in the OPT3004 data sheet. Each of the read-only status bits are greyed out and cannot be changed.

Registers x02 and x03 enforce low and high limits, respectively, on the output ranges (exponent) and values (mantissa) from the OPT3004. These registers are not included in the register view.

Additional Features of the Scripts Window

Hidden IDE Window

The Latte program runs a number of python scripts in the background to capture and display data from the EVM. These scripts allow for initialization of the device including loading calibration data from the EVM flash memory, launching a live view window with measurement plot and readings, and additional functionality such as reading from the flash and selecting a specific LED current for the device to use. For advance users or users looking for more flexibility when using the OPT3101EVM these python scripts are available in an integrated development environment (IDE) window that is minimized when TI-Latte is launched. The IDE window allows advanced users to customize the existing scripts or write new scripts.

After launching Latte, expand the OPT3004DTS directory on the left hand side of the window under Files by clicking the triangle to the left of the directory name. This displays the OPT3004DTSEVM folder. Further expanding the OPT3004DTSEVM folder will display all the example scripts as shown in the figure.

devInit.py

Open the devInit.py script by clicking on the corresponding file in the OPT3004DTSEVM folder on the left side of the screen. This displays the contents of the script on the center of the window. With devInit.py still selected in TI-Latte, click Run>Buffer from the top menu bar of TI-Latte (or press F5) to run the script. Once completed, the live view GUI is opened in a new window. More details on the live view GUI are given in the following section. Additional info is also displayed in the log window in the lower left- hand corner of the main window.

04-launchGUI.py

A liveview GUI window is launched when running the devInit.py script. This allows data from the OPT3004 to be viewed on a graph in real time. The GUI is created in the launchGUI.py example script. When running devInit.py, the launchGUI.py script is automatically run. However, if the GUI window is closed it can be re-launched by directly running the launchGUI.py script. To do this, select the launchGUI.py script and click Run>Buffer or press F5. Figure 4-13 shows the live GUI plot.