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.

DLPD4X00KIT: Download my binary patterns to the DMD( DLP4100 & DLP7000 ) with USB DLL API.

Part Number: DLPD4X00KIT

Now I am trying to download my binary patterns to the DMD( DLP4100 & DLP7000 ) with USB DLL API.

But it doesn't work ; No patterns appear on the DMD surface.

I don't think the board or USB driver installation is in failure, as I already have checked my board's proper operation by Dicovery 4100 Explorer GUI software.

Though I have read the document DLPU039A, I can't figure out what procedure is correct.

Here is my understanding of API function call order. Please have a look at it and indicate what is incorrect.

(*.h and *.lib files were downloaded from this thread ; "DLPLCRC410EVM: Comunicate with the DLPLCRC410EVM through Matlab or Python")

#include "stdafx.h"
#include "../../D4100Lib/8055.D4100_usb.h"
#include "../../D4100Lib/CyAPI.h"
#include "../../D4100Lib/RegisterDefines.h"

#pragma comment(lib, "../../D4100Lib/6562.D4100_usb.lib")
using namespace USB;

int main()
{
	short numDevices = GetNumDev();
	short deviceNumber = numDevices - 1; // Only One device is connected.
	short dmdType = GetDMDTYPE(deviceNumber); // should be 1(DLP7000)
	
	SetWDT(0, deviceNumber); // Disable WDT
	SetPWRFLOAT(0, deviceNumber); // Disable Power Float
	SetTPGEnable(0, deviceNumber); // Disable TestPatternGenerator

	FILE *fp = fopen("./S1DMD-%04d.bin", "rb"); // load my own pattern
	unsigned char rowData[(1024/8)*768];
	fread(rowData, sizeof(rowData), 1, fp); // prepare DMD pattern data from bin file.
	fclose(fp);

	SetBlkMd(0, deviceNumber); // DMD Block Operations -- NOP
	LoadControl(deviceNumber); // DMD Block Operations -- Execute!

	ClearFifos(deviceNumber); // Initialize the DMD fifo.
	LoadData(rowData, sizeof(rowData)/2, dmdType, deviceNumber); // Load 1st half of pattern into the DMD.
	LoadData(rowData+sizeof(rowData)/2, sizeof(rowData)/2, dmdType, deviceNumber); // Load last half of pattern into the DMD.
	
	SetBlkMd(3, deviceNumber); // DMD Block Operations -- Global Reset Requet
	SetBlkAd(8, deviceNumber); // BLK_AD=4'b10xx
	LoadControl(deviceNumber); // // DMD Block Operations -- Execute! ; SHOULD APPEAR MY OWN PATTERN HERE

	return 0;
}

  • Hello Goro,

    First, welcome to the DLP section of the TI-E2E forums.

    Please try one thing before we get too far down the trail to help you debug.  Each time you send "LoadControl" could you send it 3 times and see if the code works then?

    We will proceed from there.

    Fizix

  • Hello Fizix, thank you for your reply.

    I tried 3 times of "LoadControll", but it did not change the situation.
    I modified my code as follows. Is it what you aimed at?

    int main()
    {
    	short numDevices = GetNumDev();
    	short deviceNumber = numDevices - 1; // Only One device is connected.
    	short dmdType = GetDMDTYPE(deviceNumber); // should be 1(DLP7000)
    	
    	printf("numDevices   : \t%d\n",numDevices  );
    	printf("dmdType      : \t%d\n",dmdType     );
    	
    	//// Just for assertion .. ////
    	unsigned long driverRev   = GetDriverRev(deviceNumber);
    	unsigned long firmwareRev = GetFirmwareRev(deviceNumber);
    	short         usbSpeed    = GetUsbSpeed(deviceNumber);
    	unsigned long dllRev      = GetDLLRev();
    	unsigned long fpgaRev     = GetFPGARev(deviceNumber);
    	short         ddcVersion  = GetDDCVERSION(deviceNumber);
    	printf("driverRev   :\t0x%08X\n",driverRev  );
    	printf("firmwareRev :\t0x%08X\n",firmwareRev);
    	printf("usbSpeed    :\t%d\n",    usbSpeed   );
    	printf("dllRev      :\t0x%08X\n",dllRev     );
    	printf("fpgaRev     :\t0x%08X\n",fpgaRev    );
    	printf("ddcVersion  :\t0x%04X\n",ddcVersion );
    	///////////////////////////////
    	
    	
    	SetWDT(0, deviceNumber); // Disable WDT
    	SetPWRFLOAT(0, deviceNumber); // Disable Power Float
    	SetTPGEnable(0, deviceNumber); // Disable TestPatternGenerator
    
    	FILE *fp = fopen("../../TMGenerator/C++/Result/S1DMD-0001.bin", "rb"); // load my own pattern
    	unsigned char rowData[(1024 / 8) * 768];
    	fread(rowData, sizeof(rowData), 1, fp); // prepare DMD pattern data from bin file.
    	fclose(fp);
    
    	SetBlkMd(0, deviceNumber); // DMD Block Operations -- NOP
    	LoadControl(deviceNumber); // DMD Block Operations -- Execute!
    	LoadControl(deviceNumber); // DMD Block Operations -- Execute!
    	LoadControl(deviceNumber); // DMD Block Operations -- Execute!
    
    	ClearFifos(deviceNumber); // Initialize the DMD fifo.
    	LoadData(rowData, sizeof(rowData) / 2, dmdType, deviceNumber); // Load 1st half of pattern int the DMD.
    	LoadData(rowData + sizeof(rowData) / 2, sizeof(rowData) / 2, dmdType, deviceNumber); // Load last half of pattern int the DMD.
    
    	SetBlkMd(3, deviceNumber); // DMD Block Operations -- Global Reset Requet
    	SetBlkAd(8, deviceNumber); // BLK_AD=4'b10xx
    	LoadControl(deviceNumber); // // DMD Block Operations -- Execute!
    	LoadControl(deviceNumber); // DMD Block Operations -- Execute!
    	LoadControl(deviceNumber); // DMD Block Operations -- Execute!
    
    	return 0;
    }

    From above code, I got these values. Are there anything suspicious?

    numDevices   :  1
    dmdType      :  1
    driverRev   :   0x010303E7
    firmwareRev :   0x00000200
    usbSpeed    :   1
    dllRev      :   0x00020001
    fpgaRev     :   0xAC02230C
    ddcVersion  :   0x0007

  • Hello Goro,

    Yes, that is exactly what I had in mind.  This confirms that it is probably not a timing issue.

    I will need to look a little closer at your code.  I should have a response in the next day or so.

    FIzix

  • Hi FIzix, thank you for your support.

    Now I managed to display my own pattern on the DMD.
    There were 2 problems.
    One was lacking of RowMd operations before executing "LoadData" function, and another was executing "SetPWRFLOAT".

    I modified my code as follows. Please have a look at it, if I still made other mistakes or not.

    int main()
    {
    	short numDevices = GetNumDev();
    	short deviceNumber = numDevices - 1; // Only One device is connected.
    	short dmdType = GetDMDTYPE(deviceNumber); // should be 1(DLP7000)
    
    	SetWDT(0, deviceNumber); // Disable WDT
    //x	SetPWRFLOAT(0, deviceNumber); // Disable Power Float
    	SetTPGEnable(0, deviceNumber); // Disable TestPatternGenerator
    
    
    	FILE *fp = fopen("../../TMGenerator/C++/Result/S1DMD-0001.bin", "rb"); // load my own pattern
    	unsigned char rowData[(1024 / 8) * 768];
    	fread(rowData, sizeof(rowData), 1, fp); // prepare DMD pattern data from bin file.
    	fclose(fp);
    
    	SetBlkMd(0, deviceNumber); // DMD Block Operations -- NOP
    	LoadControl(deviceNumber); // DMD Block Operations -- Execute!
    
    	SetRowMd(3, deviceNumber); // Set First row address
    	SetNSFLIP(0, deviceNumber); //
    	LoadControl(deviceNumber); // Row Operations -- Execute!
    
    	SetRowMd(1, deviceNumber); // Increment internal row address by 1
    	SetNSFLIP(0, deviceNumber); //
    	LoadControl(deviceNumber); // Row Operations -- Execute!
    
    	ClearFifos(deviceNumber); // Initialize the DMD fifo.
    	LoadData(rowData, sizeof(rowData) / 2, dmdType, deviceNumber); // Load 1st half of pattern int the DMD.
    	LoadData(rowData + sizeof(rowData) / 2, sizeof(rowData) / 2, dmdType, deviceNumber); // Load last half of pattern int the DMD.
    
    	SetBlkMd(3, deviceNumber); // DMD Block Operations -- Global Reset Requet
    	SetBlkAd(8, deviceNumber); // BLK_AD=4'b10xx
    	LoadControl(deviceNumber); // // DMD Block Operations -- Execute!
    
    	return 0;
    }

  • Hello Goro,

    The snippet you have here seems OK, but of course you need to continue to exercise and test it.

    Thank you for sharing your result so others can benefit!

    Fizix