Page 1 of 1

SAM71Q21 clock selection for peripheral TC5

Posted: Fri Sep 11, 2015 11:15 am
by sleven79
Hi !

I currently discover the SAMV7 XPlained Ultra board. In SAMV71Q21, I tried to configure the clock for the TC5 counter peripheral (PID 28).

I would like to use MCK/2 for TC5. According to the datasheet, MCK/2 can be programmed in the PMC.

What I tried is, while TC5 peripheral is unclocked (unpowered, PMC->PMC_PCSR0 bit 28 is 0):

PMC->PMC_PCR = PMC_PCR_PERIPH_DIV2_MCK | PMC_PCR_CMD | ID_TC5;

However, after writing to PMC_PCR, the clock for peripheral TC5 still seems to be MCK, and does not switch to MCK/2.

Can anyone help me explain this and give me a hint how I can correctly configure MCK/2 in PMC for peripheral TC5?

Thanks,
Severin

Re: SAM71Q21 clock selection for peripheral TC5

Posted: Fri Sep 11, 2015 1:20 pm
by ybp
Hello Severin,


The datasheets needs to be updated. The PCK feature is not available in SAM V71. You cannot generate a MCK divided clock using the same..

regards,
ybp

Re: SAM71Q21 clock selection for peripheral TC5

Posted: Fri Sep 11, 2015 3:59 pm
by sleven79
Thanks ybp,

indeed, the datasheet of the SAMV71 I have says "Preliminary Datasheet".

So, to scale the clock of TC5, I will directly use the TCCLKS bits in TC1->TC_CMR2 (for timer channel TC5). That works.

This enables using either MCK/8, MCK/32, MCK/128, SCLK, or PCK6 as clock source, assuming the datasheet is correct here. In any case, I will measure the result.

I hope an updated datasheet becomes available soon.

Thanks,
Severin