Suppose I have an external trigger signal A, and I want to create a signal B in response to that signal as follows:

At each point:
- Signal A goes low. I want to detect this and do some setup.
- After the desired setup, I want to manually set signal B low (through some currently unknown means).
- Signal A goes high, and at the same time B should go high with as little latency as possible.
The approach that I tried at the moment is as follows:
- Signal A is put on one of the trigger pins on the RT1010, specifically on GPIO_AD_07.
- Initial configuration:
- GPIO_AD_07 iomux is set as an input GPIO. Interrupt for falling edge is enabled and handler is implemented.
- A FlexIO timer is set to enable with FLEXIO1_TRIGGER_IN0 (XBAR1_OUT00) as trigger. This timer is set up to control signal B, mirroring the trigger signal.
- XBAR1_IN01 (LOGIC_HIGH) is selected for XBAR1_OUT00.
In the event that signal A goes low:
- Interrupt handler for GPIO_AD_07 triggers.
- In the interrupt handler, GPIO_AD_07 iomux is set to XBAR1_INOUT3. The GPR6 register is configured to select XBAR1_IN03.
- XBAR1_IN01 (LOGIC_HIGH) is replaced with XBAR1_IN03 for XBAR1_OUT00.
However, this does not work. Signal B remains high even as signal A changes. I’ve verified that if the following are set from the very beginning:
- GPIO_AD_07 iomux set to XBAR1_IN03.
- FLEXIO1_TRIGGER_IN0 (XBAR1_OUT00) set to XBAR1_IN03.
Signal B, which is controlled with said timer, mirrors Signal A with around 0.5-1.5 cycle latency due to pin synchronization as mentioned in the reference manual’s FlexIO chapter. So at least I know my timer config is correct.
Why is this approach not working? Are there other approaches you can recommend?