I feel really stupid not being able to make this work.
I am using XC8 compiler, inside MPLAB.
I am using the Microchip Code Configurator.
My problem is, that i can get the PWM to start, and i can change its initial value by modifying the registers in the initialization file pwm.c
But, when I put the following into my while...
Pic PWM programming in C, cant figure out how to change the duty cycle
I am using XC8 compiler, inside MPLAB.
I am using the Microchip Code Configurator.
My problem is, that i can get the PWM to start, and i can change its initial value by modifying the registers in the initialization file pwm.c
Code (Text):
- //PWM1DCH 0;
- PWM1DCH = 0x00;
- //PWM1DCL 200;
- PWM1DCL = 200;
- //PWM1PRH 0;
- PWM1PRH = 0x00;
- //PWM1PRL 255;
- PWM1PRL = 0xFF;
Pic PWM programming in C, cant figure out how to change the duty cycle