cancel
Showing results for 
Search instead for 
Did you mean: 

MCOMP - MTIM - MPRSR

daveevans9
Associate II
Posted on May 16, 2005 at 10:42

MCOMP - MTIM - MPRSR

3 REPLIES 3
daveevans9
Associate II
Posted on May 17, 2011 at 10:18

Hi All,

Can any one explain how to compute numbers for MCOMP.

I know these number relates to MTIM via the prescalar (MPRSR) but no matter which way I try I can not compute the same numbers that are in the 'Table 40. Step Frequency/Period Range (4MHz)'.

TIA

DaveE

[ This message was edited by: DaveE on 13-05-2005 14:25 ]

gaetano
Associate II
Posted on May 17, 2011 at 10:18

Hello,

with reference to figure 121 on the ST7MC datasheet, we can assume that:

Fmtc = Fperiph = 4MHz (as you stated)

So when the 'ratio' is equal to '0' the maximum frequency at the input of MTIM timer is equal to 2MHz (as there is a further block dividing by 2 the Fperiph frequency).

Then, the maximum Step frequency is get through:

2MHz / 55h = 23529 Hz (that is, inverting, a minimum step period of 42.5us)

where:

55h is the minimum value that MTIM timer can assume before the 'ratio' is automatically decremented by 1

The mimimum step frequency is:

2MHz/ FFh = 7843 Hz (that is, inverting, a maximum step period of 127.5us)

These are the values assuming 'ratio' equal to 0. The other values in table can be got by assuming 'ratio' from 0 up to 15.

Let me know if I was clear or not...

Regards,

Tanio

daveevans9
Associate II
Posted on May 17, 2011 at 10:18

That explains it perfectly. 🙂

Thanks

DaveE