I was wondering about the following: generally, in MCUs, are there typically facilities for "real-time" copying/buffering an input pin's state to another (output) pin?
Typically, I would set up, say:
- GPIO port A pin 0 (GPIOA0) as input
- GPIO port B pin 0 (GPIOB0) as output
- set up an interrupt on any bit transition read on GPIOA0
- in the interrupt handler, do (Arduino-like pseudocode)
void isr_transition_gpioa0(void)
{
int a0value = digitalRead(GPIOA0);
digitalWrite( GPIOB0, a0value );
}
In effect, the signal output on GPIOB0, is a buffered (and slightly delayed) version of the digital signal brought to the input pin GPIOA0; or in other words, the output copy is a buffered copy of the input signal.
My thinking was: in principle, if one wanted buffering like this, it could also be done by a hardware standalone buffer/repeater -- if such was present on the MCU, it would probably be possible to set up a register, to say: ok, map pin GPIOA0 to input of buffer A, and map output of buffer A on pin GPIOB0; then this buffering would be performed in "real-time" (disregarding latency in the buffer itself), and in parallel with whatever the CPU of the MCU does (so no chances of delaying a transition because the ISR was delayed/preempted). And then, whenever you "break" this link on a register level, the "copying" stops, so this facility could also act as a signal "gate".
However, looking at either Atmel or STMicro, I could not find anything specific about this kind of a setup -- so it is likely that such a facility is simply not present on MCUs.
But, taking the slight chance that the facility might be there, I just lack the correct terminology to look it up - is there anything like this on any brand of MCUs?