I'm trying to generate a pulse which lasts just one or two clock cycles (125ns~250ns) for triggering an external sample and hold buffer on a TM4C123GH6PM with 80MHz clock.
I can do this with the PWM module and it kind of works... the only problem is I can't seem to stop it and synchronising it is a pain (I need to be able to generate it on command, not at a repetitive frequency. I can zero the PWM counter, but I can't set the phase from what I can see in the API, which means the pulse occurs too late to be useful.)
If I drive the output directly through GPIOPinWrite (which I assume is fairly fast - it takes about 5 clock cycles) the pulse is too long because it still has to do all those clock cycles. Maybe there's a way to toggle the pin at the register level with two XORs for example; I haven't tried that yet.
I can't use the timer module because there doesn't appear to be a pulse generation option. I could use an external pulse generation solution but I'd prefer not to if there's a way to do it with the MCU.