Stuck creating PWM on dsPic33fj128GP306A

Discussion in 'Embedded Systems and Microcontrollers' started by jens09, Oct 2, 2013.

  1. jens09

    Thread Starter New Member

    Oct 2, 2013
    1
    0
    hey,

    I must create a PWM on a dsPIC33fj128GP306A with MPLab X c16 compiler.

    my config bits are:
    Code ( (Unknown Language)):
    1.  
    2. _FOSCSEL(FNOSC_FRC) //set clock for internal OSC with PLL
    3. _FOSC(FCKSM_CSECMD & OSCIOFNC_ON & POSCMD_NONE) //no clock output, external OSC disabled
    4. _FWDT(FWDTEN_OFF) //disable the watchdog timer
    5. _FPOR(FPWRT_PWR128)
    6. _FICD(JTAGEN_OFF & ICS_PGD2); //disable JTAG, enable debugging on PGx2 pins
    7.  
    The code that I use for initializing the output compares and how I set the duty cycle can be seen in the attachment.

    The voltage at the connectors for the electromoters remains 0V. Anyone sees what I am doing wrong?

    Thx in advance,

    Jens
     
Loading...