EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

performance calculation

Started by Johannes Findorf April 6, 2005
Hi

I have a filter (Goertzel algorithm) that I like to add to some
samples from my ADC. I'm trying to look into what clock freq my MSP
need to be able to preforme the filter before next set of samples arrive.
Does someone have a link to a resource where I can lookup how many
cycles are needed for some given operation. 

The adc makes 80 samples each 10ms, the filter have about 4000 operations.

Best regards.

Johannes Findorf




Beginning Microcontrollers with the MSP430

IAR's C-Spy debugger has a cycle counter (in the Register's
window). You can
use it in a simulation mode and, using break points, carefully run your
filter once, getting how many cycles were used from that counter.
Don't know if other tools have similar feature.

-Augusto


-----Original Message-----
From: Johannes Findorf [mailto:johannes@joha...] 
Sent: Wednesday, April 06, 2005 10:16 AM
To: msp430@msp4...
Subject: [msp430] performance calculation




Hi

I have a filter (Goertzel algorithm) that I like to add to some samples from
my ADC. I'm trying to look into what clock freq my MSP need to be able to
preforme the filter before next set of samples arrive. Does someone have a
link to a resource where I can lookup how many cycles are needed for some
given operation. 

The adc makes 80 samples each 10ms, the filter have about 4000 operations.

Best regards.

Johannes Findorf





.

 
Yahoo! Groups Links



 




-- 
Internal Virus Database is out-of-date.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.8.5 - Release Date: 29/3/2005
 


Thx Augusto, I will look at that feature when I have implemented my
filter, the problem is that I have skided that part till next week.
I just need an approximation, shall I use 4MHz or shall I go up to
8MHz (I think that 4MHz is enough, but I dont want to be delayed by
some small preformance problems).
So still, any datasheet that tells how many cycles needed to preforme ?


.johannes

--- In msp430@msp4..., "augusto einsfeldt" <aee@t...> wrote:
> IAR's C-Spy debugger has a cycle counter (in
the Register's window).
You can
> use it in a simulation mode and, using break
points, carefully run your
> filter once, getting how many cycles were used from that counter.
> Don't know if other tools have similar feature.
> 
> -Augusto
> 
> 
> -----Original Message-----
> From: Johannes Findorf [mailto:johannes@f...] 
> Sent: Wednesday, April 06, 2005 10:16 AM
> To: msp430@msp4...
> Subject: [msp430] performance calculation
> 
> 
> 
> 
> Hi
> 
> I have a filter (Goertzel algorithm) that I like to add to some
samples from
> my ADC. I'm trying to look into what clock
freq my MSP need to be
able to
> preforme the filter before next set of samples
arrive. Does someone
have a
> link to a resource where I can lookup how many
cycles are needed for
some
> given operation. 
> 
> The adc makes 80 samples each 10ms, the filter have about 4000
operations.
> 
> Best regards.
> 
> Johannes Findorf
> 
> 
> 
> 
> 
> .
> 
>  
> Yahoo! Groups Links
> 
> 
> 
>  
> 
> 
> 
> 
> -- 
> Internal Virus Database is out-of-date.
> Checked by AVG Anti-Virus.
> Version: 7.0.308 / Virus Database: 266.8.5 - Release Date: 29/3/2005




Augusto,

am I missing something or it works only in single stepping mode?

Cheers,
br1

-----Messaggio Originale----- 
Da: "augusto einsfeldt" <aee@aee@...>
A: <msp430@msp4...>
Data invio: mercoledi 6 aprile 2005 15.30
Oggetto: RE: [msp430] performance calculation


>
> IAR's C-Spy debugger has a cycle counter (in the Register's
window). You 
> can
> use it in a simulation mode and, using break points, carefully run your
> filter once, getting how many cycles were used from that counter.
> Don't know if other tools have similar feature.
>
> -Augusto

