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.

DLPLIGHTCRAFTER: I2C control

Part Number: DLPLIGHTCRAFTER

Hello.

I'm trying to configure my LightCrafter 4500 using the I2C port.  I can start and stop pattern display and switch between video mode and pattern display mode using the I2C interface so I think everything is OK with the basic interface.  The problem comes when trying to configure the LUT.  I've based my I2C command sequence on Table 4.1 in the manual (Pattern Display Mode Example).  Here's the I2C command sequence I'm sending:

0x69 | (1<<8)  0x01   //set pattern mode

0x6f | (1<<8)   0x00  //set external video source

0x75 | (1<<8) 0x00 0x01 0x01 0x00)    // 1 LUT entry, repeated sequence

0x70 | (1<<8) 0x00     //set VSYNC trigger

0x77 | (1<<8) 0x02)   //open mailbox  (NB - manual says 0x01, but I think it's wrong - we're sending pattern definitions here, not image indices)

0x76 | (1<<8) 0x00) //set offset

0x78 | (1<<8) 0x00 0x78 0x00  //set LUT

0x77 | (1<<8) 0x00   //close mailbox

0x7d | (1<<8) 0x00;  //validate (and read result)

0x65 | (1<<8) 0x02)   //start the pattern display

I've stepped through the sequence line by line.  Everything is fine until 0x78 | (1<<8), 0x00 0x78 0x00  //set LUT.  As soon as that command is executed a red light appears on the EVM next to the USB port.  Is there something wrong with my I2C sequence?  All I want to do is configure the EVM to display real-time HDMI but in pattern sequence mode so that it's pixel correct.

Thanks.

  • Hello Russell,

    Were you able to try it with 0x77 0x01 instead of 0x02? You also may be interested in downloading the source code for the GUI software to help you determine the correct I2C commands to send.

    Thanks,
    Kyle
  • Thanks, Kyle.  Yes, I tried 0x77 0x01 as well.  Same problem.  Will the GUI source code contain I2C commands?  It communicates by USB and the codes are not the same.

  • Hello Russell,

    If you figured out the correct USB commands it will be relatively easy to find the corresponding I2C commands. However, if I find anything wrong after some investigation on my end I will let you know.

    Thanks,
    Kyle
  • Hello Russel,

    Were you able to get this working on your end by using the GUI source code as reference? If not let me know where you are and I'll see what we can do.

    Thanks,
    Kyle
  • HI, Kyle. No, still not working. The process of setting up pattern display mode is quite complicated from the GUI. I haven't been able to disentangle all the different parts. It would be great if you could check my I2C code. There are lots of people on the Internet asking for worked examples of I2C code for the LightCrafter - there are very few available. Thanks.
  • Hello Russel,

    Have you looked at table 4-2 "Using Trigger Mode 0" I think this might help. Did you inc operate 0x66 command Pattern Exposure and Frame Period?

    Also can you explain what you are doing with the 0x78 command? I believe this must be repeated for each pattern.

    Hope this helps a bit!

    Best,

    ~Danny W

  • Hi, Danny. I was using Table 4.1 instead of table 4.2 because I'm not interested in any output triggering. I just want free running VSYNC input triggering so I can display the real-time HDMI feed but in pattern display mode so that it's pixel accurate. The I2C code I originally posted follows exactly the flow of Table 4.1. I'm not setting the exposure time and frame rate because there's ambiguity in the documentation and the forums about the byte order (again, this is why we need a worked example of the actual I2C bytes to eliminate these confusions) and the default values work OK.

    The 0x78 line is where it appears to crash so I'd be very pleased to hear your comments on that line. The documentation on command 0x78 says 'If the mailbox was opened to define the individual patterns, write three bytes of data per pattern to the mailbox.'. So in my code, those 3 bytes are 0x00, 0x78,0x00 which should mean internal trigger on pattern number 0, white LED with 8-bit depth, do not invert, do not insert any post pattern, do not perform a buffer swap.

    Do you think I'm not doing that right?

    Thanks,
    Russell
  • Hello Russell,

    I believe you must configure the frame rate using command 0x66 (see below). I would recommend adding that step to your I2C script. I would then try with a regular frame rate to confirm your results. If you are successful here you can try modifying the input frame rate. I am not sure what your results will be if your input frame rate is different than your configured frame rate.

    Hope that gets you in the right direction.

    Best,

    ~Danny W

  • Hi, Danny.  I'm now explicitly configuring the frame rate and exposure time as you suggested.  It hasn't made any difference.  Stepping through the commands, everything is OK until I hit command 0x78.  As soon as 0x78 (with data values 0x00,0x78,0x00) is executed the board crashes, the LED turns red and the video stops updating.

    Reading the data sheet more closely, it looks as if I need to send 3 patterns for 8-bit depth.  So I've tried the following variant for the 0x78 commnand:

    0x78 | (1<<8),0x20,0x08,0x04,0x24,0x08,0x00,0x28,0x08,0x00

    and I've also modified the 0x75 command (which comes before) so that it is now:

    0x75 | (1<<8),0x02,0x01,0x02,0x00

    to reflect the fact that there are 3 LUT entries.

    None of this makes any difference - still crashes on 0x78.

    What would be really helpful is if you could give me an example of the commands for step 7 of table 4.1 in the manual.  The table is rather incomplete to use as an example (e.g. for the 0x76 command the table doesn't even give a value for the data - I think I've worked out what's needed from the documentation of 0x76 but it would help to see a worked example).

    Thanks,

    Russell

  • Hi Russell,

    Try the following steps

    0x69 | (1<<8)  0x01   //set pattern mode

    0x65 | (1<<8)  0x00   //Stop pattern sequence in case sequence is already running

    0x6f | (1<<8)   0x00  //set external video source

    0x75 | (1<<8) 0x00 0x01 0x00 0x00)    // 1 pattern, repeat, trigger_out_2 after 1 pattern, don't care

    0x70 | (1<<8) 0x00     //set VSYNC trigger

    0x66 | (1<<8)  0x10 0x27 0x00 0x00 0x10 0x27 0x00 0x00  //Define pattern exposure and period 10ms

    0x77 | (1<<8) 0x02)   //open mailbox  (NB - manual says 0x01, but I think it's wrong - we're sending pattern definitions here, not image indices)

    0x76 | (1<<8) 0x00) //set offset

    0x78 | (1<<8) 0x01 0x78 0x04  //set LUT for trigger mode-0, 0x01 - Extern trigger (must be set for vsync as reference), 0x78 - 8-bit pattern white color, 0x04 - buffer swap must for first pattern

    0x77 | (1<<8) 0x00   //close mailbox

    0x7d | (1<<8) 0x00;  //validate (and read result)

    //Add delay for validation completion, alternatively you can poll for validation status completion. for experiment putting like 50ms or 100ms should work

    0x65 | (1<<8) 0x02)   //start the pattern display

    Regards,

    Sanjeev