Sending A Frame

  1. 1.Write TXEN and RXEN in US_CR to enable both the transmitter and the receiver.
  2. 2.Write USART_MODE in US_MR to select the LON mode configuration.
  3. 3.Write CD and FP in US_BRGR to configure the baud rate.
  4. 4.Write COMMT, COLDET, TCOL, CDTAIL, RDMNBM and DMAM in US_LONMR to configure the LON operating mode.
  5. 5.Write BETA2, BETA1TX, BETA1RX, PCYCLE, PSNB, NPS, IDTTX and ITDRX respectively in US_FIDI, US_LONB1TX, US_LONB1RX, US_TTGR, US_LONPRIO, US_LONIDTTX and US_LONIDTRX to set the LON network configuration.
  6. 6.Write TX_PL in US_MAN to select the preamble pattern to use.
  7. 7.Write LONPL and LONDL in US_LONPR and US_LONDL to set the frame transfer.
  8. 8.Check that TXRDY in US_CSR is set to 1.
  9. 9.Write US_LONL2HDR register to send the header.
  10. 10.Wait until TXRDY in US_CSR rises.
  11. 11.Write TCHR in US_THR to send a byte.
  12. 12.If all the data have not been written, redo the two previous steps.
  13. 13.Wait until LTXD in US_CSR rises.
  14. 14.Check the LON errors.
    Figure 1. Tx Frame