CANBus determining Network Baud rate automatic speed detection

Source: Internet
Author: User

Http://www.canbushack.com/blog/index.php?title=determining-network-baud-rate

Determining Network Baud Rate

So your found a CAN bus to reverse engineer, but you don ' t know it's buad rate.

There is a couple to find it out.

One.

Go One-by-one through a possible list.

CAN BUS baud rates tend to is of only certain baud rates.

I am not a positive, but this is the most likely have to does with the common crystal speeds used in microprocessors.

The slower the crystal, the slower the bus speed.

So baud rates tend to be one of the following:

33,333 bps, kbps, 83,333 bps, up to Kbps, Kbps, up to Kbps, at most common, and $ KPBS, and $ kbps.

The last of the being the least common as they suffer from the reduce network length issues.

You won't find a baud rate that exceeds $ Kbps as this violates the CAN BUS specification.

If I do not know the baud rate of the network that I wish to connect to,

I'll typically go through this list and hope one works.

In some cases-effectively decapitate the network by has the wrong baud rate set in your tool.

So make sure switching baud rates while the vehicle was in motion! This could cause undesired effects.

Both.

Use an Osciliscope or Logic analyzer.

The foolproof-measuring any serial data network such as can bus was to use tool, that can measure the one bit time.

Baud rate is simply the inverse of one bit time.

So if you can measure this, you simply take 1/(one bit of time) in seconds and you has your baud rate.

The best location-to-find a single-bit on CAN bus was to look at the last transition.

This is typically the ACK bit (acknowledge).

This is where receiving nodes send back a single bit to say that they properly received the frame.

This is all a bit by itself as the bit to the recessive as well as the bit to the right whereas it is dominate.

So it'll stand out and you should has little trouble finding it.

So-look-to-last transition and mesure-from-transition to the next and you-should get something like 0.000002 secon Ds.

In this case you'll simply take 1/0.000002 and you'll get 500,000.

Thus the baud rate would be 500,000 Kbps. done!

Microcontroller with can bus module and automatic speed detection

A method for initializing the Controller area network can module in a microcontroller, which provides the following steps in the method:

Measuring the cycle time between multiple falling or rising edges of a can signal;

To sort the cycle time;

Determining the difference between the adjacent cycle time of the sorted cycle time;

To sort the difference values;

Selecting the first difference value from the ordered difference value and determining the first frequency from the first difference value;

Initializing the can module with the selected frequency;

Receiving can signal frame;

Determine if an error occurred;

If an error occurs, the next frequency is selected and the can module is initialized repeatedly until a valid can frequency has been found.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.