EmbeddedRelated.com
Forums

LPC2478 trouble with LCD controller ,run in external flash

Started by hjiongh September 18, 2008
I'm working on a device using the new LPC2478 to drive a touchscreen
TFT. We're using Embedded Artists' new LPC2478-OEM board, and run
code in external flash.

The example project is run in internal flash and it runs correctly.
Because my project is too large to run in internal flash, so I decide
to place project to external flash ,use CS0, address from 0x80000000.

Now problem is:
===================================================When I debug and Single-step till LCD and DMA is enable(picture data
is written to SDRAM ,from 0xa0000000,LCD_UPBASE = 0xa0000000. The
code is just example project and I don't modify. I only modify just
MEMMAP modify to 3 and modify .xcl file such as ROMSTART 0x80000000),picture is appear. But if I full-step ,the picture is
disappear . If I stop full-step, the picture is appear again. I can
not understand it. If I download code to external flash and run it
offline, the picture cannot appear yet. But everything is ok in
internal flash.
I have no idea to slove it . Please help me . Thanks !

An Engineer's Guide to the LPC2100 Series

Hi Herbert,
Thanks for your response.
Your meaning is that when I execute in external flash, the DMA
engine refreshes the TFT out of the SDRAM does not work anymore ?

I can not understand. Because when I debug and Single-step to the end
of my project, that is "while(1)" ,the picture appear. So the DMA
engine refreshes the TFT out of the SDRAM should still work . Then
after I full-step ,the picture disappear. If I stop and when I Single-
step again(actually now I run NULL operation),the picture will
wobble . I don't know why the picture will wobble.(In internal
flash , the same operation, the picture will not wobble.)

//Regards
//Vincent (hjiongh)

--- In l..., Herbert Demmel wrote:
>
> Hi,
>
> I assume (that means I'm not sure) that running your program out of
> external flash possibly blocks the bus too much to give the LPC2478
> enough time to refresh the TFT with the selected pixel clock.
>
> It depends on how much wait states accessing the external flash
> needs. I think you can make an rough estimation about the band
width
> needed when you imagine that with a choosen pixel clock of e.g.
10MHz
> 2 bytes have to fetched about every 7th processor cycle thus
leaving
> very little bandwidth, especially when the external flash is slow.
>
> Besides that, there is an AHB bridge (correct me if my wording is
> wrong) allowing you to executing with full speed out of the
internal
> flash while the DMA engine refreshes the TFT out of the SDRAM. This
> does not work anymore when you execute out of external flash.
>
> Regards
> Herbert
>
>
> At 11:51 18.09.2008 +0000, you wrote:
> >I'm working on a device using the new LPC2478 to drive a
touchscreen
> >TFT. We're using Embedded Artists' new LPC2478-OEM board, and run
> >code in external flash.
> >
> >The example project is run in internal flash and it runs correctly.
> >Because my project is too large to run in internal flash, so I
decide
> >to place project to external flash ,use CS0, address from
0x80000000.
> >
> >Now problem is:
> >
> >
> >
hjiongh wrote:
> Hi Herbert,
> Thanks for your response.
> Your meaning is that when I execute in external flash, the DMA
> engine refreshes the TFT out of the SDRAM does not work anymore ?
>
> I can not understand. Because when I debug and Single-step to the end
> of my project, that is "while(1)" ,the picture appear. So the DMA
> engine refreshes the TFT out of the SDRAM should still work . Then
> after I full-step ,the picture disappear. If I stop and when I
> Single- step again(actually now I run NULL operation),the picture
> will wobble . I don't know why the picture will wobble.(In internal
> flash , the same operation, the picture will not wobble.)
>

I think Herbert is right.

There is only one memory bus for "external memory" inside the LPC2478. This is used for both the TFT refresh from SDRAM, and for any other external memory transfers you do. If you "block" the memory bus by executing from external Flash (or by copying data from external flash), the TFT refresh stops. If your memory operation is quick (like a single step execute), the picture "wobbles". If your memory operation is long, the picture disappears completely.

When you're executing from internal flash you are using a different bus so the TFT refresh keeps working.

This is a problem I have also experienced when copying bitmaps from external flash. In my view it is a big problem with the LPC2478 and I don't think NXP knew about it till recently. It isn't documented at all.

