From: Marc Kleine-Budde <mkl@pengutronix.de>
To: linux-can <linux-can@vger.kernel.org>
Subject: bit-timing and sample point
Date: Wed, 13 Apr 2016 12:32:59 +0200 [thread overview]
Message-ID: <570E205B.7030900@pengutronix.de> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 2215 bytes --]
Hello,
currently I'm reworking the bit timing algorithm. I've changed the
algorithm to minimize first the bit rate error and then the sample point
error within the best bit rate.
The old algorithm always picks a sample point less than the target
sample point. My question to the CAN exports: Is it better to stay below
the sample point or minimize the error (and pick a sample point slightly
above the nominal sample point)?
See the below table for the output of the calculation. There are three
entries per bit rate:
1) original algorithm
2) improved algorithm, smaple point is always below nominal sample point
3) improved algorithm, sample point error is minimized
> Bit timing parameters for mscan with 66.666666 MHz ref clock
> nominal real Bitrt nom real SampP
> Bitrate TQ[ns] PrS PhS1 PhS2 SJW BRP Bitrate Error SampP SampP Error BTR0 BTR1
> 1000000 90 3 4 3 1 6 1010101 1.0% 75.0% 72.7% 3.1% 0x05 0x26
> 1000000 90 3 4 3 1 6 1010101 1.0% 75.0% 72.7% 3.1% 0x05 0x26
> 1000000 45 8 8 5 1 3 1010101 1.0% 75.0% 77.2% 2.9% 0x02 0x4f
> 800000 180 2 2 2 1 12 793650 0.8% 80.0% 71.4% 10.8% 0x0b 0x13
> 800000 90 5 5 3 1 6 793650 0.8% 80.0% 78.5% 1.9% 0x05 0x29
> 800000 60 8 8 4 1 4 793650 0.8% 80.0% 80.9% 1.1% 0x03 0x3f
> 500000 285 2 2 2 1 19 501253 0.3% 87.5% 71.4% 18.4% 0x12 0x13
> 500000 105 7 8 3 1 7 501253 0.3% 87.5% 84.2% 3.8% 0x06 0x2e
> 500000 105 8 8 2 1 7 501253 0.3% 87.5% 89.4% 2.2% 0x06 0x1f
> 250000 570 2 2 2 1 38 250626 0.3% 87.5% 71.4% 18.4% 0x25 0x13
> 250000 285 5 6 2 1 19 250626 0.3% 87.5% 85.7% 2.1% 0x12 0x1a
> 250000 285 5 6 2 1 19 250626 0.3% 87.5% 85.7% 2.1% 0x12 0x1a
Which algorithm is preferred?
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Industrial Linux Solutions | Phone: +49-231-2826-924 |
Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 455 bytes --]
next reply other threads:[~2016-04-13 10:33 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-13 10:32 Marc Kleine-Budde [this message]
2016-04-14 10:26 ` bit-timing and sample point Kurt Van Dijck
2016-04-14 10:47 ` Marc Kleine-Budde
2016-04-14 12:19 ` Kurt Van Dijck
2016-04-14 12:32 ` Marc Kleine-Budde
2016-04-14 12:46 ` Ramesh Shanmugasundaram
2016-04-14 12:57 ` Marc Kleine-Budde
2016-04-14 13:05 ` Ramesh Shanmugasundaram
2016-04-14 14:06 ` Marc Kleine-Budde
2016-04-14 14:13 ` Ramesh Shanmugasundaram
2016-06-17 9:46 ` Ramesh Shanmugasundaram
2016-06-17 9:59 ` Marc Kleine-Budde
2016-06-17 10:02 ` Ramesh Shanmugasundaram
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=570E205B.7030900@pengutronix.de \
--to=mkl@pengutronix.de \
--cc=linux-can@vger.kernel.org \
/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.