LabVIEW Embedded

cancel
Showing results for 
Search instead for 
Did you mean: 

MHz clock for ARM

HI

how to access a MHz clock ?

22092i9881C666E903DBC7

0 Kudos
Message 1 of 10
(7,653 Views)

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

http://www.ni.com/support

0 Kudos
Message 2 of 10
(7,639 Views)

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 ?

0 Kudos
Message 3 of 10
(7,636 Views)

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.

0 Kudos
Message 4 of 10
(7,601 Views)

 

Hello.
Thanks for your reply and advice.
how to adapt the application MHz clock?

source for kHz hours. that must change?

 

 

22637iEC90D31B83DE86DD

0 Kudos
Message 5 of 10
(7,583 Views)

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.

0 Kudos
Message 6 of 10
(7,561 Views)

BTW why don t you use the PWM outputs for your application? Much better control and resolution...

0 Kudos
Message 7 of 10
(7,559 Views)

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

0 Kudos
Message 8 of 10
(7,556 Views)

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

0 Kudos
Message 9 of 10
(7,548 Views)

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.

0 Kudos
Message 10 of 10
(7,544 Views)