--
Tim Mitchell
Hi, Tim ;
Thanks for your response.(Also thanks for Herbert.)
Bases on USER MANUAL , (user.manual.lpc24xx_Jul18_2008,from page
279,LCD controller functional description),LCD controller has own DMA
channels . Just like LPC2470 is flashless, if LPC2470 want to use LCD
controller , must use external flash . Do you agree with me?
You wrote: This is a problem I have also experienced when copying
bitmaps from external flash. I just want to know , how did you solve
it?
Hope your response, I have no idea to solve this problem.
(I have mailed you ,Do you receive it?)
Thank you very much!

// Best Regards!
// Vincent(hjiongh)

--- In l..., "Tim Mitchell" wrote:
>
> hjiongh wrote:
> > Hi Herbert,
> > Thanks for your response.
> > Your meaning is that when I execute in external flash, the DMA
> > engine refreshes the TFT out of the SDRAM does not work anymore ?
> >
> > I can not understand. Because when I debug and Single-step to the
end
> > of my project, that is "while(1)" ,the picture appear. So the
DMA
> > engine refreshes the TFT out of the SDRAM should still work .
Then
> > after I full-step ,the picture disappear. If I stop and when I
> > Single- step again(actually now I run NULL operation),the picture
> > will wobble . I don't know why the picture will wobble.(In
internal
> > flash , the same operation, the picture will not wobble.)
> >
>
> I think Herbert is right.
>
> There is only one memory bus for "external memory" inside the
LPC2478. This is used for both the TFT refresh from SDRAM, and for
any other external memory transfers you do. If you "block" the memory
bus by executing from external Flash (or by copying data from
external flash), the TFT refresh stops. If your memory operation is
quick (like a single step execute), the picture "wobbles". If your
memory operation is long, the picture disappears completely.
>
> When you're executing from internal flash you are using a different
bus so the TFT refresh keeps working.
>
> This is a problem I have also experienced when copying bitmaps from
external flash. In my view it is a big problem with the LPC2478 and I
don't think NXP knew about it till recently. It isn't documented at
all.
>
> --
> Tim Mitchell
>

hjiongh wrote:
> Hi, Tim ;
> Thanks for your response.(Also thanks for Herbert.)
> Bases on USER MANUAL , (user.manual.lpc24xx_Jul18_2008,from page
> 279,LCD controller functional description),LCD controller has own
> DMA channels . Just like LPC2470 is flashless, if LPC2470 want to
> use LCD controller , must use external flash . Do you agree with
> me? You wrote: This is a problem I have also experienced when
> copying bitmaps from external flash. I just want to know , how did
> you solve it? Hope your response, I have no idea to solve this
> problem. (I have mailed you ,Do you receive it?) Thank you very much!

I have struggled a lot with this problem. I think the user manual does
not tell the whole truth. Although it has its own DMA channels it
appears to use the same hardware bus. Any data transfer on the external
memory controller locks out the TFT refresh until it is finished. I have
queried NXP about this and they have had a demo displaying video on the
TFT, but only on a small TFT (QVGA) running with a slow pixel clock
(6MHz I think). Also they did not say where they were copying their data
from, if they were using the internal flash they would not have seen the
problem.

Good question about LPC2470. I am not sure it is shipping yet so maybe
nobody has tried it. I do not think NXP were aware of the problem till
we raised it.

I have got round my problem by copying all my flash data into SDRAM on
boot-up, before the display is enabled. The SDRAM is faster and does not
block the bus for as long. If you have enough SDRAM you could copy your
code there and try executing from RAM. However it still might not work,
executing code requires a lot more data transfer than copying a single
bitmap.

--
Tim Mitchell
Hi, Tim:
Your meaning is that you not use external flash,only use external
SDRAM. And execute code from external SDRAM? Did you succeed ?
Or still have some trouble?
Your code is executing from RAM? internal RAM? 0x40000000?

// Best Regards
// Vincent(hjiongh)

