All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: Patrick Menschel <menschel.p@posteo.de>
Cc: "linux-can@vger.kernel.org" <linux-can@vger.kernel.org>
Subject: Re: [RFC] K-Line protocol via SocketCAN
Date: Sun, 22 May 2016 23:11:33 +0200	[thread overview]
Message-ID: <57422085.6040606@denx.de> (raw)
In-Reply-To: <57421634.5050607@posteo.de>

On 05/22/2016 10:27 PM, Patrick Menschel wrote:
>>> I remember a K-Line implementation for Linux where we had a MPC5200 UART
>>> which we programmed with bit-banging of some control line to do the
>>> 5bit/s opening pattern.
>>> After that we went to 10400 bit/s and did some K-Line communication.
>>> All this was done by a user space application on /dev/ttyS0.
>>
>> Yes, and this does make perfect sense until you start dealing with
>> faster modes and need more precise timing. The K-Line is limited by
>> 250kBaud/s bus speed.
>>
> 
> Hello Marek,

Hi!

> Afaik there is no ECU left that actually needs the "5 Baud INIT".
> Most ECUs use the "FAST INIT" procedure, means 25ms low, 25ms high, then
> start communication with 10400Baud.

We really do need to support both the slow and fast mode.

> The nasty part are the 25ms low, 25ms high , that is also prior to the 5
> Baud Init pattern.
> 
> After that, everything on the K-Line is pure serial communication.

True

> I've done a few test myself with an FT232RL based KKL-Interface and
> these 25ms low, 25ms high are very hard to realize. No Success at my end.

I wouldn't be surprised if the USB added a lot of non-determinism into
the timing. I use standard 16550 compatible UART core mapped in the CPU
address space.

> From my point of view, the 25ms low, 25ms high are the only reason to
> move into kernel space and possibly switch the Tx Pin to GPIO and pull
> it low/high for 25ms, then switch it back to UART.

That's only part of it, see my previous email in this thread where I
listed some more reasons.

These 25ms low-high might possibly be realized by serial break, no ?

> Regards,
> Patrick
> 
> 


-- 
Best regards,
Marek Vasut

  reply	other threads:[~2016-05-22 21:11 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-19 23:15 [RFC] K-Line protocol via SocketCAN Marek Vasut
2016-05-20  6:04 ` Mirza Krak
2016-05-20  6:28   ` Oliver Hartkopp
2016-05-20 11:59     ` Marek Vasut
2016-05-22 20:27       ` Patrick Menschel
2016-05-22 21:11         ` Marek Vasut [this message]
2016-06-01  2:26       ` Marek Vasut
2016-06-05 12:07         ` Oliver Hartkopp
2016-06-09 15:00           ` Marek Vasut
2016-06-09 18:29             ` Oliver Hartkopp
2016-06-09 19:21               ` Marek Vasut
2016-06-09 20:12                 ` Oliver Hartkopp
2016-06-11 19:42                   ` Marek Vasut
2016-06-12 19:28                     ` Oliver Hartkopp
2016-06-13 22:07                       ` Marek Vasut
2016-06-14  6:10                         ` Oliver Hartkopp
2016-06-15  3:42                           ` Marek Vasut
2016-06-15  6:57                             ` Oliver Hartkopp
2016-06-15 11:05                               ` Marek Vasut

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=57422085.6040606@denx.de \
    --to=marex@denx.de \
    --cc=linux-can@vger.kernel.org \
    --cc=menschel.p@posteo.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.