calling an ISR from a Quark PWM timers interrupt: how?

I've created some code that implements a PWM audio DAC -- just 8bit 8Khz mono. It function nicely but for one thing: my first implementation used the ARC V2 TIMER1 subsystem to call my sample rate ISR (8000 times per second), which was fine until the first time I tried to use the Servo library in the same program. Ooops -- they both depend on the ARC V2 TIMER1 subsystem.

My next iteration uses the Quark PWM / Timer system as a time base and so I need it to call my IRS every time the counter hits zero. My oscilloscope says I've configured it to run at the correct rate, but I've not been able to get it to generate an interrupt (or, more accurately, to call my ISR).

Does anyone here have a sense of how to do that, or what I should try? Here's the code I've tried for enabling interrupts, version 1:

  interrupt_connect(SOC_PWM_INTERRUPT, sampleClockISR);

It occurred to me that I might need to enabled some higher-level GPIO interrupt mechanism, so I tried this also:

  attachInterrupt(pin, sampleClockISR, RISING);

... but that didn't work either.

I'm open to code examples, documentation, or even just interesting ideas. Thanks!!

  • rdp

Upon reflection, I realize that I've over-specified the problem. The real question should be: How can I get a rock-solid ISR callback at 8KHz without stepping on the Servo timers?