Sign in

username:

password:



Not a member?

Search c6x



Search tips

Subscribe to c6x



c6x by Keywords

AD535 | BIOS | Booting | Bootloader | C621 | C6211 | C6415 | C671 | C6711 | C6711DSK | C6713 | CCS | Chassaing | COFF | DAT | DM64 | DM642 | DMA | DSK671 | DSK6711 | EDM | EDMA | EMIF | Emulator | EVM | EVM620 | FFT | FIR | GPIO | Halting | HPI | HWI | IDK | JTAG | LDB | LDH | LDW | Linker | LMS | LOG_printf | Matlab | McBSP | MEM_alloc | MIPS | PCI | PCM3003 | Pipeline | Profiling | QDM | Reset | ROM | RTDX | Sampling | SDRAM | Stack | TEB | THS1206 | TMS320C621 | TMS320C6416 | TMS320C6711 | TMS320C6713 | UART | Vector Table | XBUS | XDS560

Discussion Groups

Discussion Groups | TMS320C6x | Ticks in SWI period

Technical discussions about the TI C6000 DSPs (including the c62x, c64x and c67x DSPs).

  

Post a new Thread

Ticks in SWI period - soli...@poczta.onet.pl - Jun 24 7:14:13 2008



Hello.
I'm working on c6711 and I have some doubts about clocks rate.
I use audio example from Code Composer. Because I want to implement a MELP vocoder, I set frame
length in pipelines to be 180 words (to fit the MELP frame). For 8kHz sampling rate it makes
one frame filled every 22,5 ms and then software interruption occurs. 
c6711 works on 150MHz clock rate, so in 22,5 ms period I should get 3375000 ticks. I used
CLK_gethtime() function to check it. The result was exactly the half of expected value, 1687500
ticks between SWIs. Did I make a mistake in my calculations? Or maybe something is wrong with
the project settings?
BTW, MELP analysis requires about 2100000 ticks to be performed (without any optimization), so
it can't be completed in one interruption period with this efficiency I have now.
Regards
Alexandra

------------------------------------

OMAP35x EVM jump-starts low-power apps
------------------------------------
The modular and extensible OMAP35x Evaluation Module (EVM) enables developers to start building
applications based on the OMAP35x architecture:http://www.DSPRelated.com/omap35x



(You need to be a member of c6x -- send a blank email to c6x-subscribe@yahoogroups.com )

Re: Ticks in SWI period - Bernhard 'Gustl' Bauer - Jun 24 7:30:16 2008

Hi,

AFAIR all peripheral units run with SYSCLK2 which is SYSCLK1/2

HTH

Gustl

s...@poczta.onet.pl schrieb:
> Hello.
> I'm working on c6711 and I have some doubts about clocks rate.
> I use audio example from Code Composer. Because I want to implement a 
> MELP vocoder, I set frame length in pipelines to be 180 words (to fit 
> the MELP frame). For 8kHz sampling rate it makes one frame filled every 
> 22,5 ms and then software interruption occurs.
> c6711 works on 150MHz clock rate, so in 22,5 ms period I should get 
> 3375000 ticks. I used CLK_gethtime() function to check it. The result 
> was exactly the half of expected value, 1687500 ticks between SWIs. Did 
> I make a mistake in my calculations? Or maybe something is wrong with 
> the project settings?
> BTW, MELP analysis requires about 2100000 ticks to be performed (without 
> any optimization), so it can't be completed in one interruption period 
> with this efficiency I have now.
> Regards
> Alexandra
> 
------------------------------------

OMAP35x EVM jump-starts low-power apps
------------------------------------
The modular and extensible OMAP35x Evaluation Module (EVM) enables developers to start building
applications based on the OMAP35x architecture:http://www.DSPRelated.com/omap35x



(You need to be a member of c6x -- send a blank email to c6x-subscribe@yahoogroups.com )

Re: Ticks in SWI period - Michael Dunn - Jun 24 9:37:04 2008

Alexandra,

