Help with delayMicroseconds() and UART init, inside an IRQ_UART0_STATUS function

Status
Not open for further replies.
DMX kinda sorta already has started to move to Ethernet, as E1.31 or Artnet protocol.

The 100 meter length and galvanic isolation of Ethernet transforms makes a lot of sense for lighting, especially compared to the relatively short distance of USB.
 
@Paul: Thank you for taking the time to update an old man! I know that you are busy with the T4 and I'll try to not to steal you more time with my ignorance.
 
I was wondering why 8 was better than a mere 5 or 6 UARTS on T_4. Other means can selectively go farther and/or faster and/or with CRC

There was ... some year ago ? ... some wondering about UART lag - though seems that was when active and new data to empty FIFO data went out on the next interrupt IIRC. Also seems some there was noted at that time a change elsewhere (outside PJRC) in AVR or other - a UART code change - but that doesn't remind me enough to find those (probably not relevant) posts.

@Paul: Thank you for taking the time to update an old man! ...

Easy there with throwing insults Thierry :) - AFAIK we are about the same age - assuming you were about 20 while in service ...
 
I think I found the issue. I'm taking this quote from Teensy 3.6's processor manual:

Setting C2[TE] automatically loads the transmit shift register with the following
preamble:

Basically, I was toggling the transmit-enable state. This explains this whole scenario. When enabling the transmitter on a UART, one character of preamble is shifted out.

I was keeping the transmitter off thinking that would be good practice if I'm not transmitting very often. I've decided to just keep it on.

[Update] I think that whenever the chip shifts something of its own into the shift register, be it a preamble or extra bit after transmitting a break via SBK, the timing is unknown and happens "concurrently" with other instructions.

[Update 2] Now, when I need to time something or delay after a transmitter-enable or using SBK (or anything else that affects the TX shift register), I simply add one character time to my timing parameter. The results are closer to what they should be, often a few bits longer than necessary, but that's what it is, I guess.
 
Last edited:
Status
Not open for further replies.
Back
Top