I'm trying to use the PWM of the ATSAMC21E18A
. Although, no matter the parameters I set with the function "pwm_set_parameters"; the duty cycle stays at 99%.
I even try to build an easier project, which I created by https://start.atmel.com/. I only added the PWM driver and I have written a simple main:
int main(void)
{
/* Initializes MCU, drivers and middleware */
atmel_start_init();
pwm_set_parameters(&PWM_0, 1000, 500);
pwm_enable(&PWM_0);
/* Replace with your application code */
while (1) {
}
}
But the result is the same: the output signal has a duty cycle of 99%. I have made many hardware tests and it doesn't seem to be the problem. Did I forget to initialize something?