public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: "ariga masahiro" <ariga@link-lab.co.jp>
To: "Andrew Lunn" <andrew@lunn.ch>
Cc: "Paul D. DeRocco" <pderocco@ix.netcom.com>,
	        <ecos-discuss@ecos.sourceware.org>
Subject: Re: [ECOS] Re: In trouble of timer operations
Date: Wed, 04 Jun 2008 05:25:00 -0000	[thread overview]
Message-ID: <000a01c8c603$4d825dd0$1c0110ac@ariga> (raw)
In-Reply-To: <20080530080707.GA27869@lunn.ch>

[-- Attachment #1: Type: text/plain, Size: 1832 bytes --]

Hello Andrew,Paul,and others,

I am afraid I dig up the same question but I think this is important,at 
least for me,
so please forgive my inquiring again.
The problem is return_time of cyg_thread_delay.I am determined to use TMU1 
as Free-Run Counter(0xffffffff-0)
and made function(HAL_CLOCK_READ1) to read TMU1 clock count.I am affirmed 
it's working correctry.
I used it to calculate return time in hipri_test() in timeslice2.c.
I am baffled by the result.

--testing code
hipri_test(CYG_ADDRESS id)
{
    cyg_int32 start;

    while( 1 )
    {
        HAL_CLOCK_READ1(&start);
        diag_printf("id=hi 0x%x\n",start);
        cyg_thread_delay(1);
        cyg_thread_delay(2);
    }
}
I calculated several cases.
(1) I only used cyg_thread_delay(2)
(2) I used Andrew's proposition of using 
cyg_thread_delay(1),cyg_thread_delay(2) like above code.
(3) same as (2) except changed cyg_thread_delay(2) to cyg_thread_delay(20)
(4) only used cyg_thread_delay(20)

result
(1) return value 1152.6microsec   -- 1tick=576.3microsec
(2) return value 2041.7292mirosec
(3) return value 13286.6304microsec
(4) return value 12669.3792microsec -- 1tick=633.46microsec

I cannot help concluding that 1 tick takes only about 600microsec.
I checked related option values in untitled.ecc file.(I appended)
CYGNUM_HAL_RTC_NUMERATOR   # Default value: 1000000000
CYGNUM_HAL_RTC_DENOMINATOR # Default value: 100
CYGNUM_HAL_RTC_PERIOD {
    #     CYGHWR_HAL_SH_ONCHIP_PERIPHERAL_SPEED == 29491200
    #     CYGNUM_HAL_RTC_DENOMINATOR == 100
    #     CYGHWR_HAL_SH_RTC_PRESCALE == 4
    #   --> 73728
};

Since CYGNUM_HAL_RTC_DENOMINATOR=100,I guess clock interrupt frequency 
should be 100H(=1 tick is 10millisec).
Please teach me where I am making mistakes.
If I am missing your points please forgive my ignorance and enlighten me.
Masahiro Ariga

[-- Attachment #2: untitled.ecc.gz --]
[-- Type: application/x-gzip, Size: 89721 bytes --]

[-- Attachment #3: Type: text/plain, Size: 148 bytes --]

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

  reply	other threads:[~2008-06-04  5:25 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-07 23:59 [ECOS] Wrongfully compiled code ariga masahiro
2008-01-08  0:05 ` Gary Thomas
2008-01-08  1:05   ` ariga masahiro
2008-01-17 19:21     ` [ECOS] " Dave Lawrence
2008-01-17 23:50       ` ariga masahiro
2008-01-18 12:16         ` Dave Lawrence
2008-01-18 14:40           ` Gregg Levine
2008-01-18 15:44             ` Dave Lawrence
2008-01-18 15:49               ` Gregg Levine
2008-01-18 16:09                 ` Dave Lawrence
2008-01-21  0:34           ` ariga masahiro
2008-02-04  1:49           ` ariga masahiro
2008-02-04 11:38             ` Dave Lawrence
2008-02-12  1:06               ` ariga masahiro
2008-02-12 10:55                 ` Dave Lawrence
2008-02-22  4:57   ` [ECOS] How to re-install newly compiled gnutools ariga masahiro
2008-02-22  7:15     ` ariga masahiro
2008-05-16  8:13       ` [ECOS] When or on what condition does "deschedule" happen? ariga masahiro
2008-05-16 15:26         ` Andrew Lunn
2008-05-19  5:32           ` ariga masahiro
2008-05-19 13:18             ` Andrew Lunn
2008-05-19 13:31               ` Gary Thomas
2008-05-20  1:26               ` ariga masahiro
2008-05-20 12:18                 ` Andrew Lunn
2008-05-23  7:38                   ` ariga masahiro
2008-05-23  9:35                     ` Nick Garnett
     [not found]                   ` <000601c8c165$406e0970$1c0110ac@ariga>
2008-05-29 18:23                     ` [ECOS] Re: In trouble of timer operations Andrew Lunn
2008-05-30  2:50                       ` ariga masahiro
2008-05-30  3:09                         ` Paul D. DeRocco
2008-05-30  4:11                           ` ariga masahiro
2008-05-30  4:43                             ` Paul D. DeRocco
2008-05-30  7:26                               ` ariga masahiro
2008-05-30  7:47                                 ` Paul D. DeRocco
2008-05-30  8:03                                   ` ariga masahiro
2008-05-30  8:07                                 ` Andrew Lunn
2008-06-04  5:25                                   ` ariga masahiro [this message]
2008-06-04 10:06                                     ` Paul D. DeRocco
2008-06-05  6:14                                       ` ariga masahiro
2008-06-05 17:39                                         ` Paul D. DeRocco
2008-05-30  6:35                             ` Andrew Lunn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='000a01c8c603$4d825dd0$1c0110ac@ariga' \
    --to=ariga@link-lab.co.jp \
    --cc=andrew@lunn.ch \
    --cc=ecos-discuss@ecos.sourceware.org \
    --cc=pderocco@ix.netcom.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).