cancel
Showing results for 
Search instead for 
Did you mean: 

Question On PCA Clock Formula

davidm
Associate II
Posted on May 22, 2009 at 10:56

Question On PCA Clock Formula

2 REPLIES 2
davidm
Associate II
Posted on May 17, 2011 at 11:52

Seems to me the uPSD3400 data sheet gives the wrong formula for

the PCA clock when using Fosc as the source.

The formula is shown as:-

Fpca = Fosc / ( 2^PCAxPS[3:0] )

whereas it seems to be:-

Fpca = Fosc / ( 256 * 2^PCAxPS[3:0] )

That is, a factor of 256 lower. Could ST support confirm this?

I've not seen errata notes discussing this.

tim5
Associate II
Posted on May 17, 2011 at 11:52

OK, it's an old post, but I was just checking this, so...

The ST formula is for the clock *input* to the PCA counter. So if you are using a PWM mode, the *output* on the pin will be this divided by the counter range, which as you say is 256 if you use 8-bit mode.

So I've got a 20MHz crystal, and I've got the PCA in 8-bit fixed frequency PWM mode with unity prescaler, and my PWM output reads as 78kHz, which is 20MHz divided by the 8-bit counter length, ie 256.