Author Topic: Quasi-Levelshifter from 40 V LIN bus to UART  (Read 578 times)

0 Members and 1 Guest are viewing this topic.

Offline EheranTopic starter

  • Regular Contributor
  • *
  • Posts: 64
  • Country: de
Quasi-Levelshifter from 40 V LIN bus to UART
« on: March 15, 2024, 12:38:05 pm »
I am trying to build a converter from 1-wire LIN bus to UART. Since I do not just want to read, but also write data to the LIN bus, I need more than just a simple voltage divider to get from the 40 V LIN rail down to 5 V. See this circuit simulation where I am right now. Note 3 connections on the left (V+, LIN bus, GND) and 4 on the right (V+, Rx, Tx, GND). The 2 switches are just to simulate the signals. Receiving signals (LIN -> Rx) kinda-sorta works, so closing and opening the left switch (=LIN bus) changes the Rx pin to the right. However, Tx (switch at the bottom right) does not change the LIN bus if that is currently high (which it normally is) and is also directly appearing on the Rx pin. The same happened when I build this circuit in hardware, Tx is appearing on Rx.

Could someone have a look and help me figure this out? I am way out of my depth with this kind of stuff.
 

Offline voltsandjolts

  • Supporter
  • ****
  • Posts: 2300
  • Country: gb
Re: Quasi-Levelshifter from 40 V LIN bus to UART
« Reply #1 on: March 15, 2024, 01:28:08 pm »
Why not just use a 40V capable LIN transceiver IC?
 

Offline EheranTopic starter

  • Regular Contributor
  • *
  • Posts: 64
  • Country: de
Re: Quasi-Levelshifter from 40 V LIN bus to UART
« Reply #2 on: March 15, 2024, 01:46:14 pm »
The high voltage is an issue, they usually operate on 12 and 24 V in vehicles. I found this TLIN2029, but availability is low unless I pay the massive Mouser shipping fees. It would also be more complex. Hence I am looking for such a simple solution.
 

Offline voltsandjolts

  • Supporter
  • ****
  • Posts: 2300
  • Country: gb
Re: Quasi-Levelshifter from 40 V LIN bus to UART
« Reply #3 on: March 15, 2024, 07:56:24 pm »
I would say the simpler solution is to use a LIN transciever IC, it's an 8 pin chip for ~$1
Try LCSC with shipping from $5, and save by combining with your JLCPCB order.
e.g.

https://www.lcsc.com/product-detail/LIN-Transceivers_Texas-Instruments-TLIN2029ADRQ1_C3235078.html
 

Offline EheranTopic starter

  • Regular Contributor
  • *
  • Posts: 64
  • Country: de
Re: Quasi-Levelshifter from 40 V LIN bus to UART
« Reply #4 on: March 17, 2024, 07:16:55 pm »
That would be 31 € for one of them because of shipping (again, low availability). I have never ordered anything from JLCPCB.
 

Offline voltsandjolts

  • Supporter
  • ****
  • Posts: 2300
  • Country: gb
Re: Quasi-Levelshifter from 40 V LIN bus to UART
« Reply #5 on: March 17, 2024, 07:52:08 pm »
That would be 31 € for one of them because of shipping (again, low availability).
You seem worried about availability, yet only want to order one.
LCSC have >200 in stock and it's under $10 to get 1 or $21 for 16, delivered by international registered mail 7-14 days.

Quote
I have never ordered anything from JLCPCB.
It's good to try new things. JLCPCB and LCSC work well for me.

Are you trying to build your circuit only with parts you already have, so you don't need to order anything?
 

Offline langwadt

  • Super Contributor
  • ***
  • Posts: 4427
  • Country: dk
Re: Quasi-Levelshifter from 40 V LIN bus to UART
« Reply #6 on: March 17, 2024, 08:09:33 pm »
is that switch to 40V supposed to simulate a high on the LIN bus? that's wrong, the bus is high by default, everything else should only pull down.

