AnsweredAssumed Answered

UART TXDATA last byte missing

Question asked by ATHMESH NANDAKUMAR on Jan 14, 2019
Latest reply on Jan 16, 2019 by Kerry Zhou

Data from UART is missing last byte using the following code snippet.  

 

 rs485_tx_mode();                                                    //Setting as Transmission
 for(mb=0;mb<u8ModbusADUSize;mb++)               //u8ModbusADUSize = 8
 {
  while(~LPC_USART0->STAT & (1<<3)); 
  LPC_USART0->TXDATA = u8ModbusADU[mb];
 }
 while(~LPC_USART0->STAT & (1<<3)); 
 rs485_rx_mode();                                                 //Setting as Reception

u8ModbusADUsize is 8, and the u8ModbusADU[7] is missing during continuous run. But while debugging step-by-step we are getting the full output including u8ModbusADU[7]. 

 

Processor : LPC1517

IDE            : MCUXpresso 

Clock          :   Internal Clock

Thanks and Regards,

Athmesh Nandakumar

Attachments

Outcomes