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.

DLPC350: Using C++ API to send Pattern Sequence

Part Number: DLPC350

I'm trying to use the C++ API to send USB commands to the DLPC350 to set up a pattern sequence. I'm referencing DLPC350 Programmers guide, but the documentation is unclear at times, and I'm having difficulty with certain portions.

I'm able to start and stop a pattern sequence, and change the mode. Defining a new pattern sequence is not working, and I suspect it's with how I'm sending the LUT data with the mailbox. Here are the commands I'm running. In this example, I'm trying to replicate the setup from this screenshot:

1. Display Mode Selection Command
# 1 = pattern display mode
0x1a 0x1b: 0x01

Pattern Display Start/Stop Pattern Sequence
(need to stop prior to sending data)
# 0x00 = stop
0x1a 0x24: 0x00

2. Pattern Display Data Input Source
# 0x00 = 24-bit rgb link
0x1a 0x22: 0x00

3. Pattern Display LUT Control
# byte0 = num LUT entries
# byte1 = 0 means pattern sequence executed once, 1 means repeated
# byte2 = num patterns in pattern sequence
# byte3 = if byte2 set to flash, num images used as patterns
0x1a 0x31: 0x01 0x01 0x02 0x00

4. Pattern Trigger Mode Selection
# 0 - trigger mode: VSYNC
0x1a 0x23: 0x00

5. Pattern Exposure Time and Frame Period
# byte 0-3 = pattern exposure time (us)
# byte 4-7 = frame period (us)
# 4500 = 0b0001000110010100 = 0x11 0x94
0x1a 0x29: 0x00 0x00 0x11 0x94 0x00 0x00 0x11 0x94

6. Set up the image indexes if using images from flash memory
# pass, since using 24-bit rgb link

7. Set up the LUT
7.1 Pattern Display LUT Access Control
# 2 = Open the mailbox for pattern definition
0x1a 0x33: 0x02

7.2 Pattern Display LUT Offset Pointer
# byte0: offset for LUT entries
NOT SURE WHAT TO DO HERE, so pass

7.3 Pattern Display LUT Data
(one entry per pattern in the sequence)
0x1a 0x34: 0b00 0b000000 0b0111 0b0111 0b0 0b0 0b0 0b0 0b0000
0x1a 0x34: 0b00 0b000001 0b0111 0b0111 0b0 0b0 0b0 0b0 0b0000
0x1a 0x34: 0b00 0b000002 0b0111 0b0111 0b0 0b0 0b0 0b0 0b0000

which translate to:
0x1a 0x34: 0x00 0x77 0x00
0x1a 0x34: 0x01 0x77 0x00
0x1a 0x34: 0x02 0x77 0x00

7.4 Pattern Display LUT Access Control
# 0 = Open the mailbox for pattern definition
0x1a 0x33: 0x00

8/9. Validate Data Command Response
0x1a 0x1a: 0x00
0x1a 0x1a: read one byte

10: Pattern Display Start/Stop Pattern Sequence
# 0x02 = start
0x1a 0x24: 0x02

Any help with this would be super appreciated. I've tried referencing the programmers guide extensively without success. The eventual goal is to build a python API for the DLPC350 to share with the community.

Alex

  • Hi Alex,

    I have some suggestions for you:

    * Use the most updated version of the firmware, since it looks like it’s an old firmware (v2.0)
    * Refer to the example at the end of programmer’s guide to see how to set up this code
    * Because you're using a video source, make sure to have a lock with the video stream before switching to pattern mode. This can be done by a simple command of 0x1a 0x1b: 0x00 in the beginning of the code.
    * The LUT pointer can be set to zero.
    * Make sure the total of the exposure time for the patterns fit within VSYNC.
    * Make sure the validation flag is valid.

    Hope that helps,
    Paul
  • Hi Paul,

    Thanks for getting back to me. I'll update the firmware and see if that resolves the issue.

    The above code was written while referencing the programmer's guide. I tried to follow the example at the end you reference as much as possible.

    In terms of VSYNC, I believe I have it set up properly. Using the GUI, I get the pattern to run successfully, it's just over USB I'm having problems. The validation flag I get at the end appears correct as well.

    I also wanted to confirm that I was sending the proper commands over the USB interface. Other than the LUT pointer, the rest looks correct?
  • Hi Paul,

    Updating to latest firmware resolved the issue. Thank you very much for getting back to me so quickly.

    Alex
  • Hi Paul,

    I appreciate you taking the time to help out.

    I'm still having some difficulty with the USB commands. I'm unable to set up a sequence with more than one pattern, and I'm not sure what is wrong with my commands. I'm also unable to change the pattern number, so it always picks pattern 0, however the bit depth and color command gets set properly. Here is the commands I'm sending. Any help with understanding what I'm getting wrong would be super helpful. Thanks in advance. I'm still trying to set up the same sequence as above.

    0x1a 0x1b: 0x00                                    # ensure lock
    0x1a 0x1b: 0x01                                    # pattern mode
    0x1a 0x24: 0x00                                    # stop pattern
    0x1a 0x22: 0x00                                    # 24-bit rgb link
    0x1a 0x31: 0x00 0x01 0x02 0x00      # 1 LUT entry, repeat, 3 patterns, not used
    0x1a 0x23: 0x00                                    # sync to VSYNC
    0x1a 0x29: 0x00 0x0 0x11 0x94 0x00 0x00 0x11 0x94   # 4500 us, 4500 us
    0x1a 0x33: 0x02                                    # open mailbox for pattern definiton
    0x1a 0x32: 0x00                                    # LUT offset pointer
    0x1a 0x34: 0x00 0x77 0x00                # internal trigger (not sure if matters since VSYNC), pattern 0, 7 bit, white, no invert, no black pattern, no swap, trigger high
    0x1a 0x34: 0x01 0x77 0x00                # internal trigger (not sure if matters since VSYNC), pattern 1, 7 bit, white, no invert, no black pattern, no swap, trigger high
    0x1a 0x34: 0x02 0x77 0x00                # internal trigger (not sure if matters since VSYNC), pattern 2, 7 bit, white, no invert, no black pattern, no swap, trigger high
    0x1a 0x33: 0x00                                    # close mailbox
    0x1a 0x1a: 0x00                                    # validate command
    validation: 0b00000000                       # validate result
    0x1a 0x24: 0x02                                    # start pattern

  • Hi Paul,

    I appreciate you taking the time to help out.

    I'm still having some difficulty with the USB commands. I'm unable to set up a sequence with more than one pattern, and I'm not sure what is wrong with my commands. I'm also unable to change the pattern number, so it always picks pattern 0, however the bit depth and color command gets set properly. Here is the commands I'm sending. Any help with understanding what I'm getting wrong would be super helpful. Thanks in advance. I'm still trying to set up the same sequence as above.

    0x1a 0x1b: 0x00                                    # ensure lock

    0x1a 0x1b: 0x01                                    # pattern mode

    0x1a 0x24: 0x00                                    # stop pattern

    0x1a 0x22: 0x00                                    # 24-bit rgb link

    0x1a 0x31: 0x00 0x01 0x02 0x00      # 1 LUT entry, repeat, 3 patterns, not used

    0x1a 0x23: 0x00                                    # sync to VSYNC

    0x1a 0x29: 0x00 0x0 0x11 0x94 0x00 0x00 0x11 0x94   # 4500 us, 4500 us

    0x1a 0x33: 0x02                                    # open mailbox for pattern definiton

    0x1a 0x32: 0x00                                    # LUT offset pointer

    0x1a 0x34: 0x00 0x77 0x00                # internal trigger (not sure if matters since VSYNC), pattern 0, 7 bit, white, no invert, no black pattern, no swap, trigger high

    0x1a 0x34: 0x01 0x77 0x00                # internal trigger (not sure if matters since VSYNC), pattern 1, 7 bit, white, no invert, no black pattern, no swap, trigger high

    0x1a 0x34: 0x02 0x77 0x00                # internal trigger (not sure if matters since VSYNC), pattern 2, 7 bit, white, no invert, no black pattern, no swap, trigger high

    0x1a 0x33: 0x00                                    # close mailbox

    0x1a 0x1a: 0x00                                    # validate command

    validation: 0b00000000                       # validate result

    0x1a 0x24: 0x02                                    # start pattern

  • Hi Alex,

    You'll definitely want to make sure that your 0x1A 0x34 command has external trigger set for each pattern. Can you try changing that and let me know the results?

    -Paul
  • Hi Paul,

    I finally got it to work. The key was incrementing the the maibox pointer between sending the pattern LUTs. Here is the sequence of commands that was what I was looking for:

    0x1a 0x24: 0x0
    0x1a 0x1b: 0x1
    0x1a 0x22: 0x0
    0x1a 0x31: 0x0 0x2 0x1 0x2
    0x1a 0x23: 0x0
    0x1a 0x29: 0x0 0x0 0x11 0x94 0x0 0x0 0x11 0x94
    0x1a 0x33: 0x2
    0x1a 0x32: 0x0
    0x1a 0x34: 0x0 0x77 0x1
    0x1a 0x32: 0x1
    0x1a 0x34: 0x0 0x77 0x7
    0x1a 0x32: 0x2
    0x1a 0x34: 0x0 0x77 0xb
    0x1a 0x33: 0x0
    0x1a 0x1a: 0x0
    0x1a 0x24: 0x2

    Thanks for all your help. My python API is close to being ready to share, which I will do here.

    Alex
  • Alex,

    Great news, glad you got it figured out!

    -Paul