Johannes,
You can do it manually using the ASM code (some C compilers produce an ASM
version as output) and counting instruction cycles by hand. Maybe outhere is
a tool to help you automate this. 
People in this list, closelly related to tools, may help you better.
At TI's web site you can download the user's guide for your selected
CPU and
have a look in the instruction set section. There you find how many cycles
are used for each instruction type. Again, it is only in assembler and you
have to have an ASM version of your software to do this.
-Augusto


-----Original Message-----
From: Johannes Findorf [mailto:johannes@joha...] 
Sent: Wednesday, April 06, 2005 10:40 AM
To: msp430@msp4...
Subject: [msp430] Re: performance calculation




Thx Augusto, I will look at that feature when I have implemented my filter,
the problem is that I have skided that part till next week. I just need an
approximation, shall I use 4MHz or shall I go up to 8MHz (I think that 4MHz
is enough, but I dont want to be delayed by some small preformance
problems). So still, any datasheet that tells how many cycles needed to
preforme ?


.johannes

--- In msp430@msp4..., "augusto einsfeldt" <aee@t...> wrote:
> IAR's C-Spy debugger has a cycle counter (in
the Register's window).
You can
> use it in a simulation mode and, using break
points, carefully run 
> your filter once, getting how many cycles were used from that counter. 
> Don't know if other tools have similar feature.
> 
> -Augusto
> 
> 
> -----Original Message-----
> From: Johannes Findorf [mailto:johannes@f...]
> Sent: Wednesday, April 06, 2005 10:16 AM
> To: msp430@msp4...
> Subject: [msp430] performance calculation
> 
> 
> 
> 
> Hi
> 
> I have a filter (Goertzel algorithm) that I like to add to some
samples from
> my ADC. I'm trying to look into what clock
freq my MSP need to be
able to
> preforme the filter before next set of samples
arrive. Does someone
have a
> link to a resource where I can lookup how many
cycles are needed for
some
> given operation.
> 
> The adc makes 80 samples each 10ms, the filter have about 4000
operations.
> 
> Best regards.
> 
> Johannes Findorf
> 
> 
> 
> 
> 
> .
> 
>  
> Yahoo! Groups Links
> 
> 
> 
>  
> 
> 
> 
> 
> --
> Internal Virus Database is out-of-date.
> Checked by AVG Anti-Virus.
> Version: 7.0.308 / Virus Database: 266.8.5 - Release Date: 29/3/2005





.

 
Yahoo! Groups Links



 




-- 
Internal Virus Database is out-of-date.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.8.5 - Release Date: 29/3/2005
 


No, you can set a breakpoint in the end of your code, run it free and
subtract the total cycle counter from the value you had in the beggining of
the code.
Of course you cannot have ISR handlings during the execution or your end
counting will be different.
-Augusto




-----Original Message-----
From: Bruno Galli [mailto:bruno.galli@brun...] 
Sent: Wednesday, April 06, 2005 10:40 AM
To: msp430@msp4...
Subject: Re: [msp430] performance calculation



Augusto,

am I missing something or it works only in single stepping mode?

Cheers,
br1

-----Messaggio Originale----- 
Da: "augusto einsfeldt" <aee@aee@...>
A: <msp430@msp4...>
Data invio: mercoledi 6 aprile 2005 15.30
Oggetto: RE: [msp430] performance calculation


>
> IAR's C-Spy debugger has a cycle counter (in the Register's
window). 
> You
> can
> use it in a simulation mode and, using break points, carefully run your
> filter once, getting how many cycles were used from that counter.
> Don't know if other tools have similar feature.
>
> -Augusto


.

 
Yahoo! Groups Links



 




-- 
Internal Virus Database is out-of-date.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.8.5 - Release Date: 29/3/2005
 


If I read this right you take 80 samples every 10ms. Or 8 samples per 
msec, ie a standard 8kHz sample rate. Thus, assuming you need to operate 
on 80 samples at a time, and assuming a mean of 4 clock cycles per 
instruction, you need 16,000 instruction cycles in 10msecs, or a minimum 
1.6Mhz clock.