that fastad junk is without a doubt the worst POS software I have ever seen, how is it even possible to make something that bad
 

Offline EheranTopic starter

  • Regular Contributor
  • *
  • Posts: 64
  • Country: de
Re: Quasi-Levelshifter from 40 V LIN bus to UART
« Reply #7 on: March 18, 2024, 07:53:17 am »
Quote
is that switch to 40V supposed to simulate a high on the LIN bus?

Yes. Not much changes when I add a resistor in series to the 40 V "LIN bus" node. Tx still triggers Rx. Is there a different software I can use to predict the outcome of such a circuit?

Quote
You seem worried about availability, yet only want to order one.

Yes, one (or 5) for a reasonable price. Not for 30 €, which is the price for shipping I pay in Europe. That is a waste of money and resources I am not willing to pay. With availability I indeed mean locally for me, not that you could not get it in general when making 1'000s of devices.

Quote
Are you trying to build your circuit only with parts you already have, so you don't need to order anything?

At least without special ICs because of their low/non-existent local availability.
 

Offline langwadt

  • Super Contributor
  • ***
  • Posts: 4427
  • Country: dk
Re: Quasi-Levelshifter from 40 V LIN bus to UART
« Reply #8 on: March 18, 2024, 01:24:49 pm »
Quote
is that switch to 40V supposed to simulate a high on the LIN bus?

Yes. Not much changes when I add a resistor in series to the 40 V "LIN bus" node. Tx still triggers Rx. Is there a different software I can use to predict the outcome of such a circuit?


don't add a series resistor, all device including the master only have a switch to ground, high is default with pull up resistors 

Tx being "echoed" on Rx is expected and how LIN transceivers work, that is also how you can detect colliions
 

Offline zapta

  • Super Contributor
  • ***
  • Posts: 6190
  • Country: us
Re: Quasi-Levelshifter from 40 V LIN bus to UART
« Reply #9 on: March 18, 2024, 08:00:00 pm »
Tx being "echoed" on Rx is expected and how LIN transceivers work, that is also how you can detect colliions

Are collisions an issue with Lin bus? I had the impression that the master assigns the slaves unique time slots to respond to transmit.
 

Offline langwadt

  • Super Contributor
  • ***
  • Posts: 4427
  • Country: dk
Re: Quasi-Levelshifter from 40 V LIN bus to UART
« Reply #10 on: March 18, 2024, 09:16:22 pm »
Tx being "echoed" on Rx is expected and how LIN transceivers work, that is also how you can detect colliions

Are collisions an issue with Lin bus? I had the impression that the master assigns the slaves unique time slots to respond to transmit.

I've never use LIN, but afaict there's something called "event triggered frames" where a master can ask multiple slave simultaneous if some event happened, if only one answers all is good, if more than one answers there's a collision and the master will have to fall back to asking each in turn

https://lipowsky.com/downloads/Software/LIN-Basics_for_Beginners-EN.pdf
« Last Edit: March 18, 2024, 09:18:39 pm by langwadt »
 

Offline EheranTopic starter

  • Regular Contributor
  • *
  • Posts: 64
  • Country: de
Re: Quasi-Levelshifter from 40 V LIN bus to UART
« Reply #11 on: March 19, 2024, 02:20:29 pm »
I think my LIN-bus generally has some hardware issue. Look at the waveform attached. That is everything but what I find when I google for LIN-bus waveforms. It is also, for an unknown reason, only pulled up to ~12 V. I had a similar waveform earlier with the nominal 40 V.

Regarding the Lin<->UART converter, I found ATA6661 on Aliexpress. So I spend 7 € for 5 of them and now have to wait 2/3 weeks.

Quote
Tx being "echoed" on Rx is expected and how LIN transceivers work, that is also how you can detect colliions

Thank you for this important detail. I was unaware that actual LIN transceivers show the same behavior.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf