Hot!LCD flickering/dropped frames LCC PIC32MZ1024EFE

Author
alex_elec
Starting Member
  • Total Posts : 72
  • Reward points : 0
  • Joined: 2014/03/26 04:41:13
  • Location: UK
  • Status: offline
2017/09/13 03:53:07 (permalink)
0

LCD flickering/dropped frames LCC PIC32MZ1024EFE

Hi guys,
 
I've posted here a few times with a project I'm working on. We have a PIC32MZ1024EFE design driving a controllerless LCD via DMA & PMP. I'm not using harmony, I pretty much wrote my own as I didn't want to use microchip library code.
 
We had to make some changes to the design and now have the PCBs in but I've found the LCD has developed an issue. It seems to be dropping frames and flickering! Checking the signals, my frame rate is bang on 62.5Hz and this hardly moves around so I don't think it is software related. The DMA handler has the highest priority 
 
Please see video (it doesn't capture it amazingly well but you get the idea, random lines and screen ghosting? Mostly in 2nd half of vid):
https://drive.google.com/...EtSjA/view?usp=sharing
 
 
Could this be EMC interference of any kind? We moved some things around on the PCB but tried to keep the LCD tracks short, the 16 colour data lines going to the LCD have 10R resistors to help reduce emissions but these were on our older design which didn't flicker at all. 
 
The other thing my colleague suggested was supply issues, I've had a scope on the 3v3 rail and it doesn't seem to be moving around but I'll keep investigating
 
Just wondered if anyone had seen something similar with controllerless LCDs and PIC32!
 
Cheers
#1

8 Replies Related Threads

    NKurzman
    A Guy on the Net
    • Total Posts : 14679
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: online
    Re: LCD flickering/dropped frames LCC PIC32MZ1024EFE 2017/09/13 06:34:57 (permalink)
    0
    Is your frame buffer declared coherent?
    #2
    alex_elec
    Starting Member
    • Total Posts : 72
    • Reward points : 0
    • Joined: 2014/03/26 04:41:13
    • Location: UK
    • Status: offline
    Re: LCD flickering/dropped frames LCC PIC32MZ1024EFE 2017/09/13 07:08:05 (permalink)
    3 (1)
    Hi, 
    yes it is:
    unsigned short int __attribute__((coherent)) GraphicsFrame[BLANKING_PERIOD][LINE_LENGTH];

     
    Does anyone have any guidance when it comes to interrupt priorities for such a task? I've been playing around with them and setting everything to the same level (level 1) has improved things slightly. 
     
    This is my DMA interrupt handler prototype:
    void __attribute__((vector(_DMA1_VECTOR), interrupt(IPL1AUTO), optimize("-fno-shrink-wrap"), nomicromips)) DmaHandler1(void)

     
    I am using DMA/PMP & timer 5 for driving the LCD, Timers 2, 3, 4 & 6 for measurements and multi-use timers, 1 UART interrupt, 1 Output Compare for PWM pump control and change notification interrupts for key presses. 
     
     
    #3
    NKurzman
    A Guy on the Net
    • Total Posts : 14679
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: online
    Re: LCD flickering/dropped frames LCC PIC32MZ1024EFE 2017/09/13 07:21:45 (permalink)
    0
    It should be the highest priority.
    Level 7
    #4
    alex_elec
    Starting Member
    • Total Posts : 72
    • Reward points : 0
    • Joined: 2014/03/26 04:41:13
    • Location: UK
    • Status: offline
    Re: LCD flickering/dropped frames LCC PIC32MZ1024EFE 2017/09/13 07:22:57 (permalink)
    0
    So set DMA/PMP & Timer 5 Level 7? Should I have them on different subpriorities?
    #5
    NKurzman
    A Guy on the Net
    • Total Posts : 14679
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: online
    Re: LCD flickering/dropped frames LCC PIC32MZ1024EFE 2017/09/13 08:15:10 (permalink)
    3 (1)
    Only if one needs a higher priority.
    Did you Look at the MLA examples?
    The Harmony 1.XX example had issues with failure of the Interrupt to repeat.  But I never saw blinking.
    #6
    maxruben
    Super Member
    • Total Posts : 3072
    • Reward points : 0
    • Joined: 2011/02/22 03:35:11
    • Location: Sweden
    • Status: offline
    Re: LCD flickering/dropped frames LCC PIC32MZ1024EFE 2017/09/13 14:15:14 (permalink)
    3 (1)
    Are you using atomic instructions to clear interrupt flags?
     
    /Ruben
    #7
    alex_elec
    Starting Member
    • Total Posts : 72
    • Reward points : 0
    • Joined: 2014/03/26 04:41:13
    • Location: UK
    • Status: offline
    Re: LCD flickering/dropped frames LCC PIC32MZ1024EFE 2017/09/14 01:10:46 (permalink)
    3 (1)
    Ah, 
     
    This is how I clear my DMA interrupt flags: 
     
    DCH1INTbits.CHBCIF=0; // clear interrupt flag
    IFS4bits.DMA1IF=0; // clear interrupt flag

     
    And timer flags:
     
    IFS0bits.T6IF = False; //reset interrupt flag
    IFS0bits.T2IF = False; //reset interrupt flag

     
    I should be using the following instead?
    IFS0CLR = _IFS0_T1IF_MASK;

    #8
    maxruben
    Super Member
    • Total Posts : 3072
    • Reward points : 0
    • Joined: 2011/02/22 03:35:11
    • Location: Sweden
    • Status: offline
    Re: LCD flickering/dropped frames LCC PIC32MZ1024EFE 2017/09/14 02:39:52 (permalink)
    3.67 (3)
    Yes, otherwise you could miss interrupts or run them twice for interrupt flags that share the same register due to read-modify-write.
     
    /Ruben 
    #9
    Jump to:
    © 2017 APG vNext Commercial Version 4.5