The difference between the system clock and auxiliary measures

In Vxworks, we have various clocks, such as system clock and auxiliary clock, and has various APIs as shown below

  • sysClkConnect () - connect a routine to interrupt the system clock
  • sysClkDisable () - disable system clock interrupts
  • sysClkEnable () - enable system clock interrupts
  • sysClkRateGet () - get the system clock frequency
  • sysClkRateSet () - setting the system clock frequency
  • sysAuxClkConnect () - connect a subroutine to an auxiliary clock interrupt
  • sysAuxClkDisable () - disable auxiliary clock interrupts
  • sysAuxClkEnable () - enable auxiliary clock interrupts
  • sysAuxClkRateGet () - get an additional clock speed
  • sysAuxClkRateSet () - set an additional clock frequency

My question is what is the difference between a system clock and an auxiliary clock. When should a programmer use what and under what scenarios?

+4
source share
2 answers

System clocks form the basis of how VxWorks tracks time and timeouts.

Most OS objects that support timeouts (semaphores, message queues, events), as well as the taskDelay call, are in units of clock pulses that are based on the system clock.

Generally speaking, the system clock speed is chosen by the board designer for any reason.

Reducing the clock frequency slightly increases the system load, since during each clock signal of the system, the operating system must serve various timeout elements, time interval counters, and other internal elements.

If you need to complete a task at high speed (2000 - 8000 Hz), you can use the auxiliary clock. AuxClock API is a simplified interface to the interrupt service routine. Whenever the clock expires, the routine defined by sysAckClockConnect is called from the ISR aux clock.

There is no system overhead associated with Aux Clock during ISR maintenance.

Of course, to use auxClock, you need 2 hardware hours. In addition, some vxWorks components, such as spyware, use auxClock. If you have such a component, you cannot use it, because there is a conflict.

Note that if more than two timers are installed on your hardware platform, you can write your own routines to essentially do the same thing as the Aux Clock API.

+5
source

The auxiliary clock (with hardware support) can, for example, be used for high-speed polling. This clock frequency can be set to sysAuxClkRateSet() to deviate from the system interrupt period.

Example: Programming Interruptions: Example for MVME 162 Using VxWorks .

0
source

Source: https://habr.com/ru/post/1497959/


All Articles