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

Add CANbus API #2527

Closed
tannewt opened this issue Jan 16, 2020 · 4 comments
Closed

Add CANbus API #2527

tannewt opened this issue Jan 16, 2020 · 4 comments

Comments

@tannewt
Copy link
Member

tannewt commented Jan 16, 2020

Add CAN bus API. Very common in cars and robots. https://en.wikipedia.org/wiki/CAN_bus

@skpang
Copy link

skpang commented Jan 16, 2020

Please add CAN and CAN FD support.

Teensy 4.0 have two CAN 2.0B and one CAN FD port.

@jepler jepler self-assigned this Aug 27, 2020
@jepler
Copy link
Member

jepler commented Aug 27, 2020

I am working on a CAN implementation for SAM E54 mcus. It will be called _canio and we're working on defining the initial scope and API structure. There are several different sketches of how the API might look, including https://gist.github.com/tannewt/89ee082de9f5a98675df901cdcfbe951 and http://zaphod.unpythonic.net/canio-provisional-docs/html/shared-bindings/_canio/index.html

@CarlFK
Copy link

CarlFK commented Aug 27, 2020

I'm new to canbus, so I am treading lightly.

I would like this to be exposed:

32.9.3 CAN mailbox registers
...
Bits 31:16TIME[15:0]: Message time stamp 
This field contains the 16-bit timer value captured at the SOF transmission.

p1108
https://www.st.com/resource/en/reference_manual/dm00031020-stm32f405-415-stm32f407-417-stm32f427-437-and-stm32f429-439-advanced-arm-based-32-bit-mcus-stmicroelectronics.pdf

I don't know if this is a general canbus thing that is expected to be available across all implementations, or STM32 specific.

If this is easy to accommodate in the CP module and just happens, great.

If it looks like this is a problem and thus passed over, can we plan for a way to make it possible for me to subclass so I don't have to maintain a fork of the whole module. This sounds like a good idea anyway.

I'll gladly help test and put some effort into this.

@tannewt tannewt modified the milestones: Long term, 6.x.0 - Features Aug 27, 2020
@skieast
Copy link

skieast commented Sep 1, 2020

Hardware mailboxes although relatively common arent available on all implementations. I'm guessing they could be emulated using filters and buffers. I'm definitely not an expert. Here is a short description on why they are nice,
https://forum.macchina.cc/t/canbus-mailboxes/710
They also have a lot of nice hardware and software for vehicle OBD2 / CAN exploration
Qt based cross platform canbus tool by Collin Kidder is used a lot for general CAN work https://github.com/collin80/SavvyCAN
He also has an arduino MCP2515 lib in his various repos.

@jepler jepler closed this as completed Nov 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants