Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible addition? #3

Open
kdschlosser opened this issue Dec 27, 2020 · 3 comments
Open

Possible addition? #3

kdschlosser opened this issue Dec 27, 2020 · 3 comments
Labels
help wanted Extra attention is needed

Comments

@kdschlosser
Copy link

I have something that might be of interest that can expand this library so it can support the full gambit of bitrates the interface is able to do.

Right now the only bitrates that are supported are the ones that are in a hard coded table. The attached file calculates the bit timing registers using the bitrate as an input. It can also be tweaked by using the sample point and synchronization jump width as input parameters as well.

The code I wrote supports a bunch of different CAN interface chip families

can_bitrate.zip

I can do up a PR if it is something that would be added, just let me know.

@ladyada
Copy link
Member

ladyada commented Dec 27, 2020

yes! PRs are welcome! here is a tutorial that can help
https://learn.adafruit.com/contribute-to-circuitpython-with-git-and-github

@kdschlosser
Copy link
Author

It will be little while until I do any kind of a PR for this. I needed to be able to calculate the timing registers because of using a non standard bitrate. I figured instead of hard coding the timings into my code I would go this route. I still have to test out the library for functionality which won't be for a little while.

I am retrofitting my vehicles headlamps with curve adaptive and horizon adaptive HID's (2 projectors per headlamp). I have most of the mechanical aspects all sorted out and now I am putting together the code. It should hopefully be only a few days until I am done with the code portion of it then I have to put everything together and iron out any bugs.

The bitrate calculator above is a really important tool and makes it really easy for the user to be able to connect the interface. It also makes it easier to add bitrate discovery to make more of plug and play type of device.

because the most common use of CAN-Bus is in the automotive sector for vehicle diagnostics and communications you should consider putting together a library for OBDII vehicle communications. Other manufacturers of CAN interfaces provide at least a small code block that demonstrates how to use the interface with OBDII. This is something that I do have pretty extensive knowledge on and can put together if there is interest.

@ladyada ladyada added the help wanted Extra attention is needed label Dec 27, 2020
@ladyada
Copy link
Member

ladyada commented Dec 27, 2020

sure, if someone would like to add support, we're happy to help and merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants