OpenPIC timer usage?

Nick Withers nick.withers at anu.edu.au
Tue Aug 12 02:48:27 UTC 2014


Hullo all,

Has anyone used an OpenPIC timer (see
"c/src/lib/libbsp/powerpc/shared/openpic/") in single-shot mode before?
I seem to be having some trouble with them, in particular ensuring that
an ISR fires only once.

According to "c/src/lib/libbsp/powerpc/mvme3100/README", "The setup
routine allows for specifying single-shot or periodic mode", but I can't
seem to see how to achieve the former.

Going off
"c/src/lib/libcpu/powerpc/new-exceptions/bspsupport/nested_irq_test.c" I
should at least openpic_maptimer(..., 0) and openpic_inittimer(..., ...,
0) to stop the timer. I've tried that in the ISR and the
openpic_inittimer() call can stall indefinitely in
openpic_safe_writefield() on "while (openpic_read(addr=0xe1041120) &
OPENPIC_ACTIVITY);".

Any ideas? Perhaps I'm going about this the wrong way to begin with...
What I'm after is a microsecond-precision-ish one-shot timer that'll be
used thousands of times per second.

Ta all!
-- 
Nick Withers

Embedded Systems Programmer
Department of Nuclear Physics, Research School of Physics and Engineering
The Australian National University (CRICOS: 00120C)



More information about the users mailing list