LCD Interrupts: What is freescales notion of VSync and Front Porch interrupts?

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

LCD Interrupts: What is freescales notion of VSync and Front Porch interrupts?

1,173 Views
mkjeldsen
Contributor II

Hi,

I'm having a bit of trouble determining the proper configuration on the Kinetis platform for some of the common LCD interrupts. Usually, i'd be able to configure registers to trigger interrupts for something like the following:

  • Start of vertical synchronization
  • Start of back porch
  • Start of front porch.

In the K70-sub family (MK70FN1M0VMJ12) reference manual, starting at page 2202, we can handle LCD interrupts using the LCDC_LICR, LCDC_LIER and LCDC_LISR registers. The manual names concepts like Begin Of Frame (BOF), End of Frame (EOF), on load of last/first data of frame from memory, on outout of last/first data to LCD panel - And is seems that a combination of these settings should comprise the notion of Vsync and front/back porch.

Currently, my idea of a Front Porch interrupt is to set interrupt flag on output of last data of frame to LCD panel. And for VSync to set interrupt flag on load of first data of frame from memory - For both these settings, Begin Of Frame is configured in the LICR and LIER registers. I'm not interested in EOF, i think, unless EOF in some way relates to Front Porch, but in this case it seems like on output of last data of frame to LCD panel fits more precisely. 

I'm seeing some glitching because my framebuffers seem like they're being swapped while i'm drawing to the display. I'd like the swap to happen before Back Porch begins, but something tells me the above interpretations aren't correct.

Thanks in advance!

Labels (1)
0 Kudos
5 Replies

700 Views
apanecatl
Senior Contributor II

An interrupt triggered when the Front Porch is reached would corresponds to the output of last data of frame to LCD whilst one triggered when the Back Porch is reached would correspond to output of first data of frame to LCD, an interrupt triggered at VSYNC  would then correspond to load on first data of frame memory. It might not seem to clear from the VSYNC or HSYNC point of view but it might be clearer if you take into consideration the graphical window instead.

0 Kudos

700 Views
mkjeldsen
Contributor II

Just to update this thread: I'm still having tearing issues.

As far as my measurements show, my LCD interrupts are configured as we've discussed, and comparing to the LCD_VSYNC signal, the two VSyncs line up nicely. Also, measurements show that framebuffers are swapped microseconds around the vsync signal.

There is a 128 x 32 bit line buffer in the LCDC that stores DMA data from system memory. Can any of this tearing be related to this buffer and DMA burst mode in some way? How is this buffer loaded with data? Could load times for this buffer have an impact on our LCD interrupts?

Thank you in advance,

Best regards

Martin

0 Kudos

700 Views
apanecatl
Senior Contributor II
  1. first data of frame memory triggers the interrupt as soon as the first data transfer is initiated
  2. If you want to make sure all of the data has been finished loading before it is sent to the LCD I suggest you use the interrupt triggered on loading last data of frame from memory.
    • INTSYN = 0
    • INTCON = 0
  3. If you want to use the Beginning Of Frame interrupt you need to enable it in the LCDC_LIER register
    • BOF_EN= 1


0 Kudos

700 Views
mkjeldsen
Contributor II

Dear Pedro,

We're getting closer to the heart of the issue:

** REASON FOR EDIT: Display timings seem to be OK, so my question regarding a LVDS TFT controller setup no longer applies. Modified to reflect the real problem we've discovered **

Assumptions:

* VSync (first data of frame mem) and Front Porch (output of last data to panel) interrupt configurations are correct.

* Double-framebuffer setup - requires swapping of framebuffers in LCDC_LSSAR.

The issue:

If i swap my framebuffer immediately after a Vsync, i'm seeing gltiching because data is already being output to the panel. If i instead wait a while before i switch (Perform some drawing operations in the other framebuffer), i can avoid glitching entirely.

My question:

This leads me to think that,:

1) Either our Vsync interrupt is not fired where we expect it to be

2) If 1) is not true, there is some kind of delay after setting LCDC_LSSAR before it takes effect in the LCD controller.

I'd love some comments on 2), in particular.

Thank you in advance! Look forward to your thoughts.

Best regards,

Martin

0 Kudos

700 Views
mkjeldsen
Contributor II

Hi Pedro,

Thanks so much for your reply! From what you're saying, it sounds like my assumptions are correct. Just to be clear, does first data of frame memory mean that we fire an interrupt as soon as we start loading the frame?

If i wanted to make sure all data of a frame was loaded before VSYNC (Or just ensure that all data is loaded before Back Porch begins), what should i do then? I would probably use on last data of frame memory? This requires me to set INCTON/INTSYN = 0 in LCDC_LICR but i can no longer use the Begin of Frame (BOF) flag. Can you explain why that is? I would still expect this to the beginning of the frame (Certainly not EOF).

Put another way - I'm not sure it's clear to me if there is a guarantee that data has finished loading before backporch area has been reached if VSYNC is triggered on first data of frame memory - and if i use on last data of frame memory i'm forced to use an End of Frame setup.

It might be worth mentioning that i've disabled the graphics window entirely and am only using background - I assumed this would be fine.

Look forward to your thoughts,

Thank you in advance.

Best regards,

Martin

0 Kudos