Seeed-Studio / Seeed_Arduino_CAN

Seeed Arduino CAN-BUS library - MCP2518FD&MCP2515&MCP2551
MIT License
828 stars 442 forks source link

1Mbit - really? #67

Closed vinnitu closed 3 years ago

vinnitu commented 6 years ago

have stm32f103 with tja1050 - and I can communicate with rasp

oscilator=16000000 bitrate 1000000 in /etc/network/interfaces but it is not 1Mb! It is more like ~140Kb (UPDATED: it is 500000bps) why?

now I try connect arduino uno + mcp2515 + mcp2551 + 8000 oscilator via spi 1Mb - and it doesnt work...

If I change bitrate to 500Kb - it works (< 500 ofcause) but I need 1Mb - what i need to do? is it possible in general?

koulombus commented 6 years ago

I have an 16000 oscilator and setup with CAN_500KBPS. When I check with CANalystII the baud rate is 250k bps and not 500. Some thing is wrong here?

jerryyip commented 6 years ago

@vinnitu What is tfj1050? And which can-bus module you used on pi? Can you provide your testing method? Thanks.

jerryyip commented 6 years ago

@cawena oscillator has nothing to do with the can-bus speed. Can you provide more information?

koulombus commented 6 years ago

The init of the can bus is like that: while (CAN_OK != CAN.begin(CAN_500KBPS)) {} The settings in the CANalyst-II for the CANBus are 250kbps, so that I can receive data.

vivekkairi commented 5 years ago

@cawena Any updates? Cuase even I'm facing half speed issue.

greghol commented 4 years ago

For the people having speed issues it is because the examples are not correct when setting bit rate. The crystal freq param needs to be used in CAN.begin(). see implementation of the call. See #93

greghol commented 4 years ago

@cawena oscillator has nothing to do with the can-bus speed. Can you provide more information?

The crystal osc does have something to do with the can bus speed. How does it transmit and how does it sync up with incoming packet and pick the sample points for each bit? The examples are not using CAN.begin() correctly. See #93.

Pillar1989 commented 3 years ago

If you feel you need to continue the discussion, you can reopen the issues.