Hi guys, thank you for all your answers
I figured that the period should ofc be higher than the DC, but this is still not working. .
By including the period register the code looks like this:
OSCCON = 0b11110000;
TRISA = 0b00000000;
PWM1CLKCON = 0b00000000;
PWM1PRH = 0b11111111; /Period high bit
PWM1PRL = 0b11111111; /Period low bit
PWM1DCH = 0b00000001; /DC high bit
PWM1DCL = 0b00000000; /DC low bit
PWM1CON = 0b11100000;
The period here is set to max, and it will work with changing the low bit to 0b11111000, but if I go any lower, the PWM flatlines.
The DC here is set pretty low, so it should always be lower than the period.
This seems pretty odd to me. .