0
\$\begingroup\$

I would like to implement set auto baud rate in TMS470 as like STN2120 or ELM327.

ELM327 have a algorithm to select a auto baud rate by itself. can we implement in TMS470MF06607 controller?

I want an algorithm for that.

\$\endgroup\$
1
  • 2
    \$\begingroup\$ I'm voting to close this question as off-topic because it's not an acceptable question for this EE site. \$\endgroup\$
    – Andy aka
    Commented Feb 26, 2020 at 12:18

2 Answers 2

0
\$\begingroup\$

So, there's generally two ways of going about this:

  1. you know which kind of data to expect
  2. you fly blind

Data-aided clock recovery

Honestly, simply try out all rates until you receive something that makes sense. That's an algorithm. It boils down to a loop in which you simply configure the UART RX for a rate, wait for a time and check whether you received something sensible.

Blind clock recovery

If you don't know what kind of data to expect, then you also can't know what kind of data patterns make sense and which not.

In that case, you're running into the classical communications engineering symbol clock recovery problem. There's no "single algorithm" to do that, but it's pretty safe to say that you'll have to sample the RX very fast, and observe at which points a low-> high and high->low transition happens. Then, you'd do a bit of statistic on these times, to figure out how long a symbol probably is. That gives you your symbol rate.

General remark

If you don't know your baud rate, you probably also don't know your frame format, including stop- and parity bits, number of payload bits per frame and inter-frame spaces. That is quite a bit of search space that you're facing there, so this task is less "interesting" engineering as it is "implementing tests for a lot of parameters until things work out for all use cases", and you'll still have some error probability afterwards.

\$\endgroup\$
0
\$\begingroup\$

i am sorry to say but i was talking about CAN communication baud rate. and i think i got a reply for UART communication. So basically i am trying to do a auto baud rate in CAN communication. Take a example of OBD-II. So STN2120 have also a capacity to sens automatic protocol(Baud rate - 500kbps/11bit or 250kbps/29bit etc). Same thing I am also trying to implement with TMS470.

Is there any algorithm to implement a auto baud(protocol) selection.

\$\endgroup\$

Not the answer you're looking for? Browse other questions tagged or ask your own question.