AnsweredAssumed Answered

Coldfire SCI Transmit Errors

Question asked by ROBERT RITCHEY on Mar 5, 2014
Latest reply on Mar 8, 2014 by TomE

I have a strange problem happening on transmit.  The first or second character of my transmit sequence gets stepped on but only every 1000 or so transmits.  The code is completely interrupt driven.  I have a MCF51JM running at 48MHz and transmitting the serial at 100K baud.  I transmit a message to another device on the bus and it sends back a message.  I have a loop of the exact same message going on.  The transmit message should start out as 0x01, 0x00, 0x78.  It works great except for about once in 1000 transmits then one of the first two bytes gets stepped on.  I see 0x01, 0x78 or 0x00, 0x78 transmitted.  I can breakpoint on a timeout as the other device will not respond to this message.  When I check the transmit buffer it is correct.  It seems as if the TDRE interrupt happens once too often.  I seem to be reloading the transmit buffer too fast and a value gets stepped on.  Its as though TDRE stays set after I leave the interrupt routine and I get interrupted back into the routine before the transmit data register moves to the transmit register.  Looking for a solution?  Thanks,

Outcomes