Forum Rule: Always post complete source code & details to reproduce any issue!
Page 2 of 2 FirstFirst 1 2
Results 26 to 30 of 30

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

  1. #26
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    19,536
    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.

  2. #27
    Senior Member+ Theremingenieur's Avatar
    Join Date
    Feb 2014
    Location
    Colmar, France
    Posts
    2,296
    @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.

  3. #28
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    7,839
    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.

    Quote Originally Posted by Theremingenieur View Post
    @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 ...

  4. #29
    Senior Member
    Join Date
    Jul 2014
    Posts
    2,052
    Quote Originally Posted by Theremingenieur View Post
    @Paul: Thank you for taking the time to update an old man!
    as long you are not proving your claim, being an old man, with a picture showing grey hairs, you are still young forever.

  5. #30
    Member
    Join Date
    Mar 2017
    Location
    Oakland, CA, USA
    Posts
    84
    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 by shawn; 11-16-2018 at 08:07 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •