cancel
Showing results for 
Search instead for 
Did you mean: 

Could the STM8AL board of STMA-Discovery kit be debuged and connected to Peak Lin at the same time ?

ZElya.1
Associate II

Hello, I have a question about STMA-Discovery Boards. 

I want to use just one board which is STM8AL one, without connecting it with STM8AF, and i want to make LIN communication using Peak Lin (which requires an exterior 12V power supply).

Normally to debug the stm8 board it is done through the USB power cable (5V) but if I want to debug and connect Peak LIN at the same time the board will be connected to 5V (from the debug cable) and to 12V (from the exterior power source) at the same time !

My question here is this connection correct, I am afraid to burn the board or the PC.

En the datasheet i understand that the board already generates 12V, but i am wondering how to connect the Peak lin (because i think they have to be connected to the same ground).

5 REPLIES 5
Peter BENSCH
ST Employee

Welcome, @ZElya.1​, to the community!

With LIN, communication runs via a single line to which the participants are connected with open-collector or open-drain and which is connected to 12V via a pull-up.

If the STM8AL (MB1037) is supplied with 5V, however, this has nothing to do directly with the 12V on the LIN line. The STM8AL also contains a CAN/LIN transceiver L99PM62, which converts the UART signals LIN_RX and LIN_TX to the 12V level of LIN.

You can therefore safely connect the LIN line at CN4.4 to another LIN device.

Does it answer your question?

Regards

/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
ZElya.1
Associate II

Hello, thank you For your answer.

Okey so I understand that the board could be connected to the USB cable (5V) and to the exterior Vbat (12V) at the same time and without any problem, okey nice.

my doubt here is: when you said

"You can therefore safely connect the LIN line at CN4.4 to another LIN device"

because for me, what I had in my mind was to connect Peak lin like that:

  1. GND -> GND at P2.8 of the board
  2. 12V -> VBAT at P2.9 of the board
  3. LIN -> LIN at JP3.3 of the board

Is this connection wrong ?

If it is wrong and I had to do it like you said, so why CN4 and not CN3, plus where can I connect GND in that case ?

Thank you

Best regards

OK, CN3 and CN4 are connected pin for pin, except that CN3 is a female connector and CN4 is a male connector. However, LIN is not available on pin 3, but on pin 4 respectively.

Connector P2 is actually more for access to U12 (L99PM62), it would be better to use GND on CN3 or CN4 to avoid confusion. GND is otherwise identical, of course.

The 12V don't need to be fed externally, because as you have already seen, they are alternatively generated on the STM8AL board when the board is connected to USB and gets USB5V.

So it should be sufficient to make the LIN connection to your LIN device from Peak via CN3.3 (GND) and CN3.4 (LIN).

If the problem is resolved, please mark this topic as answered by selecting Select as best under your preferred answer. This will help other users find that answer faster.

Good luck!

/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
ZElya.1
Associate II

Hello, Thank you for your response.

I connected it as you have said it seems that it works but...

I've downloded in it the project from the st website "STM8A-DISCOVERY boards firmware package, including LIN communication (AN4101)", but when I try to send and receive data from peaklin it gave me always "slave not responding, timeout".

0693W00000Nrm2DQAR.png  

I don't know if I am missing something, could you please help me.

Thank you.

Kind regards.

Hello,

I will add here more information about the debugging, it seems that the data sent from the master is received correctly, and the function "USART_SendData8" responsible of sending frame from uc to the master is executed but i still get "slave not responding, timeout"

I am confused Idon't know where the problem is !

Thank you in advance