On 6/24/08, Bernhard 'Gustl' Bauer <g...@quantec.de> wrote:
>
>   Hi,
>
> AFAIR all peripheral units run with SYSCLK2 which is SYSCLK1/2
>
> HTH
>
> Gustl
>
> s...@poczta.onet.pl <solita%40poczta.onet.pl> schrieb:
> >
> >
> > Hello.
> > I'm working on c6711 and I have some doubts about clocks rate.
> > I use audio example from Code Composer. Because I want to implement a
> > MELP vocoder, I set frame length in pipelines to be 180 words (to fit
> > the MELP frame). For 8kHz sampling rate it makes one frame filled every
> > 22,5 ms and then software interruption occurs.
> > c6711 works on 150MHz clock rate, so in 22,5 ms period I should get
> > 3375000 ticks. I used CLK_gethtime() function to check it. The result
> > was exactly the half of expected value, 1687500 ticks between SWIs. Did
> > I make a mistake in my calculations? Or maybe something is wrong with
> > the project settings?
>

Refer to spra829.pdf.
I believe that the timer uses CPU/4 as input for 6711. I also seem to
remember that there is a timer out pin on the 6711 that you can check with a
scope.

Note: 6711, 6711B, and 6711C have slightly different timer behavior
capabilities.  Also make sure that your PLL setup and clock divisors are
correct.

mikedunn

   > BTW, MELP analysis requires about 2100000 ticks to be performed
> (without
> > any optimization), so it can't be completed in one interruption period
> > with this efficiency I have now.
> > Regards
> > Alexandra
> 
-- 
www.dsprelated.com/blogs-1/nf/Mike_Dunn.php



(You need to be a member of c6x -- send a blank email to c6x-subscribe@yahoogroups.com )

Re: Ticks in SWI period - Richard Williams - Jun 24 10:40:49 2008

solita,

A possible explanation is the amount of time that interrupts are disabled is interfering with
the
counting of the clock cycles.

A good explanation can be found in the TI document: spra829.pdf

R. Williams
---------- Original Message -----------
From: s...@poczta.onet.pl
To: c...@yahoogroups.com
Sent: Tue, 24 Jun 2008 05:28:05 -0400
Subject: [c6x] Ticks in SWI period

> Hello.
> I'm working on c6711 and I have some doubts about clocks rate.
> I use audio example from Code Composer. Because I want to implement a MELP vocoder, I set

> frame length in pipelines to be 180 words (to fit the MELP frame). For 8kHz sampling rate

> it makes one frame filled every 22,5 ms and then software interruption occurs. c6711 works

> on 150MHz clock rate, so in 22,5 ms period I should get 3375000 ticks. I used 
> CLK_gethtime() function to check it. The result was exactly the half of expected value,
>  1687500 ticks between SWIs. Did I make a mistake in my calculations? Or maybe something 
> is wrong with the project settings? BTW, MELP analysis requires about 2100000 ticks to be

> performed (without any optimization), so it can't be completed in one interruption period

> with this efficiency I have now. Regards Alexandra
------- End of Original Message -------
------------------------------------

OMAP35x EVM jump-starts low-power apps
------------------------------------
The modular and extensible OMAP35x Evaluation Module (EVM) enables developers to start building
applications based on the OMAP35x architecture:http://www.DSPRelated.com/omap35x



(You need to be a member of c6x -- send a blank email to c6x-subscribe@yahoogroups.com )

Re: Ticks in SWI period - soli...@poczta.onet.pl - Jun 26 7:16:07 2008


Hello.
>I'm working on c6711 and I have some doubts about clocks rate.
>I use audio example from Code Composer. Because I want to implement a MELP vocoder, I set
frame length in pipelines to be 180 words (to fit the MELP frame). For 8kHz sampling rate it
makes one frame filled every 22,5 ms and then software interruption occurs. 
>c6711 works on 150MHz clock rate, so in 22,5 ms period I should get 3375000 ticks. I used
CLK_gethtime() function to check it. The result was exactly the half of expected value, 1687500
ticks between SWIs. Did I make a mistake in my calculations? Or maybe something is wrong with
the project settings?
>BTW, MELP analysis requires about 2100000 ticks to be performed (without any optimization),
so it can't be completed in one interruption period with this efficiency I have now.
>Regards
>Alexandra
>
>------------------------------------
>
>OMAP35x EVM jump-starts low-power apps
>------------------------------------
>The modular and extensible OMAP35x Evaluation Module (EVM) enables developers to start
building applications based on the OMAP35x architecture:http://www.DSPRelated.com/omap35x
Well...the situation sems to be a bit more compicated.
I used user LEDs as interruption indicators - turning on in the beginning of interruption,
turning off in the end. I checked the period. It was 45ms, and this is twice as much as
expected (180 samples with 8kHz sampling frequency last 22,5ms). This makes sense with the
number of ticks now. The counter used by CLK_gethtime is incremented every four CPU cycles, so
in 45ms it would be about 1687500 ticks. 
Now the problem is: why 22,5ms frame generates 45ms interruption?

