08-22-2010 04:57 PM
HI
how to access a MHz clock ?
08-23-2010 04:02 PM
Hi Sergiv,
Unfortunately, the 1MHz clock is not accessible on ARM boards from the Time Loop Configuration Dialog. However, there is way to implement similar functionality using timers, interrupts, and an interrupt handler VI. Check out this example on our community for more information.
Aaron P
National Instruments
Applications Engineer
08-23-2010 11:44 PM
hi
thanks for the answers
i can not open this example. i use labview 8.6. You can adapt this example to labview 8.6 ?
08-27-2010 01:02 PM
Hi,
You can also reduce the Os_clock definition in the RTX_Config.c at 70 from 50,000,000 to 5,000,000:
// <h>SysTick Timer Configuration
// =============================
// <o>Timer clock value [Hz] <1-1000000000>
// <i> Set the timer clock value for selected timer.
// <i> Default: 50000000 (50MHz)
#ifndef OS_CLOCK
#define OS_CLOCK 50000000
#endif
It will trick the system timings by a factor of ten, it s relatively stable, I tested it on some applications and it worked great, going higher just hangs.
Have a good one
Lukasz.
08-28-2010 10:08 AM
Hello.
Thanks for your reply and advice.
how to adapt the application MHz clock?
source for kHz hours. that must change?
08-29-2010 09:39 PM
Hi,
First you need to understand that all the time definitions in your application will be modified, proportionally to the clock ratio difference. So if normally you have 50,000,000, a value of 1 for "Wait" functions equals 1 ms. If you have changed the value of the clock to 5,000,000 ( a factor of ten) all timings are now divided by ten, so specifying 1 for the "wait function" equals 100us...
I doubt you can reach 10us, you can try...from experience I know that 100us resolution works fine.
By the way, you should use "wait multiple ms" instead of the "wait" function, you can easily find out why by searching for it on the ni.com site.
gl,
Lukasz A.
08-29-2010 09:41 PM
BTW why don t you use the PWM outputs for your application? Much better control and resolution...
08-29-2010 11:35 PM - edited 08-29-2010 11:39 PM
hello!
Thank you very much for your support.
"BTW why don t you use the PWM outputs for your application?"
because I need a PWM with a period of 20 ms and pulse length of 0.8 ms to 2.2 ms with a step of 0.01 ms. if we use the PWM output, then at a frequency of 50 Hz (period 20 ms), we obtain the following "steps":
4% - 0,8 ms
5% - 1,0 ms
6% - 1,2 ms
7% - 1,4 ms
8% - 1,6 ms
9% - 1,8 ms
10% - 2,0 ms
11% - 2,2 ms
08-30-2010 09:02 AM
Hi again,
The PWM has an 10bit resolution, you can control the frequency at 1/100 of a percent or even in CPU clock ticks ~20ns.
On the PWM elemental node, right click and choose proprieties, look in "duty cycle units" for what best suits you.
I am assuming you want to control some servo motors, so the 1/100th of percent will be plenty of resolution.
Cheers,
Lukasz
08-30-2010 10:35 AM - edited 08-30-2010 10:37 AM
Sorry I made a mistake, forget the 10 bits I mentioned....I got confused with something else. And I meant the duty cycle and not the frequency. It s obviously much more than 10bits since you can get CPU clock cycles.