2018-08-09 06:39 AM
Hey there i want to send and receive LIN Message through my MCU (STM32F091CCT6 - TJA1021T/10/C LIN Transreceiver). But i cant see any example code in documents.
Here what i did for this.
I select USART1 in LIN mode and USART2 Asynchronous mode to see console messages.
Here my clock configurations. My crystal has 12Mhz clock and i want to work at 48Mhz.
These are my parameter settings for LIN mode. I select to 19200bps for LIN limitations and i did not use interrupt for this USART.
After these settings i generate the code. I add delay for 500ms and send break signals.
HAL_Delay(500);
HAL_LIN_SendBreak(&huart1);
When i plugged in oscillator to uart pins i can see a break signal in 500 seconds like that.
After that problems start. I cant see any break messages in PLIN API(Peak PLIN USB Converter API to see LIN messages). I can understand that because break signals are not data signals. But when i try so sent data in code like
HAL_UART_Transmit(&huart1, 0x20BBCCDDEEFFDD11, 8, 10);
(0x20 is ID and rest of are data )
i cant see any data signal in oscilloscope and PLIN Viewer API.
I want to ask a sample example code. Because there is no example code in datasheet and ST documents. Datasheet only says flag status in LIN but CubeMx makes them automatically. Could you make an example code for LIN communications.
Regards
2018-08-09 06:40 AM
2018-08-09 06:41 AM
2018-08-09 06:41 AM
2018-08-09 06:41 AM