------------------------------------

OMAP35x EVM jump-starts low-power apps
------------------------------------
The modular and extensible OMAP35x Evaluation Module (EVM) enables developers to start building
applications based on the OMAP35x architecture:http://www.DSPRelated.com/omap35x



(You need to be a member of c6x -- send a blank email to c6x-subscribe@yahoogroups.com )

Re: Re: Ticks in SWI period - Michael Dunn - Jun 26 9:15:17 2008

Alexandra,

On 6/26/08, s...@poczta.onet.pl <s...@poczta.onet.pl> wrote:
>
> Hello.
> >I'm working on c6711 and I have some doubts about clocks rate.
> >I use audio example from Code Composer. Because I want to implement a MELP
> vocoder, I set frame length in pipelines to be 180 words (to fit the MELP
> frame). For 8kHz sampling rate it makes one frame filled every 22,5 ms and
> then software interruption occurs.
> >c6711 works on 150MHz clock rate, so in 22,5 ms period I should get
> 3375000 ticks. I used CLK_gethtime() function to check it. The result was
> exactly the half of expected value, 1687500 ticks between SWIs. Did I make a
> mistake in my calculations? Or maybe something is wrong with the project
> settings?
> >BTW, MELP analysis requires about 2100000 ticks to be performed (without
> any optimization), so it can't be completed in one interruption period with
> this efficiency I have now.
> >Regards
> >Alexandra
> >
> >------------------------------------
> >
> >OMAP35x EVM jump-starts low-power apps
> >------------------------------------
> >The modular and extensible OMAP35x Evaluation Module (EVM) enables
> developers to start building applications based on the OMAP35x architecture:
>http://www.DSPRelated.com/omap35x
<http://www.dsprelated.com/omap35x>
> >
> >
> Well...the situation sems to be a bit more compicated.
> I used user LEDs as interruption indicators - turning on in the beginning
> of interruption, turning off in the end. I checked the period. It was 45ms,
> and this is twice as much as expected (180 samples with 8kHz sampling
> frequency last 22,5ms). This makes sense with the number of ticks now. The
> counter used by CLK_gethtime is incremented every four CPU cycles, so in
> 45ms it would be about 1687500 ticks.
> Now the problem is: why 22,5ms frame generates 45ms interruption?
>

You need to check your 'I/O count' - Is the example that you are using for
stereo?? [Reading a left and right for each sample].

Whatever the problem, it is likely a logic problem involving reading 'twice
as much data as you think it is'.  If you do not see it in the code,
instrument your code with some extra variables that count the number of
samples per frame to help you locate the problem.

mikedunn

>

-- 
www.dsprelated.com/blogs-1/nf/Mike_Dunn.php



(You need to be a member of c6x -- send a blank email to c6x-subscribe@yahoogroups.com )

Re: Re: Ticks in SWI period - Richard Williams - Jun 26 10:03:23 2008

solita,

You have captured the period of the interrupt at 45ms when 22.5msec was expected.
what is the duration of each interrupt?  Perhaps the duration of the interrupt processing is
greater
than 22.5msec and the result is only every second interrupt source event is actually being
serviced.

R. Williams

---------- Original Message -----------
From: s...@poczta.onet.pl
To: c...@yahoogroups.com
Sent: Thu, 26 Jun 2008 03:36:34 -0400
Subject: [c6x] Re: Ticks in SWI period

