How is this register configurated and then read, in VxWorks? That is, what address is it at, and what address do I write to configure its rate of increment.
We aren't using RTP so there's no kernel space issue. Just need to write the rate to some control address, and then periodically read the 64-bit unsigned integer timer.
In our application, we need a high resolution, 64-bit timer that software will use to do general timing measurements.
Example code would be good.
It depends what your application wants to do with the timer and the environment in which it will be happening. I haven't works with that particular chip, so I can't tell you how to use the register.
If what you want is a timestamp-like function, where you can read the counter before and after an operation and do a difference between the two, then VxWorks board support packages provides that functionality via the sysTimestamp family of functions. See the documentation.
However, if sysTimestamp does not meet your requirements, but you still want to access the register to read the current time and your code runs in the kernel space (vs. user-space AKA RTP) then you simply need to define a function that will return the timestamp...
uint64 myTimestamp() {
uint64 ts;
ts = *read & massage the register*
*deal with overflows, etc... *
return ts;
}
If on the other hand, your application runs in the context of a RTP, things get more complicated since RTPs, much like processes in windows, don't have direct access to hardware functions.
One possibility is to map a page of physical kernel memory to the RTP so it can access the registers directly. Highly discouraged, since you've opened a hole in the protection mechanism of the system. You could also implement a custom system call specifically to read the timestamp register.
Both of these solutions require intermediate - advanced skills with vxWorks.