(This is a follow-up to my last post about GPIO delay and capacitance.)
Looking again at the scope captures, I thought that the stray capacitance from boards and wires couldn't possibly account for the huge 18 microsecond delay. And my colleague, who has an actual education in these things, agreed. Thanks, Niels :)
Then we took a look at the base board schematic. And lo and behold:
A 100 nF capacitor right on the PIO1.13 line. Yes, it's called GPIO_21 in the schematic – it is slightly confusing but it is, in fact, PIO1.13. Removing the J33 jumper (thereby disconnecting PIO1.13 from the capacitor) and removing the 48 cycles delay it looked like this on the scope:
and like this on the logic analyzer.
Everyone is happy. Now off to cobble together some RS-485 code.