Al

Johannes Findorf wrote:

>Hi
>
>I have a filter (Goertzel algorithm) that I like to add to some
>samples from my ADC. I'm trying to look into what clock freq my MSP
>need to be able to preforme the filter before next set of samples arrive.
>Does someone have a link to a resource where I can lookup how many
>cycles are needed for some given operation. 
>
>The adc makes 80 samples each 10ms, the filter have about 4000 operations.
>
>Best regards.
>
>Johannes Findorf
>
>
>
>
>
>.
>
> 
>Yahoo! Groups Links
>
>
>
> 
>
>
>
>
>
>  
>


You can do the same thing in real code:-

ROUTINE START:
       CLR      &OVERFLOW
       MOV   &TBR  ,&LOWCOUNT
    ...
    ...
ROUTINE END:
       MOV   &TBR,&HIGHCOUNT

Simply enable Timer overflwo interrupts and increment a counter. Of 
course the real fun way is to sit and count cycles in code, remembering 
to accounbt for Constant generator use, emulated instructions etc etc.

Al

augusto einsfeldt wrote:

>No, you can set a breakpoint in the end of your
code, run it free and
>subtract the total cycle counter from the value you had in the beggining of
>the code.
>Of course you cannot have ISR handlings during the execution or your end
>counting will be different.
>-Augusto
>
>
>
>
>-----Original Message-----
>From: Bruno Galli [mailto:bruno.galli@brun...] 
>Sent: Wednesday, April 06, 2005 10:40 AM
>To: msp430@msp4...
>Subject: Re: [msp430] performance calculation
>
>
>
>Augusto,
>
>am I missing something or it works only in single stepping mode?
>
>Cheers,
>br1
>
>-----Messaggio Originale----- 
>Da: "augusto einsfeldt" <aee@aee@...>
>A: <msp430@msp4...>
>Data invio: mercoledi 6 aprile 2005 15.30
>Oggetto: RE: [msp430] performance calculation
>
>
>  
>
>>IAR's C-Spy debugger has a cycle counter (in the Register's
window). 
>>You
>>can
>>use it in a simulation mode and, using break points, carefully run your
>>filter once, getting how many cycles were used from that counter.
>>Don't know if other tools have similar feature.
>>
>>-Augusto
>>    
>>
>
>
>.
>
> 
>Yahoo! Groups Links
>
>
>
> 
>
>
>
>
>  
>


Johannes,
Is there a simple Goertzel implementation using integers? I have failed
trying a translation using simple fixed point integer (in order to implement
a faster solution for MSP).
-Augusto


-----Original Message-----
From: Johannes Findorf [mailto:johannes@joha...] 
Sent: Wednesday, April 06, 2005 10:40 AM
To: msp430@msp4...
Subject: [msp430] Re: performance calculation




Thx Augusto, I will look at that feature when I have implemented my filter,
the problem is that I have skided that part till next week. I just need an
approximation, shall I use 4MHz or shall I go up to 8MHz (I think that 4MHz
is enough, but I dont want to be delayed by some small preformance
problems). So still, any datasheet that tells how many cycles needed to
preforme ?


.johannes

--- In msp430@msp4..., "augusto einsfeldt" <aee@t...> wrote:
> IAR's C-Spy debugger has a cycle counter (in
the Register's window).
You can
> use it in a simulation mode and, using break
points, carefully run 
> your filter once, getting how many cycles were used from that counter. 
> Don't know if other tools have similar feature.
> 
> -Augusto
> 
> 
> -----Original Message-----
> From: Johannes Findorf [mailto:johannes@f...]
> Sent: Wednesday, April 06, 2005 10:16 AM
> To: msp430@msp4...
> Subject: [msp430] performance calculation
> 
> 
> 
> 
> Hi
> 
> I have a filter (Goertzel algorithm) that I like to add to some
samples from
> my ADC. I'm trying to look into what clock
freq my MSP need to be
able to
> preforme the filter before next set of samples
arrive. Does someone
have a
> link to a resource where I can lookup how many
cycles are needed for
some
> given operation.
> 
> The adc makes 80 samples each 10ms, the filter have about 4000
operations.
> 
> Best regards.
> 
> Johannes Findorf
> 
> 
> 
> 
> 
> .
> 
>  
> Yahoo! Groups Links
> 
> 
> 
>  
> 
> 
> 
> 
> --
> Internal Virus Database is out-of-date.
> Checked by AVG Anti-Virus.
> Version: 7.0.308 / Virus Database: 266.8.5 - Release Date: 29/3/2005





