Hi Guys and ladies,
i am really new in the ARM Topic and the HAL Driver allready broke my head :-D Not yet but it will.
I want do use the PWM driver to generate a single shot PWM signal. The next step will be to build an Bit banging Signal to controll WS2812b LEDs.
I used an SAMD10 with the internal 8MHz CLK, for the first steps I configure the CPU CLK to 8MHz and the Timer TC2 CLK to 1MHz.
For the moment it#s not interesting, if the project will work an 8MHz, because I can use an external CLK to speed this up.
I used an Callback like this:
void pwmPeriodCallback(const struct pwm_descriptor *const descr)
/* Initializes MCU, drivers and middleware */
NVIC_EnableIRQ(TC2_IRQn); // Enable ISR
pwm_register_callback(&PWM_0, PWM_PERIOD_CB, pwmPeriodCallback); // link the disable function
// pwm settings
pwm_set_parameters(&PWM_0, 999, 640);
//wait until callbacks kill enable Bit
/* Replace with your application code */
The callback happend, but then on the Signal WO a small peak comes up lik this:
Signal WO at the top and on the bottom Signal WO of the TC2 Driver.
I set up the hole project with the HAL driver, only the Clear funtion of the Enable PWM is from the hri function. Because i tryed to check if the problem comes from the high level programming.
Can somebody of you explain me, what the happend there ?
Is it possible to drive a signle shot method ?
Or should i use a timer and make really root bit banging per GPIO Pin ?
Thanks in advanced !!