cancel
Showing results for 
Search instead for 
Did you mean: 

eMIOS overflow callback and frequency range

aurelien23
Senior
Posted on October 19, 2015 at 12:20

Hello,

when I was working on SPC56EL with older SPC5 Studio versions, the overflow callback was called only when the internal counter was overflowing. This was perfect to detect too low frequency which can't be measured.

On SPC564B and SPC5 Studio V3.7, the driver is reworked compared to older versions and the overlow callback is now called all the time, when edges are detected on the input.

Can you please confirm this bug or new behaviour...

Second problem is the frequency range: I have to measure frequencies between 4Hz and 5kHz on different channels with 1Hz resolution. Since the eMIOS clock is the same for all channel, how could I achieve that?

I actually use a clock of 120MHz/2/256=234375 Hz. It allows period measurement down to 3.5Hz with high precision. But at 5kHz, the counter reaches 234375 / 5000 = 46 and this corresponds to 234375 / 46 = 5095 Hz which is far away from 5000Hz.

To be able to reach 1Hz resolution on other micros, I usually have two methods. The edge detection for low frequencies only. For high frequencies, I'm using a timer that counts all edges during a fix period of time determined by another timer.
This discussion has been locked for participation. If you have a question, please start a new topic in order to ask your question
6 REPLIES 6
Erwan YVIN
ST Employee
Posted on October 20, 2015 at 17:14

Hello Aurelien ,

the driver is coming from SPC5-HAL sourceforge repository :

https://sourceforge.net/projects/spc5-hal/?source=directory

within different version of SPC5STudio, we are putting a SVN Tags.

there are some few differences on eMIOS drivers

trunk\_code\hal\platforms\SPC5xx.

 

(cf svn logs)

 

 

for your problem, i am checking with eMIOS experts.

   Best regards

                   Erwan

aurelien23
Senior
Posted on October 26, 2015 at 12:10

Hello,

any news from eMIOS experts? The HAL changed a lot between my 2 developpement but the fact is that with the ''previous'' version the overflow callback was functionnal.
Erwan YVIN
ST Employee
Posted on November 05, 2015 at 11:44

Hello Aurelien ,

i am back sorry for the delay

could you increase eTimerX priority for eMIOS ?

you should check icu_lld.c / icu_lld.h.

2 revisions in 2015

Revision: 1142

Author: lzambrano

Date: mercredi 23 septembre 2015 11:11:22

Message:

Modifications to fix the ticket ER328822.

----

Revision: 890

Author: lzambrano

Date: jeudi 12 février 2015 15:20:43

Message:

Modify the Velvety clock tree and add the eTimer support for Velvety

         Best Regards

                             Erwan

Erwan YVIN
ST Employee
Posted on November 05, 2015 at 14:45

Sorry Aurelien ,

I was on EL Side not B Side.

for B Devices,

for icu_lld.*

there is no update in 2015

could you give us your configuration ?

(by email if you want)

    Best Regards

                 Erwan

Erwan YVIN
ST Employee
Posted on November 06, 2015 at 09:45

Hello Aurelien ,

You can use Input Period Measurement.

(Type G Channel and Type H channel)

(Cf reference manual)

Did you try this ?

Best regards

Erwan

________________

Attachments :

2015-11-06_093707.png : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006qWcj&d=%2Fa%2F0X0000000boQ%2FaUtL6BhoAiJ_afecnAv4HJt9JrhnaB8lxE05Usy7Sc0&asPdf=false
aurelien23
Senior
Posted on November 19, 2015 at 15:35

Hello Erwan,

I sent you my configuration.xml on the 9th of Nov. by mail. All my freq inputs are mapped to IPM compatible pins (type G and H). I confirm that the overflow callback was working on EL and that on B the behavior changed.

Regarding my second problem, the frequency range, like I mentioned in the forum, I actually use a clock of 120MHz/2/256=234375 Hz to clock both eMIOS. It allows period measurement down to 3.5Hz with high precision. But at 5kHz, the counter reaches 234375 / 5000 = 46 and this corresponds to 234375 / 46 = 5095 Hz which is 95 Hz away from 5000Hz.

To be able to reach 1Hz resolution on other micros, I usually have 3 methods.

- Low freq: counting the time between edges based on edge detection (the one used by IPM).

- High freq (>1kHz): a timer that counts all edges during a fix period of time determined by another timer.

- Universal method: a mix of that, it counts the time of 16 periods.

How could I achieve this last method using IPM inputs?

If it’s not possible I will try to increase the eMIOS clock to 60MHz allowing to measure frequency higher than 60000000 / 65535 = 916 only…

I would like to be more flexible using my methods.

Thank you for helping!