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 api

Other Parts Discussed in Thread: DLP4500NIR, DLPC350, AM3358

Hi,

I am currently working with the "NIRScan main processing board controller with DMD Interface Board and DLP4500NIR DMD". I have a crosscompiling environment set up on my computer for the Sitara processor.

We want to have total control over the DMD, so I started to look into the DLP_NIRSCAN software. I noticed there is a dlpc350_api with all the functions to control the DMD. My question is about the steps I must take (which functions I need to call and in which order) to control it. 

For a start, I just want to display an internal test pattern or a BMP loaded from the SD card. Once I have the steps to display a test pattern I think I can figure out how to load a BMP.

Also, if there is a program available that explicitly calls the api then I should be able to reverse engineer it to fit it to our applications.

With kind regards, Gordian

edit0: My computer runs Ubuntu 14.04

  • Hello Gordian Zomer,

    As you know the DLPNIRscan uses DLPC350 and DLP4500NIR devices.

    In general if you are looking at a very high level ALL possible ways of controlling the DMD via DLPC350 you may want to look at other piece of software LightCrafter 4500 EVM GUI ( http://www.ti.com/dlplcr4500gui-v2 ).

    Technically the Sitara uses only portion of DLPC350/DLP4500NIR functionality, for instance display a Chessboard, you may find it difficult get the API sequence here. 

    The GUI comes with full source code, you can compile and run on Ubuntu or windows, This GUI can connect to NIRscan EVM also, from the GUI if you can look at various button and underneath API sequence calls, this will give you an idea on what all you can control DLP4500NIR via DLPC350.

    Let me know if it helps.

    Regards,

    Sanjeev

  • Hey Sanjeev,

    I notice the LightCrafter 4500 EVM GUI is Windows only and as I said I use a Ubuntu machine on which I would like to develop. Also, I could not find the source code for it.

    I have created a little program based on the api, but I think I am missing something, because I can not get an internal test image to display. I know I must be quite close, but I feel there is a small bit missing.

    The best thing now would be the source code of the GUI for Linux. Can you provide me with the link?

    Kind regards,

    Gordian

    edit0: I feel like I am just missing the part to let the DMD display the thing I put in.

  • Hello Gordian,

    Since we have not created Linux package, i suggest you to do the following, copy and install the Windows installer on a windows machine. 

    After you install, there source code is located here <drive>:\Texas Instruments-DLP\DLPLCR4500GUI-2.0.0\LightCrafter4500_source\GUI

    Just copy entire GUI folder contents on the Linux machine (there is xls file in GUI folder you can remove). Then you can proceed with building.

    I am attaching instructions for you. 7120.Linux_GUI_SourceCode_Build_Readme.pdf

    Regards,
    Sanjeev

  • Thank you for your quick reply. I got the GUI working on Windows and found the source code. At a quick glimpse I recognized some functions from the api, but there are about 4500 lines of code. 

    I am going to try to incorporate the stuff I need into a program and come back here if I need some guidance.

    Thanks for the help! Kind regards,

    Gordian

  • Hi Sanjeev,

    From the GUI source code (and dlp_nirscan) I have the following program (posted at the bottom) figured out, but I think I am missing a step. I want to display a checkerboard test pattern. I recon that I miss a display function, but I can not find it in the GUI source code for test patterns.

    Also, when I first plug in the board on the USB with direct acces to the DLPC350 and use the GUI I can choose a test pattern. When I then plug it in on the AM3358 port and crosscompile the program below for it and run it on the board, I can get test patterns to work with the code provided below. This makes me think that I miss an initialization or display step.

    I hope you can help me out.

    #include <stdint.h>
    #include <unistd.h>
    #include <stdio.h>
    #include <linux/types.h>
    #include <string.h>

    #include "usb.h"
    #include "dlpc350_api.h"

    uint32_t spi_clk_speed = 1500000; // must be between 10x sample rate and 1.92MHz. 750KHz is too slow for 30KHz data transfer
    static const char *device = "/dev/spidev1.0";


    int main() {

    USB_Init();

    if(USB_Open() != 0)
    printf("USB connection to DLPC350 failed\n");
    else if (USB_IsConnected())
    printf("USB connection to DLPC350 now open\n");

    DLPC350_SetPowerMode(0) ;
    DLPC350_SetMode(0) ; //Video Display mode

    DLPC350_SetPatternDisplayMode(0) ;
    DLPC350_SetInputSource(1,0) ; //internal test pattern, 30 bits
    DLPC350_SetTPGSelect(0x7) ; //Checkerboard

    }

  • I still don't know what is wrong with the above code, but the SAME code works for me when I run it from my laptop directly (instead of from the Cortex A8). So I still would like to know what is wrong with the crosscompiling part.

    The thing I want to do now is to load BMP images from my computer onto the DMD. I noticed that there is such an option which involves the creation of a new firmware file and flashing it onto the DLPC350. Is there also an option of just loading the BMP files directly to the device, because creating the firmware all the time seems a bit tedious.

  • Hello Gordian,

    Comments on your code 

    int main() {

    USB_Init();

    if(USB_Open() != 0)
    printf("USB connection to DLPC350 failed\n");
    else if (USB_IsConnected())
    printf("USB connection to DLPC350 now open\n");

    DLPC350_SetPowerMode(0) ;
    DLPC350_SetMode(0) ; //Video Display mode

    DLPC350_SetPatternDisplayMode(0) ; // Not needed for Internal Test Pattern display
    DLPC350_SetInputSource(1,0) ; //internal test pattern, 30 bits, note second parameter ignored when source = 1
    DLPC350_SetTPGSelect(0x7) ; //Checkerboard

    }

    Now, on your questions - 

    From the GUI source code (and dlp_nirscan) I have the following program (posted at the bottom) figured out, but I think I am missing a step. I want to display a checkerboard test pattern. I recon that I miss a display function, but I can not find it in the GUI source code for test patterns.

    [Sanjeev] Your code has everything that is needed for configuring the DLPC350 device to display internal test pattern - chess board pattern. I don't think you are missing any display function here.

    Also, when I first plug in the board on the USB with direct access to the DLPC350 and use the GUI I can choose a test pattern.

    [Sanjeev] Okay.

    When I then plug it in on the AM3358 port and crosscompile the program below for it and run it on the board, I can get test patterns to work with the code provided below. This makes me think that I miss an initialization or display step.

    [Sanjeev] In your previous step, the device already displaying internal test pattern, then how are you telling that after connecting to AM3358 port it is working? In the nirscan application the AM3358 USB o/p is configured to 'usb gadget' as ethernet over USB interface, I am not able to understand why you need to connect to AM3358 USB interface? Also I don't understand how you downloaded the cross-compile code...

    Regards,

    Sanjeev