• AVR Freaks

Hot!PWM on dspic33EP512MU810 MCU not working

Author
xyrak
Starting Member
  • Total Posts : 42
  • Reward points : 0
  • Joined: 2016/04/07 23:19:45
  • Location: 0
  • Status: offline
2021/01/29 06:07:40 (permalink)
0

PWM on dspic33EP512MU810 MCU not working

Hello, 
 
 I am struggling to get the independent mode of PWM working on my dSPIC33EP512MU810 MCU. 
 
 I am using the PWM4H/L pins. 
 
My code as per below, Pin configuration seems ok, if I turn those PIN as GPIO, works fine. 
 
Any help would be appreciated. 
 
 
void pwmInit(void)
{
        
    ANSELEbits.ANSE6 = 0;
    ANSELEbits.ANSE7 = 0;
    TRISEbits.TRISE6 = 0;
    TRISEbits.TRISE7 = 0;
    
    PTCONbits.PTEN = 0;
    
    PTPER = 499;
    PTCON2 = 0;
    PHASE4 = 0;
    SPHASE4 = 0;
    PDC4 =5555;
    SDC4 = 5555;
    
    DTR4 = 0;
    IOCON4 = 0x8C00;
    PWMCON4 = 0x00;
    FCLCON4bits.FLTMOD = 3;
  
    
    PTCONbits.PTEN = 1;
}

void main()
{
 pwmInit();
}

 
 
Thanks
RakeshP
#1

1 Reply Related Threads

    xyrak
    Starting Member
    • Total Posts : 42
    • Reward points : 0
    • Joined: 2016/04/07 23:19:45
    • Location: 0
    • Status: offline
    Re: PWM on dspic33EP512MU810 MCU not working 2021/01/30 18:47:28 (permalink)
    0
    It is solved now.. 
    PDC value only reflect if program is running.. it does not latch the value when programmer is halted. 
    #2
    Jump to:
    © 2021 APG vNext Commercial Version 4.5