Hi,
I'm currently an probetion for an electronics system development company and they gave me LPC1788 and Topway LMT057DCDFWU-NBA to work with. I don`t have mentor or any kind of help. I don`t have any example.
I'm also very new to programming therefore it is rather hard for me to work with the device. If someone could give me some kind of help, or some initalization code for LPC 1788 lcd controller, or some example ?
Any advice is welcomed.
Thank you very much.
Great, we can skip a lot of basics then.
The most important is that you will need to find out the timings. Those are in the datasheets for the display.
First of all, the pixels are output at a clock frequency called the "Pixel Clock" (also known as PCLK).
All my horizontal timings are based on PCLKs, which also means they're based on number of pixels.
All my vertical timings are based on horizontal line counts.
The Horizontal and Vertical timings have these types in common:
Sync Pulse, followed by Back Porch, followed by Active Video, followed by Front Porch.
Active Video is the number of visible pixels on the display.
Front Porch and Back Porch are delays between the Active Video and the Sync Pulse.
You need to find the values for those timings in the datasheet. Here's what we're looking for:
On page 3 in the datasheet for the TFT display, you will find the first clue under "Number of dots"; this gives you the number of visible pixels (HAV and VAV).
Further down on page 3, you also find another interesting detail under "Input Interface, R:G:B=x:y:z", that's the number of bits per component; these are needed later.
Under AC Characteristics you will find PCLK (CLK frequency/FCPH), HSYNC Pulse Width (that's HS pulse width in pixels), VSYNC Pulse Width (that's VS pulse width in lines). We also get the HS period, which is Horizontal Frame Length and VS period, which is Vertical Frame Length.
Pay attention to the note saying "When SYNC mode is used ..." This gives us the HBP timing in pixels, because it's the time between the sync pulse and the active video.
If we look in the table again, we can see that 144 is mentioned under HS-DEN, which means it must mean the timing betwen HS and DEN.
Thus we also get VS-DEN, which would be VBP.
Figure 6-1-2 and Figure 6-1-3 reveals the polarity of the HSYNC and VSYNC signals (HPOL and VPOL); they're active low.
Now we have PCLK, VSP, VBP, VAV, VFL, HSP, HBP, HAV and HFL.
We still need to find VFP and HFP.
Since we have HSP, HBP, HAV and HFL, we can calculate HFP, as HFL=(HSP+HBP+HAV+HFP):
HFP = HFL - (HSP + HBP + HAV)
The same applies to the Vertical Front Porch:
VFP = VFL - (VSP + VBP + VAV)
So now I believe we've got all the timing informations we need.
The next step is to go to the LPC178x/7x User's Manual and find out how to set up the TFT controller.
I will continue in the next reply...