Hot!LCC - writing to frame buffer while DMA sending data

Author
alex_elec
Starting Member
  • Total Posts : 84
  • Reward points : 0
  • Joined: 2014/03/26 04:41:13
  • Location: UK
  • Status: offline
2018/05/01 04:18:42 (permalink)
0

LCC - writing to frame buffer while DMA sending data

Hi there,
 
Just a quick one, if I have an LCC setup with DMA/PMP on a PIC32MZ outputting display data to an LCD (in DE mode) should I suspend DMA transfers while writing to the frame buffer? Could there be a problem if I was in the middle of writing a pixel and the DMA transfer kicks in?
 
I have a 3.5" QVGA screen, on a PIC32MZ1024EFE100, MPLABXv4.15. I am not using the EBI but instead using my DMA/PMP solution that worked on a PIC32MX
 
Sometimes I see flickering/ghosting while changing what is on screen (I update the frame buffer 4 times a second to handle live readings). See video here: drive.google.com/file/d/1rqVCAZtBp0DgP038wZkAs2xNRIouDsgz/view?usp=sharing
 
Hopefully that link will work, may need copy/paste
 
Any tips appreciated!
Thanks,
Alex
 
#1

7 Replies Related Threads

    alex_elec
    Starting Member
    • Total Posts : 84
    • Reward points : 0
    • Joined: 2014/03/26 04:41:13
    • Location: UK
    • Status: offline
    Re: LCC - writing to frame buffer while DMA sending data 2018/05/01 04:24:18 (permalink)
    0
    Should add, I get around a 50Hz frame rate with a Varitronix T350T2080 display. I am in communication with them as their data sheet is a bit difficult to follow as there isn't concise timing data.
     
    I toggle the data enable line only for the 240 lines of valid data then there are around 40 extra lines for the blanking period. The horizontal blanking is at the end of each line and I clock out 88 pulses here. 
    #2
    NKurzman
    A Guy on the Net
    • Total Posts : 15832
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: offline
    Re: LCC - writing to frame buffer while DMA sending data 2018/05/01 06:07:10 (permalink)
    0
    If you disable the DMA you will see it in the screen. Writing during the DMA should not hurt anything? But may be visible on the screen.
    #3
    alex_elec
    Starting Member
    • Total Posts : 84
    • Reward points : 0
    • Joined: 2014/03/26 04:41:13
    • Location: UK
    • Status: offline
    Re: LCC - writing to frame buffer while DMA sending data 2018/05/01 06:18:39 (permalink)
    0
    Yes that was what I thought, you can write to the buffer at any point. 
     
    have you seen anything like what is in the video I linked to before?
     
    It seems like the timing to the LCD is getting messed up somehow and it seems to start writing to the display on the wrong line almost but then corrects itself on the next frame. 
    #4
    RISC
    Super Member
    • Total Posts : 5114
    • Reward points : 0
    • Status: offline
    Re: LCC - writing to frame buffer while DMA sending data 2018/05/01 07:58:04 (permalink)
    0
    Hi,
     
    You could also reduce frame rate to let's say 30Hz (in a 50Hz environment).
    This should be good enough.
    The latest Arial libraries have double buffer support.
    Maybe this could help if you can afford the RAM space...
    Regards
     
     
    #5
    MHGC
    Super Member
    • Total Posts : 192
    • Reward points : 0
    • Status: offline
    Re: LCC - writing to frame buffer while DMA sending data 2018/05/01 09:40:48 (permalink)
    0
    Hi,

    What are your LCC driver settings?
    Specifically, what is the V-Sync Refresh Strategy?  Conventional or Aggressive?
    If you are using Conventional, you may want to try set Pixel Draw Memory Write Strategy to "In-between Frame & Line Draw".
    #6
    adamfolts
    Super Member
    • Total Posts : 217
    • Reward points : 0
    • Joined: 2010/10/19 08:32:20
    • Location: Prescott
    • Status: offline
    Re: LCC - writing to frame buffer while DMA sending data 2018/05/07 14:35:15 (permalink)
    0
    It could be a PIC32MZ caching issue.
    #7
    alex_elec
    Starting Member
    • Total Posts : 84
    • Reward points : 0
    • Joined: 2014/03/26 04:41:13
    • Location: UK
    • Status: offline
    Re: LCC - writing to frame buffer while DMA sending data 2018/05/17 04:02:03 (permalink)
    0
    I'm running uP at 120MHz
     
    Here is my caching setup code:
     
     

    PRECONbits.PFMWS=1; //Two wait states - for 133-200MHz Clock speeds.
    PRECONbits.PREFEN=3; //Predictive Prefetch Enable bits = 11 = Enable predictive prefetch for any address

    CheckCheKseg0CacheOn(); //This routine is used to enable cacheability of KSEG0.

     
    EDIT: Straight off the bat there might be a problem according to my comment "Two wait states - for 133-200MHz Clock speeds."
     
    2nd EDIT: The comment is wrong, currently set to 1 wait state as correct for 120MHz clock
    post edited by alex_elec - 2018/05/17 04:22:02
    #8
    Jump to:
    © 2018 APG vNext Trial Version 4.5