Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Uncertainty about timer under the QNX RTOS : Page 1 of 2 (11 Items)
   
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!



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

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
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
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!
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!
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

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>;

Attachment: HTML sf-attachment-mime18911 5.29 KB
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>;
> 

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