View Single Post
  #57   Spotlight this post!  
Unread 26-04-2008, 00:39
wireties's Avatar
wireties wireties is offline
Principal Engineer
AKA: Keith Buchanan
FRC #1296 (Full Metal Jackets)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Rockwall, TX
Posts: 1,170
wireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond repute
Send a message via AIM to wireties
Re: Purchasing the 2009 controller

VxWorks does indeed support interrupts and timers. A VxWorks BSP (board support package - code to support an architecture port of vxWorks on a unique piece of hardware) will possibly include 3 timer libraries.

The first is the system timer and includes functions like sysClkRateSet, sysClkRateGet, sysClkEnable etc. The system timer library is mandatory and is used by the BSP to generate the tick timer that support pre-emption. The system tick normally runs at 60Hz or 100Hz. It is common to raise the rate up to 1Khz. There is a watchdog library that hooks the system timer ISR to do its work. It is pretty easy to create watchdog, interval and one-shot functions. The watchdog library only works in the kernel context, if you are working in a RTP (real time process - very much like processes in linux) the POSIX timers are available.

The second timer library is very similar to the system timer library, called the auxiliary timer library and includes functions like sysAuxClkRateSet, sysAuxClkEnable etc. It is commonly provided but is optional. Programmers make use of the aux timer library if greater precision (that the system timer) is necessary. It also works only in the kernel context, there is no analog in a RTP.

The third timer library is the timestamp library. It is normally used by system profiling functions in the kernel context. It is less commonly provided and is optional. The idea is to support a very high-res timestamp rather that interval and one-shot functions.

Finally, rolling ones own timer is pretty easy and not unlike using the timers on the 2004-2007 FIRST systems. You set a clock source, pre-scalar and initial value, register a ISR, enables interrupts and let it rip. But vxWorks makes it muuuuch easier to write interrupt service routines.

HTH,
Keith
Reply With Quote