> Hello.
> >I'm working on c6711 and I have some doubts about clocks rate.
> >I use audio example from Code Composer. Because I want to implement a MELP vocoder, I
set frame
length in pipelines to be 180 words (to fit the MELP frame). For 8kHz sampling rate it makes
one
frame filled every 22,5 ms and then software interruption occurs. 
> >c6711 works on 150MHz clock rate, so in 22,5 ms period I should get 3375000 ticks. I
used
CLK_gethtime() function to check it. The result was exactly the half of expected value,
1687500
ticks between SWIs. Did I make a mistake in my calculations? Or maybe something is wrong with
the
project settings?
> >BTW, MELP analysis requires about 2100000 ticks to be performed (without any
optimization), so it
can't be completed in one interruption period with this efficiency I have now.
> >Regards
> >Alexandra
> >
> >------------------------------------
> >
> >OMAP35x EVM jump-starts low-power apps
> >------------------------------------
> >The modular and extensible OMAP35x Evaluation Module (EVM) enables developers to start
building
applications based on the OMAP35x architecture:http://www.DSPRelated.com/omap35x
> >
> >
> Well...the situation sems to be a bit more compicated.
> I used user LEDs as interruption indicators - turning on in the beginning of interruption,

> turning off in the end. I checked the period. It was 45ms, and this is twice as much as 
> expected (180 samples with 8kHz sampling frequency last 22,5ms). This makes sense with the

> number of ticks now. The counter used by CLK_gethtime is incremented every four CPU
cycles,
>  so in 45ms it would be about 1687500 ticks. Now the problem is: why 22,5ms frame 
> generates 45ms interruption?
------- End of Original Message -------
------------------------------------

OMAP35x EVM jump-starts low-power apps
------------------------------------
The modular and extensible OMAP35x Evaluation Module (EVM) enables developers to start building
applications based on the OMAP35x architecture:http://www.DSPRelated.com/omap35x



(You need to be a member of c6x -- send a blank email to c6x-subscribe@yahoogroups.com )

Re: Re: Ticks in SWI period - Jeff Brower - Jun 26 10:41:51 2008

Alexandra-

> >I'm working on c6711 and I have some doubts about clocks rate.
> >I use audio example from Code Composer. Because I want to implement a MELP vocoder, I
set frame length in pipelines to be 180 words (to fit the MELP frame). For 8kHz sampling rate
it makes one frame filled every 22,5 ms and then software interruption occurs.
> >c6711 works on 150MHz clock rate, so in 22,5 ms period I should get 3375000 ticks. I
used CLK_gethtime() function to check it. The result was exactly the half of expected value,
1687500 ticks between SWIs. Did I make a mistake in my calculations? Or maybe something is
wrong with the project settings?
> >BTW, MELP analysis requires about 2100000 ticks to be performed (without any
optimization), so it can't be completed in one interruption period with this efficiency I have
now.
> >
> Well...the situation sems to be a bit more compicated.
> I used user LEDs as interruption indicators - turning on in the beginning
> of interruption, turning off in the end. I checked the period. It was
> 45ms, and this is twice as much as expected (180 samples with 8kHz
> sampling frequency last 22,5ms). This makes sense with the number of
> ticks now. The counter used by CLK_gethtime is incremented every four
> CPU cycles, so in 45ms it would be about 1687500 ticks.
> Now the problem is: why 22,5ms frame generates 45ms interruption?

Is this a DSK 6711 board?  If not, what is the A/D interface?

-Jeff

------------------------------------

OMAP35x EVM jump-starts low-power apps
------------------------------------
The modular and extensible OMAP35x Evaluation Module (EVM) enables developers to start building
applications based on the OMAP35x architecture:http://www.DSPRelated.com/omap35x



(You need to be a member of c6x -- send a blank email to c6x-subscribe@yahoogroups.com )

Re: Ticks in SWI period - soli...@poczta.onet.pl - Jun 27 7:00:19 2008

Aswering all the questions:
1. In fact, I did not check if I used codec settings for stereo. However, I added some
variables to find the number of samlpes in one frame and it's OK (180 samples). Well... maybe
codec really reads more data, I have to check it, but the size of processed frame is proper.
2. Duration of interruption processing is small enough. If the processing is not finished when
the next SWI occurs, some synch errors appear and the whole program crashes... so I know
immediately that something is wrong. It doesn't matter if the processing time is 5ms or 20ms,
as long as it is not longer than interruption period, SWIs appear when the input frame is
filled and ready, so the period is fixed.
3. It is c6711 DSK board and I use built-in AD535.

------------------------------------

OMAP35x EVM jump-starts low-power apps
------------------------------------
The modular and extensible OMAP35x Evaluation Module (EVM) enables developers to start building
applications based on the OMAP35x architecture:http://www.DSPRelated.com/omap35x



