[riot-devel] RIOT and Peripherals

Peter Kietzmann peter.kietzmann at haw-hamburg.de
Wed Dec 21 17:17:39 CET 2016


Hi Ilias,

I don't know details about the PWM clock generation on this
microcontroller *but* "TCC_CLOCK_PRESCALER_DIV1" means "no division of
the source clock". That will be the case when (compare [1]):

CLOCK_CORECLOCK / (freq * res) = 1 .

Calling the function like this: get_prescaler(1, &scale), returns 0
(same value as TCC_CTRLA_PRESCALER_DIV1_Val) resulting in no prescaler
selection here [2]. That's why I assume the feature you want should be
already there, or am I mistaken?

In case you convince me of the contrary :-), there's nothing against
improving the peripheral driver implementation.

Best regards
Peter


[1] https://github.com/RIOT-OS/RIOT/blob/master/cpu/samd21/periph/pwm.c#L101
[2] https://github.com/RIOT-OS/RIOT/blob/master/cpu/samd21/periph/pwm.c#L137


Am 12.12.2016 um 14:41 schrieb Ilias Seitanidis:
> Dear all,
> 
> I would like a small explanation of the value
> "TCC_CTRLA_PRESCALER_DIV*_VAL" in line 84 in [1], is it possible to add the
> equivelant value of the "TC_CLOCK_PRESCALER_DIV1"(as found from the atmel
> studio).
> 
> Thank you in advance!
> 
> Best regards,
> 
> Ilias
> 
> [1] https://github.com/RIOT-OS/RIOT/blob/master/cpu/samd21/periph/pwm.c .
> 
> 
> 
> _______________________________________________
> devel mailing list
> devel at riot-os.org
> https://lists.riot-os.org/mailman/listinfo/devel
> 

-- 
Peter Kietzmann

Hamburg University of Applied Sciences
Dept. Informatik, Internet Technologies Group
Berliner Tor 7, 20099 Hamburg, Germany
Fon: +49-40-42875-8426
Web: http://www.haw-hamburg.de/inet


More information about the devel mailing list