--- In l..., "Tim Mitchell" wrote:
>
> hjiongh wrote:
> > Hi, Tim ;
> > Thanks for your response.(Also thanks for Herbert.)
> > Bases on USER MANUAL , (user.manual.lpc24xx_Jul18_2008,from
page
> > 279,LCD controller functional description),LCD controller has
own
> > DMA channels . Just like LPC2470 is flashless, if LPC2470
want to
> > use LCD controller , must use external flash . Do you agree
with
> > me? You wrote: This is a problem I have also experienced when
> > copying bitmaps from external flash. I just want to know , how did
> > you solve it? Hope your response, I have no idea to solve this
> > problem. (I have mailed you ,Do you receive it?) Thank you very
much!
>
> I have struggled a lot with this problem. I think the user manual
does
> not tell the whole truth. Although it has its own DMA channels it
> appears to use the same hardware bus. Any data transfer on the
external
> memory controller locks out the TFT refresh until it is finished. I
have
> queried NXP about this and they have had a demo displaying video on
the
> TFT, but only on a small TFT (QVGA) running with a slow pixel clock
> (6MHz I think). Also they did not say where they were copying their
data
> from, if they were using the internal flash they would not have
seen the
> problem.
>
> Good question about LPC2470. I am not sure it is shipping yet so
maybe
> nobody has tried it. I do not think NXP were aware of the problem
till
> we raised it.
>
> I have got round my problem by copying all my flash data into SDRAM
on
> boot-up, before the display is enabled. The SDRAM is faster and
does not
> block the bus for as long. If you have enough SDRAM you could copy
your
> code there and try executing from RAM. However it still might not
work,
> executing code requires a lot more data transfer than copying a
single
> bitmap.
>
> --
> Tim Mitchell
>

hjiongh wrote:
> Hi, Tim:
> Your meaning is that you not use external flash,only use external
> SDRAM. And execute code from external SDRAM? Did you succeed ? Or
> still have some trouble? Your code is executing from RAM?
> internal RAM? 0x40000000?
>

No.
All my code is in the LPC2478 internal Flash.
My application has a lot of bitmaps to display on the TFT. These are
stored in external Flash.
There is also an external SDRAM which is used for the TFT frame buffer.

I experienced display problems when copying the bitmaps from external
flash to the SDRAM frame buffer for display.
I found that if I copied the bitmaps to another area of SDRAM, then just
copied them over to the TFT frame buffer when required for display, I
did not get the display problems.

--
Tim Mitchell
Hi, Tim;
I see . I executed code from internal flash successfully . But
because my application is too large to store in internal 512K flash.
So I have to store it in external flash. And my application will have
update function in future. So internal flash is too small to store my
application.
Could you give me some advice? And do you have some experiences
about modify .xcl file? I just want to use external SDRAM instead of
internal SRAM. Because my data is larger than 64K.
Thanks!!!

// Best Regards
// Vincent(hjiongh)

--- In l..., "Tim Mitchell" wrote:
>
> hjiongh wrote:
> > Hi, Tim:
> > Your meaning is that you not use external flash,only use
external
> > SDRAM. And execute code from external SDRAM? Did you succeed ? Or
> > still have some trouble? Your code is executing from RAM?
> > internal RAM? 0x40000000?
> > No.
> All my code is in the LPC2478 internal Flash.
> My application has a lot of bitmaps to display on the TFT. These are
> stored in external Flash.
> There is also an external SDRAM which is used for the TFT frame
buffer.
>
> I experienced display problems when copying the bitmaps from
external
> flash to the SDRAM frame buffer for display.
> I found that if I copied the bitmaps to another area of SDRAM, then
just
> copied them over to the TFT frame buffer when required for display,
I
> did not get the display problems.
>
> --
> Tim Mitchell
>

hi
i am using wvga lcd.so i have change controller lpc2478.i need
development board keil microvision based.is possible help me
Hi, Tim;

Now you execute code from internal flash and store bitmaps in
external flash ? But still have some problem of copying bitmaps from
external flash to external SDRAM ?

I also have connected to my technology support of NXP. They still
have not solved it yet. And they have refered it to NXP HQ. I'm
waiting for their feedback now .

--- In l..., "Tim Mitchell" wrote:
>
> hjiongh wrote:
> > Hi, Tim:
> > Your meaning is that you not use external flash,only use
external
> > SDRAM. And execute code from external SDRAM? Did you succeed ? Or
> > still have some trouble? Your code is executing from RAM?
> > internal RAM? 0x40000000?
> > No.
> All my code is in the LPC2478 internal Flash.
> My application has a lot of bitmaps to display on the TFT. These are
> stored in external Flash.
> There is also an external SDRAM which is used for the TFT frame
buffer.
>
> I experienced display problems when copying the bitmaps from
external
> flash to the SDRAM frame buffer for display.
> I found that if I copied the bitmaps to another area of SDRAM, then
just
> copied them over to the TFT frame buffer when required for display,
I
> did not get the display problems.
>
> --
> Tim Mitchell
>