0
\$\begingroup\$

I generate ADC digital comparator interrupts. I want to use this interrupt to trigger Input Capture module. To achive precise timing it will be better to directly trigger IC module with ADC digital comparator interrupt. I couldn't find a solution to do this. If I can trigger GPIO pins or other modules with this interrupt to generate a signal on the output pins, this can be used as a IC input signal. I guess DMA can triggered and can be use with ADC digital comparator interrupt. But i can't use DMA module.

Is there a way to do this?

\$\endgroup\$
1
  • \$\begingroup\$ Which Pic32MZ? Unless you specify, it's anyone's best guess \$\endgroup\$
    – Reinderien
    Commented Oct 1, 2023 at 2:26

1 Answer 1

1
\$\begingroup\$

Let's make a wild guess that you're using a DS60001320H-compatible "PIC32MZ Embedded Connectivity with Floating Point Unit (EF) Family" device.

Let's also make a wild guess that you're using one of the ADCCMPENx/ADCCMPCON1 comparator channels.

The input capture module explicitly only pays attention to a pin for capture events:

input capture

so one simple option is to route pin C1OUT (from one of the analog comparators, not an ADC digital comparator) to pin IC1. This has the advantage that you could add a test pad to probe timings.

Failing that you're stuck with software. At 252 MHz, a single interrupt-and-bitset should not cause too much delay.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.