I have programmed according to the way of generating break signal provided by the manual, but it seems that the signal cannot be generated successfully. I request to provide the sample code of usart0 sending messages in lin mode (including initial configuration).
Hi,
It appears that your code has issue.
Pls refer to section 25.7.9 for break generation.
void Lin_SendBreak(void)
{
//set the Lin mode
UART0-CFG|=1<<8;
//send break
USRT0->CTRL|=1<<1;
while(USRT0->CTRL&0x02) {}
}
Pls have a try.
BR
XiangJun Rong
your CTRL(BIT 1)not need to clear?the usermenu say the send break until the bit clear。
Hi,
The usermenu say the send break until the bit clear, so I use the following code to poll the bit 1 until it is cleared.
USRT0->CTRL|=1<<1;
while(USRT0->CTRL&0x02) {}
BR
XiangJun Rong