yunfei qu(deleted)
|
Uncertainty about timer under the QNX RTOS
|
yunfei qu(deleted)
10/11/2013 5:33 AM
post105851
|
Uncertainty about timer under the QNX RTOS
In my program, the timer(HPET) interrupt has been attached with an event through InterruptAttachEvent() function.
I use ClockCycles() to calculate the time elapsed between two events triggerred by the timer interrupt. And I have used
the ThreadCtl() call to “lock” the thread to a single CPU.
In theory, one event will be triggerred every 1ms. But in my test, the time elapsed fluctuates from 950us to 1040us.
Is there anyone have the same problems or anyone know how to explain this fluctuation
?
Any help will be appreciated!
|
|
|
Gervais Mulongoy
|
Re: Uncertainty about timer under the QNX RTOS
|
Gervais Mulongoy
10/11/2013 8:14 AM
post105855
|
Re: Uncertainty about timer under the QNX RTOS
Take a look at the section "Timing Jitter":
http://www.qnx.com/developers/docs/6.4.1/neutrino/getting_started/s1_timer.html
On 13-10-11 05:33 AM, yunfei qu wrote:
> In my program, the timer(HPET) interrupt has been attached with an event through InterruptAttachEvent() function.
>
> I use ClockCycles() to calculate the time elapsed between two events triggerred by the timer interrupt. And I have
used the ThreadCtl() call to “lock” the thread to a single CPU.
>
> In theory, one event will be triggerred every 1ms. But in my test, the time elapsed fluctuates from 950us to 1040us.
>
> Is there anyone have the same problems or anyone know how to explain this fluctuation
> ?
>
> Any help will be appreciated!
>
>
>
>
>
>
>
> _______________________________________________
>
> OSTech
> http://community.qnx.com/sf/go/post105851
> To cancel your subscription to this discussion, please e-mail ostech-core_os-unsubscribe@community.qnx.com
|
|
|
yunfei qu(deleted)
|
Re: Uncertainty about timer under the QNX RTOS
|
yunfei qu(deleted)
10/11/2013 8:55 AM
post105858
|
Re: Uncertainty about timer under the QNX RTOS
Thanks for your imply!
Does it means that under QNX RTOS, the maxium performance of the timer is "command value+/-50us"? Which implies that it
is impossible to get more determinated actions under QNX than "±50us" without hardware extension?
Thanks again!
Yunfei Qu
|
|
|
Lichun Zhu
|
RE: Uncertainty about timer under the QNX RTOS
|
Lichun Zhu
10/11/2013 9:48 AM
post105862
|
RE: Uncertainty about timer under the QNX RTOS
Do you get the +/-50 us most of the time? I am wondering what's the priority of your pulse. And how about do that in ISR
using InterruptAttach (Instead of InterruptAttachEvent). Does your system has lots of software timers?
-----Original Message-----
From: yunfei qu [mailto:community-noreply@qnx.com]
Sent: Friday, October 11, 2013 8:56 AM
To: ostech-core_os
Subject: Re: Uncertainty about timer under the QNX RTOS
Thanks for your imply!
Does it means that under QNX RTOS, the maxium performance of the timer is "command value+/-50us"? Which implies that it
is impossible to get more determinated actions under QNX than "±50us" without hardware extension?
Thanks again!
Yunfei Qu
_______________________________________________
OSTech
http://community.qnx.com/sf/go/post105858
To cancel your subscription to this discussion, please e-mail ostech-core_os-unsubscribe@community.qnx.com
|
|
|
yunfei qu(deleted)
|
Re: RE: Uncertainty about timer under the QNX RTOS
|
yunfei qu(deleted)
10/11/2013 10:08 AM
post105865
|
Re: RE: Uncertainty about timer under the QNX RTOS
Thanks for your reply!
I am sorry, I can not catch you totally.
What I have done is to attach the timer interrupt to an event. When the time expired, an event will be signaled and the
thread which is waiting for such event will turn into running.
I do not wirte an ISR for special timer interrupt.
Thanks again!
|
|
|
yunfei qu(deleted)
|
Re: RE: Uncertainty about timer under the QNX RTOS
|
yunfei qu(deleted)
10/11/2013 10:24 AM
post105867
|
Re: RE: Uncertainty about timer under the QNX RTOS
1.Yes, it is. I have tried many times, results are similar.
2.I use signal, not pulse, and the priority of the thread waiting for such signal is 200.
3.I have no idea how to write an ISR for the HPET while it has a default one comes from the
kernel maybe.
4.what I want to acquire is a periodic timing(250us) with high stability, so I could get high
synchronization performence of motion control.
Thanks again!
|
|
|
Mario Charest
|
RE: RE: Uncertainty about timer under the QNX RTOS
|
Mario Charest
10/11/2013 2:59 PM
post105878
|
RE: RE: Uncertainty about timer under the QNX RTOS
You never mentioned what is your hardware.
BIOS can take over the OS, when then USB is in emulation mode, for example...
> -----Message d'origine-----
> De : yunfei qu [mailto:community-noreply@qnx.com]
> Envoyé : 11 octobre 2013 10:25
> À : ostech-core_os
> Objet : Re: RE: Uncertainty about timer under the QNX RTOS
>
> 1.Yes, it is. I have tried many times, results are similar.
>
> 2.I use signal, not pulse, and the priority of the thread waiting for such signal is
> 200.
>
> 3.I have no idea how to write an ISR for the HPET while it has a default one
> comes from the kernel maybe.
>
> 4.what I want to acquire is a periodic timing(250us) with high stability, so I could
> get high synchronization performence of motion control.
>
> Thanks again!
>
>
>
> _______________________________________________
>
> OSTech
> http://community.qnx.com/sf/go/post105867
> To cancel your subscription to this discussion, please e-mail ostech-core_os-
> unsubscribe@community.qnx.com
|
|
|
Jerry Sui
|
Re: Uncertainty about timer under the QNX RTOS
|
Jerry Sui
10/11/2013 3:14 PM
post105882
|
Re: Uncertainty about timer under the QNX RTOS
The granularity of kernel timer is 1ms, it is impossible to get 250us periodic timing. You need special hardware to
generate interrupts every 250us (or 250us /n) to achieve that.
Jerry Sui | Software Developer | jsui@qnx.com<mailto:jsui@qnx.com>
O:613-591-0836 x 24904 C:613-240-9239 | www.qnx.com<http://www.qnx.com/> | QNX Software Systems
Cisco Support Team email: cisco_support@qnx.com<mailto:cisco_support@qnx.com>
From: Mario Charest <community-noreply@qnx.com<mailto:community-noreply@qnx.com>>
Reply-To: "ostech-core_os@community.qnx.com<mailto:ostech-core_os@community.qnx.com>" <ostech-core_os@community.qnx.
com<mailto:ostech-core_os@community.qnx.com>>
Date: Friday, 11 October, 2013 2:59 PM
To: "ostech-core_os@community.qnx.com<mailto:ostech-core_os@community.qnx.com>" <ostech-core_os@community.qnx.com<
mailto:ostech-core_os@community.qnx.com>>
Subject: RE: RE: Uncertainty about timer under the QNX RTOS
You never mentioned what is your hardware.
BIOS can take over the OS, when then USB is in emulation mode, for example...
-----Message d'origine-----
De : yunfei qu [mailto:community-noreply@qnx.com]
Envoyé : 11 octobre 2013 10:25
À : ostech-core_os
Objet : Re: RE: Uncertainty about timer under the QNX RTOS
1.Yes, it is. I have tried many times, results are similar.
2.I use signal, not pulse, and the priority of the thread waiting for such signal is
200.
3.I have no idea how to write an ISR for the HPET while it has a default one
comes from the kernel maybe.
4.what I want to acquire is a periodic timing(250us) with high stability, so I could
get high synchronization performence of motion control.
Thanks again!
_______________________________________________
OSTech
http://community.qnx.com/sf/go/post105867
To cancel your subscription to this discussion, please e-mail ostech-core_os-
unsubscribe@community.qnx.com<mailto:unsubscribe@community.qnx.com>
_______________________________________________
OSTech
http://community.qnx.com/sf/go/post105878
To cancel your subscription to this discussion, please e-mail ostech-core_os-unsubscribe@community.qnx.com<mailto:ostech
-core_os-unsubscribe@community.qnx.com>
|
|
|
yunfei qu(deleted)
|
Re: Uncertainty about timer under the QNX RTOS
|
yunfei qu(deleted)
10/11/2013 9:32 PM
post105891
|
Re: Uncertainty about timer under the QNX RTOS
Thanks for your reply!
I do acquire 250us periodic timing under QNX using HPET, the problem is time elapsed
between two signals triggerred by the timer interrupt varies from about 950 to 1040us
When I set the periodic timing to 1000us.
I record 10,000 times the time elapsed between two signals and find that the maximum is
about 1040us and the minimum is 950us although in most often it is 1000us.
Thanks again!
> The granularity of kernel timer is 1ms, it is impossible to get 250us periodic
> timing. You need special hardware to generate interrupts every 250us (or
> 250us /n) to achieve that.
>
> Jerry Sui | Software Developer | jsui@qnx.com<mailto:jsui@qnx.com>
> O:613-591-0836 x 24904 C:613-240-9239 | www.qnx.com<http://www.qnx.com/> | QNX Software Systems
> Cisco Support Team email: cisco_support@qnx.com<mailto:cisco_support@qnx.com>
>
>
> From: Mario Charest <community-noreply@qnx.com<mailto:community-noreply@qnx.com>>
> Reply-To: "ostech-core_os@community.qnx.com<mailto:ostech-core_os@community.qnx.com>" <ostech-core_os@community.qnx
.com<mailto:ostech-core_os@community.qnx.com>>
> Date: Friday, 11 October, 2013 2:59 PM
> To: "ostech-core_os@community.qnx.com<mailto:ostech-core_os@community.qnx.com>" <ostech-core_os@community.qnx.com<
mailto:ostech-core_os@community.qnx.com>>
> Subject: RE: RE: Uncertainty about timer under the QNX RTOS
>
> You never mentioned what is your hardware.
>
> BIOS can take over the OS, when then USB is in emulation mode, for example...
>
> -----Message d'origine-----
> De : yunfei qu [mailto:community-noreply@qnx.com]
> Envoyé : 11 octobre 2013 10:25
> À : ostech-core_os
> Objet : Re: RE: Uncertainty about timer under the QNX RTOS
> 1.Yes, it is. I have tried many times, results are similar.
> 2.I use signal, not pulse, and the priority of the thread waiting for such
> signal is
> 200.
> 3.I have no idea how to write an ISR for the HPET while it has a default one
> comes from the kernel maybe.
> 4.what I want to acquire is a periodic timing(250us) with high stability, so I
> could
> get high synchronization performence of motion control.
> Thanks again!
> _______________________________________________
> OSTech
> http://community.qnx.com/sf/go/post105867
> To cancel your subscription to this discussion, please e-mail ostech-core_os-
> unsubscribe@community.qnx.com<mailto:unsubscribe@community.qnx.com>
>
>
>
>
>
> _______________________________________________
>
> OSTech
> http://community.qnx.com/sf/go/post105878
> To cancel your subscription to this discussion, please e-mail ostech-core_os-
> unsubscribe@community.qnx.com<mailto:ostech-core_os-unsubscribe@community.qnx.com>
>
|
|
|
Mario Charest
|
RE: Uncertainty about timer under the QNX RTOS
|
Mario Charest
11/02/2013 6:21 AM
post106487
|
RE: Uncertainty about timer under the QNX RTOS
Use the system profiler to se what is causing this.
________________________________________
From: yunfei qu <community-noreply@qnx.com>
Sent: Friday, October 11, 2013 9:32 PM
To: ostech-core_os
Subject: Re: Uncertainty about timer under the QNX RTOS
Thanks for your reply!
I do acquire 250us periodic timing under QNX using HPET, the problem is time elapsed
between two signals triggerred by the timer interrupt varies from about 950 to 1040us
When I set the periodic timing to 1000us.
I record 10,000 times the time elapsed between two signals and find that the maximum is
about 1040us and the minimum is 950us although in most often it is 1000us.
Thanks again!
> The granularity of kernel timer is 1ms, it is impossible to get 250us periodic
> timing. You need special hardware to generate interrupts every 250us (or
> 250us /n) to achieve that.
>
> Jerry Sui | Software Developer | jsui@qnx.com<mailto:jsui@qnx.com>
> O:613-591-0836 x 24904 C:613-240-9239 | www.qnx.com<http://www.qnx.com/> | QNX Software Systems
> Cisco Support Team email: cisco_support@qnx.com<mailto:cisco_support@qnx.com>
>
>
> From: Mario Charest <community-noreply@qnx.com<mailto:community-noreply@qnx.com>>
> Reply-To: "ostech-core_os@community.qnx.com<mailto:ostech-core_os@community.qnx.com>" <ostech-core_os@community.qnx
.com<mailto:ostech-core_os@community.qnx.com>>
> Date: Friday, 11 October, 2013 2:59 PM
> To: "ostech-core_os@community.qnx.com<mailto:ostech-core_os@community.qnx.com>" <ostech-core_os@community.qnx.com<
mailto:ostech-core_os@community.qnx.com>>
> Subject: RE: RE: Uncertainty about timer under the QNX RTOS
>
> You never mentioned what is your hardware.
>
> BIOS can take over the OS, when then USB is in emulation mode, for example...
>
> -----Message d'origine-----
> De : yunfei qu [mailto:community-noreply@qnx.com]
> Envoyé : 11 octobre 2013 10:25
> À : ostech-core_os
> Objet : Re: RE: Uncertainty about timer under the QNX RTOS
> 1.Yes, it is. I have tried many times, results are similar.
> 2.I use signal, not pulse, and the priority of the thread waiting for such
> signal is
> 200.
> 3.I have no idea how to write an ISR for the HPET while it has a default one
> comes from the kernel maybe.
> 4.what I want to acquire is a periodic timing(250us) with high stability, so I
> could
> get high synchronization performence of motion control.
> Thanks again!
> _______________________________________________
> OSTech
> http://community.qnx.com/sf/go/post105867
> To cancel your subscription to this discussion, please e-mail ostech-core_os-
> unsubscribe@community.qnx.com<mailto:unsubscribe@community.qnx.com>
>
>
>
>
>
> _______________________________________________
>
> OSTech
> http://community.qnx.com/sf/go/post105878
> To cancel your subscription to this discussion, please e-mail ostech-core_os-
> unsubscribe@community.qnx.com<mailto:ostech-core_os-unsubscribe@community.qnx.com>
>
_______________________________________________
OSTech
http://community.qnx.com/sf/go/post105891
To cancel your subscription to this discussion, please e-mail ostech-core_os-unsubscribe@community.qnx.com
|
|
|
|