K70 LCDC performance with graphics window

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

K70 LCDC performance with graphics window

Jump to solution
920 Views
kaisermechatron
Contributor I

Hi everybody,

I'm developing an baremetal application on the K70 Tower Board with the RGB-LCD addon. I started by using the lcdc example from the KINETIS_120MHZ_SC package and everythind worked fine. I find it very intuitive to directly manipulate the pixels in memory (external DDR2) and write the basic functions by myself.

However, I noticed when clearing the screen and completely redrawing it, there was a certain amount of flickering visible. I assume that the reason for this is, that the lcdc decides by itself when to refresh the screen and not after the program has rewritten the whole memory for the screen.

Therefore I looked for a possibiltiy to refresh the screen manually "by myself" after I was done editing the pixels im memory.

I ended up using the normal screen and the so called "graphics window" ontop of each other with the same dimensions.

One of the two is displayed while the program draws the new image in the second one. After the draw process is completed, I swap the images (by either displaying the graphics window or not, so the normal screen is visible).

Why do I do this?

The later application is (naturally) supposed to run as fast and fluid as possible so I needed a way of refreshing the display manually and didnt find any...

Now lets face the performance issue:

Since I want to refresh the screen as often as possible, the program redraws the whole screen in the while(1) together with the menue-navigation.

When there is no change in the menue (attached rotary-encoder for navigation), the graphics window and the screen contain an identical set of data/pixels and no flickering is visible.

Unfortunately, when I quickly navigate through the menue, I see, that the navigation is not that fluid anymore :-(

I was at the "electronica" trade fair last week in Munich and talked to one freescales employees about this issue. He mentioned, that it might be a simple performance issue with the DMA, as it is not that fast when transferring the data to the external memory while at the same time the lcdc-module reads the data back (single memory access).

I'm kind of stuck here and am really looking forward to some help which might get me in the right direction ;-)

Many thanks in advance!

Kaiser

0 Kudos
1 Solution
474 Views
LuisCasado
NXP Employee
NXP Employee

Hi Julian,

Are you enabling DMA bursting for background plane and graphic window?

For example, for main plane:

 

LCDC_LDCR &= ~(LCDC_LDCR_BURST_MASK);

 

Turn on caches will help as well:

// turn code cache on

  LMEM_PCCCR = (LMEM_PCCCR_GO_MASK | LMEM_PCCCR_INVW1_MASK | LMEM_PCCCR_INVW0_MASK | LMEM_PCCCR_ENWRBUF_MASK | LMEM_PCCCR_ENCACHE_MASK);

      while( LMEM_PCCCR & LMEM_PCCCR_GO_MASK ){};

       

  LMEM_PSCRMR = LMEM_PSCRMR_R0(2) | LMEM_PSCRMR_R1(2) | LMEM_PSCRMR_R2(2) | LMEM_PSCRMR_R3(2) | LMEM_PSCRMR_R4(0) | LMEM_PSCRMR_R5(0)

                | LMEM_PSCRMR_R6(2) | LMEM_PSCRMR_R7(2) | LMEM_PSCRMR_R8(2) |  LMEM_PSCRMR_R9(2);

  // turn system cache on   

  LMEM_PSCCR = ( LMEM_PSCCR_GO_MASK | LMEM_PSCCR_INVW1_MASK | LMEM_PSCCR_INVW0_MASK | LMEM_PSCCR_ENWRBUF_MASK | LMEM_PSCCR_ENCACHE_MASK);

      while( LMEM_PSCCR & LMEM_PSCCR_GO_MASK ){};

Best Regards,

Luis

View solution in original post

0 Kudos
3 Replies
475 Views
LuisCasado
NXP Employee
NXP Employee

Hi Julian,

Are you enabling DMA bursting for background plane and graphic window?

For example, for main plane:

 

LCDC_LDCR &= ~(LCDC_LDCR_BURST_MASK);

 

Turn on caches will help as well:

// turn code cache on

  LMEM_PCCCR = (LMEM_PCCCR_GO_MASK | LMEM_PCCCR_INVW1_MASK | LMEM_PCCCR_INVW0_MASK | LMEM_PCCCR_ENWRBUF_MASK | LMEM_PCCCR_ENCACHE_MASK);

      while( LMEM_PCCCR & LMEM_PCCCR_GO_MASK ){};

       

  LMEM_PSCRMR = LMEM_PSCRMR_R0(2) | LMEM_PSCRMR_R1(2) | LMEM_PSCRMR_R2(2) | LMEM_PSCRMR_R3(2) | LMEM_PSCRMR_R4(0) | LMEM_PSCRMR_R5(0)

                | LMEM_PSCRMR_R6(2) | LMEM_PSCRMR_R7(2) | LMEM_PSCRMR_R8(2) |  LMEM_PSCRMR_R9(2);

  // turn system cache on   

  LMEM_PSCCR = ( LMEM_PSCCR_GO_MASK | LMEM_PSCCR_INVW1_MASK | LMEM_PSCCR_INVW0_MASK | LMEM_PSCCR_ENWRBUF_MASK | LMEM_PSCCR_ENCACHE_MASK);

      while( LMEM_PSCCR & LMEM_PSCCR_GO_MASK ){};

Best Regards,

Luis

0 Kudos
474 Views
kaisermechatron
Contributor I

Hi Luis,

thank you for your suggestions.

DMA bursting is enabled for both the graphics window and the normal screen plane.

Regarding the caching, do I have to enable it before every display refresh or once on system startup?

Best regards,

Julian

0 Kudos
474 Views
LuisCasado
NXP Employee
NXP Employee

Hi Julian,

Only once at system startup.

Best Regards,

Luis

0 Kudos