(You need to be a member of c6x -- send a blank email to c6x-subscribe@yahoogroups.com )

Re: Re: Ticks in SWI period - Richard Williams - Jun 27 11:26:27 2008

solita,

You have stated that the interrupt rate/period is twice too long.
You have ask as to why that would be.
Now your saying that the interrupt rate is just fine, because no data is being missed.
SO what is the actual problem?

R. Williams

---------- Original Message -----------
From: s...@poczta.onet.pl
To: c...@yahoogroups.com
Sent: Fri, 27 Jun 2008 02:25:02 -0400
Subject: [c6x] Re: Ticks in SWI period

> Aswering all the questions:
> 
> 1. In fact, I did not check if I used codec settings for stereo. However, I added some 
> variables to find the number of samlpes in one frame and it's OK (180 samples). Well... 
> maybe codec really reads more data, I have to check it, but the size of processed frame is

> proper.
> 2. Duration of interruption processing is small enough. If the processing is not finished

> when the next SWI occurs, some synch errors appear and the whole program crashes... so I 
> know immediately that something is wrong. It doesn't matter if the processing time is 5ms

> or 20ms, as long as it is not longer than interruption period, SWIs appear when the input

> frame is filled and ready, so the period is fixed.
> 3. It is c6711 DSK board and I use built-in AD535.
------- End of Original Message -------
------------------------------------

OMAP35x EVM jump-starts low-power apps
------------------------------------
The modular and extensible OMAP35x Evaluation Module (EVM) enables developers to start building
applications based on the OMAP35x architecture:http://www.DSPRelated.com/omap35x



(You need to be a member of c6x -- send a blank email to c6x-subscribe@yahoogroups.com )

Re: Re: Ticks in SWI period - Jeff Brower - Jun 27 17:36:21 2008

Alexandra-

> Aswering all the questions:
> 1. In fact, I did not check if I used codec settings for stereo.
> However, I added some variables to find the number of samlpes in
> one frame and it's OK (180 samples). Well... maybe codec really
> reads more data, I have to check it, but the size of processed
> frame is proper.

If you get 180 samples, but the time period represents 45 msec instead of 22.5, you
might have the AD535 sample rate set to 4 kHz, or you might have the serial port
configured such that every other frame is being received.  Suggest to look for things
like that.

One way to tell for sure if your A/D interface is correct is use a mic + amplifier
(or sound card input) and loopback to a speaker and listen.  Anything that sounds
weird then you know you're not sampling correctly.
 
> 2. Duration of interruption processing is small enough. If the
> processing is not finished when the next SWI occurs, some synch
> errors appear and the whole program crashes... so I know
> immediately that something is wrong. It doesn't matter if the
> processing time is 5ms or 20ms, as long as it is not longer
> than interruption period, SWIs appear when the input frame is
> filled and ready, so the period is fixed.

What do you mean by "SWI"?  NOrmally that's a software interrupt, but you shouldn't
be using SWI.  Your interrupts should be hardware driven, either by McBSP0 (sample
basis) or DMA event (buffer/frame basis).

> 3. It is c6711 DSK board and I use built-in AD535.

Ok.  That's very important info, you should include that in your first post.

-Jeff

------------------------------------

OMAP35x EVM jump-starts low-power apps
------------------------------------
The modular and extensible OMAP35x Evaluation Module (EVM) enables developers to start building
applications based on the OMAP35x architecture:http://www.DSPRelated.com/omap35x



(You need to be a member of c6x -- send a blank email to c6x-subscribe@yahoogroups.com )

Re: Ticks in SWI period - soli...@poczta.onet.pl - Jun 27 17:36:36 2008

The problem is that the theoretical frame duration and the interruption period don't fit
each other. Period is fixed and I checked it's 45ms, but the frame should generate SWI every
22,5ms (as being filled). What can be the reason of it? 

------------------------------------

OMAP35x EVM jump-starts low-power apps
------------------------------------
The modular and extensible OMAP35x Evaluation Module (EVM) enables developers to start building
applications based on the OMAP35x architecture:http://www.DSPRelated.com/omap35x



(You need to be a member of c6x -- send a blank email to c6x-subscribe@yahoogroups.com )