eriksl wrote:I don't know the mnemonics you're using. You mean these:
UART_TXFIFO_CNT = 0x000000ff, /* REG_UART_BASE(i) + 0x20) */
that's what I was referring to. This value should auto-increment each time you add a byte to the queue and auto-decrement for each byte actually sent. So it should go 0 -> 1 -> 0 if you send one byte.
https://github.com/esp8266/Arduino/blob ... eri.h#L207
This is what I am referring to...
eriksl wrote:If you need real precise control of the bit pattern, you may need to look at alternatives and how to "abuse" them, like the SPI interface or the I2S interface.
SPI is already in use... I don't need control of the pattern, just the timing of one pulse.
eriksl wrote:Actually there may very well be a register that mirrors the pin, but as usual it's not documented so we'll never know. Blame Espressif.
Sure, there is one, and it's documented:
https://github.com/esp8266/Arduino/blob ... eri.h#L253
This is the one that is not working in my example code. I'm really curious though why the USTX flag is not working as it should. Either I misunderstood what it is supposed to do, or I found a hardware bug...
Also, I tried what happens if I generate another pulse before the first one finished. In this case, a second pulse is immediately appended after the first one.
I think this is because UART1 only has a one register fifo and immediately starts sending the data when you write to the fifo. My observation implies that the fifo then also immediately would accept new data since the first four bytes are already handled by the UART hardware.
This would imply that if I only send on byte (which is what I do), the interrupt or flag that would tell me if the fifo is ready to accept new data, would immediately fire after the pulse started, but not actually when it finished.