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.

Compiler: DLP® Discovery 4100 Development Platform API Programmer, DMD doesn't set pattern if using C++ program

Other Parts Discussed in Thread: DLPC410

Tool/software: TI C/C++ Compiler

I use C++ program to control the DMD. All the commands are cout '1'(success), while no pattern shows up on DMD. 

My pattern was installed as txt file and imported into C++ row by row, which means the program should load data row by row. And then global reset. 

When i was coding, i referred to dlps024f.pdf and dlpu039a.pdf.

DMDcontrol.cpp

  • Hello User,

    What does GetNumDev() return?  and GetDMDTYPE(0)?

    I also noticed that you have four arguments in this function:

    LoadData(ucstr, 1920,0,0) -- from your file

    But in the Programmers Guide this only has two arguments:

    LoadData(UCHAR* RowData, long length)

    where "UCHAR* RowData" is one item - a pointer to RowData of the type "Unsigned CHAR"

    and "long length" is the length in bytes of RowData as type "long integer".  NOTE: Row data should be multiples of the width of the DMD.  The guide is a little misleading int that is says length (in bits) should be equal to the width of the DMD in pixels rather than a multiple of the width.

    Fizix

  • Thank you for your reply. It is 4 arguments. We do set the unsigned length as 1920 as same as the width of DMD in pixels. Could you write a few length of code to me? My aim is just to load data row by row. And let them show on the DMD.

  • Hello again User,

    You are correct.  I was looking at the ActiveX section which is covered in § 5.2.2, but  you would of course be using the direct DLL call covered in § 6.2.2.  Sorry for the confusion.

    However, the note about length is still correct.  This is the length in bytes of the data in RowData.  If you are only putting the length as the length of one row in pixels (i.e. 1920), then it will load 8 rows.  If there are only 1920 bits (240 bytes) in the data, then it will not work, because it will run out of bytes in RowData and return an error.  Try 240 instead of 1920 if you are only loading 1 row of data.  I have verified this is the length in bytes, NOT bits.  

    The DLPC410 is only a binary controller.  Each pattern must be 1-bit per pixel.  The controller does not do any gray-scale values, so that it is 240 bytes = 1920 bits for one row.

    I hope this clarifies the issue.  The Programmer's Guide should definitely be edited to clarify this.  It has been entered in the queue.

    Fizix

  • Thank you so much for your patient explanation. I have change 1920 to 240, which is my fault. However, the DMD still doesn't show any pattern. I doubt that maybe there should be some other codes be added to the program. I believe the datas have been upload to the DMD but were not setup because the LoadData() returns "1"(success). Could you write some codes for me or if you have any sample program in hand? This is better for me to make a reference. Thank you so much anyway.  

  • Hello User,

    I have been digging into the code a little to see if there is something missing.

    Unfortunately, I will not be able to write code for you, but if I find anything obvious I will communicate it with you.

    Fizix