jlopez2022
Newbie
I used the easy configurator to configure dspic33EP128GM604
I programmed to run FCY=50MHz and checked using the scope.
Then I made following setup using PWM easy mode:
I programmed: 50MHz/16/0x271=5khz that is the stablished PWM base clock
Then in the PWM number 6 I made:
My idea is to write the PWM dty cycle making:
Where percentage6H and L is a float number between 0 and 1
Unfortunately it does not work. There are a lot of examples of code but writting directly the registers
I programmed to run FCY=50MHz and checked using the scope.
Then I made following setup using PWM easy mode:
I programmed: 50MHz/16/0x271=5khz that is the stablished PWM base clock
Then in the PWM number 6 I made:
My idea is to write the PWM dty cycle making:
Code:
PDC6=(uint16_t) (percentage6H*0x271);//6H
SDC6=(uint16_t) (percentage6L*0x271);//6L
Where percentage6H and L is a float number between 0 and 1
Unfortunately it does not work. There are a lot of examples of code but writting directly the registers