.

 
Yahoo! Groups Links



 




-- 
Internal Virus Database is out-of-date.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.8.5 - Release Date: 29/3/2005
 


This articel from Embedded.com gives a realy good intro to the
algoritm: http://www.embedded.com/showArticle.jhtml?articleID00722

There are also some sample code that I migth use to get an
approximation on the cycle use.

It also introduces an simplified algoritm that can be used when you
dont need to know anything about the phase of the signal.

.johannes


--- In msp430@msp4..., "augusto einsfeldt" <aee@t...> wrote:
> Johannes,
> Is there a simple Goertzel implementation using integers? I have failed
> trying a translation using simple fixed point integer (in order to
implement
> a faster solution for MSP).
> -Augusto
> 
> 
> -----Original Message-----
> From: Johannes Findorf [mailto:johannes@f...] 
> Sent: Wednesday, April 06, 2005 10:40 AM
> To: msp430@msp4...
> Subject: [msp430] Re: performance calculation
> 
> 
> 
> 
> Thx Augusto, I will look at that feature when I have implemented my
filter,
> the problem is that I have skided that part till
next week. I just
need an
> approximation, shall I use 4MHz or shall I go up
to 8MHz (I think
that 4MHz
> is enough, but I dont want to be delayed by some
small preformance
> problems). So still, any datasheet that tells how many cycles needed to
> preforme ?
> 
> 
> .johannes
> 
> --- In msp430@msp4..., "augusto einsfeldt" <aee@t...>
wrote:
> > IAR's C-Spy debugger has a cycle counter (in the Register's
window).
> You can
> > use it in a simulation mode and, using break points, carefully run 
> > your filter once, getting how many cycles were used from that
counter. 
> > Don't know if other tools have similar
feature.
> > 
> > -Augusto
> > 
> > 
> > -----Original Message-----
> > From: Johannes Findorf [mailto:johannes@f...]
> > Sent: Wednesday, April 06, 2005 10:16 AM
> > To: msp430@msp4...
> > Subject: [msp430] performance calculation
> > 
> > 
> > 
> > 
> > Hi
> > 
> > I have a filter (Goertzel algorithm) that I like to add to some
> samples from
> > my ADC. I'm trying to look into what clock freq my MSP need to be
> able to
> > preforme the filter before next set of samples arrive. Does someone
> have a
> > link to a resource where I can lookup how many cycles are needed for
> some
> > given operation.
> > 
> > The adc makes 80 samples each 10ms, the filter have about 4000
> operations.
> > 
> > Best regards.
> > 
> > Johannes Findorf
> > 
> > 
> > 
> > 
> > 
> > .
> > 
> >  
> > Yahoo! Groups Links
> > 
> > 
> > 
> >  
> > 
> > 
> > 
> > 
> > --
> > Internal Virus Database is out-of-date.
> > Checked by AVG Anti-Virus.
> > Version: 7.0.308 / Virus Database: 266.8.5 - Release Date: 29/3/2005
> 
> 
> 
> 
> 
> .
> 
>  
> Yahoo! Groups Links
> 
> 
> 
>  
> 
> 
> 
> 
> -- 
> Internal Virus Database is out-of-date.
> Checked by AVG Anti-Virus.
> Version: 7.0.308 / Virus Database: 266.8.5 - Release Date: 29/3/2005





The 2024 Embedded Online Conference