Quasi-Levelshifter from 40 V LIN bus to UART - Page 1
Forum section: electronics / projects

author: Eheran
author_rank: Regular Contributor
timestamp: March 15, 2024, 12:38:05 pm
content: 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 simulationwhere 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.

author: voltsandjolts
author_rank: Unknown
timestamp: March 15, 2024, 01:28:08 pm
content: Why not just use a 40V capable LIN transceiver IC?

author: Eheran
author_rank: Regular Contributor
timestamp: March 15, 2024, 01:46:14 pm
content: The high voltage is an issue, they usually operate on 12 and 24 V in vehicles. I foundthis 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.

author: voltsandjolts
author_rank: Unknown
timestamp: March 15, 2024, 07:56:24 pm
content: I would say the simpler solution is to use a LIN transciever IC, it's an 8 pin chip for ~$1Try 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

author: Eheran
author_rank: Regular Contributor
timestamp: March 17, 2024, 07:16:55 pm
content: That would be 31 € for one of them because of shipping (again, low availability). I have never ordered anything from JLCPCB.

author: voltsandjolts
author_rank: Unknown
timestamp: March 17, 2024, 07:52:08 pm
content: Quote from: Eheran on March 17, 2024, 07:16:55 pmYou 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.QuoteIt'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?

author: langwadt
author_rank: Super Contributor
timestamp: March 17, 2024, 08:09:33 pm
content: 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

author: Eheran
author_rank: Regular Contributor
timestamp: March 18, 2024, 07:53:17 am
content: QuoteYes. 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?QuoteYes, 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.QuoteAt least without special ICs because of their low/non-existent local availability.

author: langwadt
author_rank: Super Contributor
timestamp: March 18, 2024, 01:24:49 pm
content: Quote from: Eheran on March 18, 2024, 07:53:17 amdon't add a series resistor, all device including the master only have a switch to ground, high is default with pull up resistorsTx being "echoed" on Rx is expected and how LIN transceivers work, that is also how you can detect colliions

author: zapta
author_rank: Super Contributor
timestamp: March 18, 2024, 08:00:00 pm
content: Quote from: langwadt on March 18, 2024, 01:24:49 pmAre collisions an issue with Lin bus? I had the impression that the master assigns the slaves unique time slots to respond to transmit.

author: langwadt
author_rank: Super Contributor
timestamp: March 18, 2024, 09:16:22 pm
content: Quote from: zapta on March 18, 2024, 08:00:00 pmI'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 turnhttps://lipowsky.com/downloads/Software/LIN-Basics_for_Beginners-EN.pdf

author: Eheran
author_rank: Regular Contributor
timestamp: March 19, 2024, 02:20:29 pm
content: 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 foundATA6661on Aliexpress. So I spend 7 € for 5 of them and now have to wait 2/3 weeks.QuoteThank you for this important detail. I was unaware that actual LIN transceivers show the same behavior.