Hi, I am trying to do some modifications for uart drivers for xmc4800 (on relax kit xmc 4800) and extending them to LIN drivers.
When I followed the documentation of Infineon reference manual for LIN support, in page 18-72 under
18.3.5 Hardware LIN Support gave some explaination as follows:
A complete LIN frame contains the following symbols:
Synchronization break:
The master sends a synchronization break to signal the beginning of a new frame. It
contains at least 13 consecutive bit times at 0 level, followed by at least one bit time
at 1 level (corresponding to 1 stop bit). Therefore, TBUF11 if the transmit buffer is
used, (or IN11 if the FIFO buffer is used) has to be written with 0 (leading to a frame
with SOF followed by 12 data bits at 0 level).
A slave device shall detect 11 consecutive bit times at 0 level, which done by the
synchronization break detection. Bit PSR.SBD is set if such an event is detected and
a protocol interrupt can be generated. Additionally, the received data value of 0
appears in the receive buffer and a format error is signaled.
Following that I have made changes in the following lines of code.
into following lines of code
But I am unable to generate break field for LIN following the documentation. Can anyone help in this.
When I followed the documentation of Infineon reference manual for LIN support, in page 18-72 under
18.3.5 Hardware LIN Support gave some explaination as follows:
A complete LIN frame contains the following symbols:
Synchronization break:
The master sends a synchronization break to signal the beginning of a new frame. It
contains at least 13 consecutive bit times at 0 level, followed by at least one bit time
at 1 level (corresponding to 1 stop bit). Therefore, TBUF11 if the transmit buffer is
used, (or IN11 if the FIFO buffer is used) has to be written with 0 (leading to a frame
with SOF followed by 12 data bits at 0 level).
A slave device shall detect 11 consecutive bit times at 0 level, which done by the
synchronization break detection. Bit PSR.SBD is set if such an event is detected and
a protocol interrupt can be generated. Additionally, the received data value of 0
appears in the receive buffer and a format error is signaled.
Following that I have made changes in the following lines of code.
Code:
if ( !(USIC_CH_TCSR_TDV_Msk & tmp_pChannel->TCSR) )
{
tmp_pChannel->TBUF[0] = ((arg_ByteToSend << USIC_CH_TBUF_TDATA_Pos) & USIC_CH_TBUF_TDATA_Msk);
}
Code:
int j =0;
while(j<12)
{
//tmp_pChannel->TBUF[j] &= ~(1 << tmp_pChannel->TBUF[j]);
tmp_pChannel->TBUF[j]=0;
j++;
}
Code:
if ( !(USIC_CH_TCSR_TDV_Msk & tmp_pChannel->TCSR) )
{
tmp_pChannel->TBUF[12] = ((arg_ByteToSend << USIC_CH_TBUF_TDATA_Pos) & USIC_CH_TBUF_TDATA_Msk);
}
But I am unable to generate break field for LIN following the documentation. Can anyone help in this.