Part Number: DLPD4X00KIT
Hello,
I am making use of "D4100_usb.dll" to program a GUI with C# to control the DLPD4100 development platform. However, I can only successfully upload images after I have uploaded image with the official software "Discovery 4100 Explorer". If I power-up the DMD, use "Discovery 4100 Explorer" to upload and reset a image, turn off "Discovery 4100 Explorer", then use my code to upload and reset a image, it work. But if I power-up the DMD, use my code to program FPGA, and then use my code to upload and reset a image, it doesn't work (just keeps showing those alternating testing patterns).
Complete tests on this issue are listed below:
(1) power-up DMD --> use my code to program FPGA --> use my code to upload a image and reset --> does not work
(2) power-up DMD --> use my code to upload a image and reset --> does not work
(3) power-up DMD --> open official software and do nothing --> use my code to program FPGA --> use my code to upload a image and reset --> does not work
(4) power-up DMD --> open official software and do nothing --> use my code to upload a image and reset --> does not work
(5) power-up DMD --> open official software and upload a image and reset --> use my code to program FPGA --> use my code to upload another image and reset --> does not work
(6) power-up DMD --> open official software and upload a image and reset --> use my code to upload another image and reset --> WORKS
(7) power-up DMD --> open official software and do nothing --> use my code to program FPGA --> use my code to upload a image and reset --> showing alternating testing patterns --> upload a image with official software and reset --> showing my image
The code I use to program the FPGA is
public static void reprogramFPGA()
{
FileStream file = new FileStream("D4100_GUI_FPGA.bin", FileMode.Open);
long length = file.Length;
if (length != 1569584)
throw new Exception();
byte[] FPGA = new byte[length];
for(long i=0;i<length;i++)
{
FPGA[i] = (byte)file.ReadByte();
}
int res = program_FPGA(ref FPGA[0], length, 0);
file.Close();
}
The code I use to upload a image and reset is
public static void showZebra()
{
SetBlkMd(0, 0); //Set BlkMode to No Op
SetRowMd(3, 0); //Set Row Mode to Set Address mode
SetRowAddr(0, 0); //Set the Row address to the top of the DMD
//ptrOutBuffer = m_FrameBuff;
const int DMDBytesPerRow = 240;
const int DMDRowsPerBlock = 72;
const int BlocksPerLoad = 2;
byte[] zebra = new byte[1920 * 1080/8];
for (int i = 0; i < 1920 * 1080/8; i++)
{
if (i%(240*72*2)<240*72)
zebra[i] = 0x00;
else
zebra[i] = 0xff;
}
LoadData(ref zebra[0], DMDBytesPerRow, 0, 0); //Load the first row of data
Thread.Sleep(1);
SetRowMd(1, 0); //Set the DMD pointer to Increment mode
LoadData(ref zebra[DMDBytesPerRow], DMDBytesPerRow * (DMDRowsPerBlock - 1), 0, 0); //Load the rest of Block 1
Thread.Sleep(1);
for (int i = 1; i < 15; i++)
LoadData(ref zebra[DMDBytesPerRow * DMDRowsPerBlock * i], DMDBytesPerRow * DMDRowsPerBlock, 0, 0); //Load the other 14 blocks
SetRowMd(0, 0);
SetBlkMd(3, 0);
SetBlkAd(8, 0);
LoadControl(0);
Thread.Sleep(1);
SetBlkMd(0, 0);
LoadControl(0);
LoadControl(0);
SetGPIORESETCOMPLETE(0);
}
Any suggestion on this issue?