I’m having trouble using the output compare function of the xbee library. I’m setting a timeout of 10 uS like this:
ocompare_config(ocompare0, 10, 10, OCCOMPARE_TOGGLE);
but the edges that come out aren’t 10 uS apart, they are 2.7 msec. The xbee programmable is the 32K variety, and I have the clock set to 48 MHz in the project configuration.
It’s not clear to me from the documentation whether or not I need to keep resetting the timer in the interrupt service routine, so I tried:
void ocompare0_irq(void)
{
occompare_set_timeout(occompare0, 10);
/* toggle a GPIO pin to make sure it's working */
}
but that had no effect at all (still 2.7 msec) other than proving to me that the interrupt service routine does indeed fire.
What am I doing wrong?