McNeight / CAN_Library

Multiplatform Arduino library for supporting the native CAN controller on Due (SAM3X) and Teensy 3.1 (K2X) as well as MCP2515 through SPI
Other
95 stars 43 forks source link

MCP215 and teensy #4

Closed ludoboss777 closed 7 years ago

ludoboss777 commented 8 years ago

Hi. I'm just trying to use the library to create a canbus beetwen teensy boards and arduinos.

I can, with the example, send and receive message from a teensy board to another teensy board with the example.

But i can't send or receive message from an arduino to another with the sample example !! I have an MCP 2515 connect to him. all connection are good+ 16mhz oscillator.

Do you have some example for each module. one for mcp25-15 (send and receive) and one for teensy.

i want to create a canbus beetween an arduino and a teensy board.

(I either tried other library with mcp25-15, it's work beetween arduino's but the teensy can't receive any message).

can you help me i'm lost.

McNeight commented 8 years ago

The examples SendCANMessages and ReceiveCANMessages should work with all controllers.

When testing with the Teensy boards, did you use a transceiver chip such as the MCP2551?

-Neil

ludoboss777 commented 8 years ago

thanks for your answer. the library works fine with teensy board and mcp2551.:) Can you show me yours connection with arduino-----mcp2515------mcp2551. do you connect pin 2 for interrupt?

ludoboss777 commented 8 years ago

Can yo give me your connection beetwen teensy board and an arduino board that work with your library., please? i'm lost.

coryjfowler commented 8 years ago

You would have the Teensy CAN_RX and CAN_TX connected to its own MCP2551. The MCP2551 is what actually gives the Teensy a CAN connection, all it has is an internal protocol controller. The MCP2551 CAN_HIGH and CAN_LOW would connect to CAN_HIGH and CAN_LOW on the CAN bus.

ludoboss777 commented 8 years ago

I have no problem with teensy board but with arduino connections (see above). the library doesn't work. if you have a detail connection beetween arduino mcp2515 and mcp 2551 to work with it will be greatfull. :).

coryjfowler commented 8 years ago

http://www.seeedstudio.com/wiki/images/a/a3/CAN-BUS_Shield_v1.2.pdf

ludoboss777 commented 8 years ago

does this work for you? i use a 16 mhz ceramic resonator. maybe it is the problem... i will check.

coryjfowler commented 8 years ago

That's the schematic for Seeed Studio's CAN Bus shield that's been in production for a while... it works. I've had a couple dozen varying revisions go through my hands and I have an older one sitting on my desk right now as I work on an autobaud routine.

coryjfowler commented 8 years ago

Can you attach a photo of your entire setup?

Teddyz commented 8 years ago

And make sure you have at least one terminating resistor between CAN_HIGH and CAN_LOW somwhere in your setup.

ludoboss7 commented 7 years ago

Hi, wellcome back and happy new year. I bought 2 canbus shiled. but i have no result with your library (I use CS pin 9). i saw that the selected pin in your library is 10. how to change this value in those example?. can you send me or post an exemple that works. there no problem in the circuit because i try another library (included with the shield) and works fine. can you help me please :)

ludoboss7 commented 7 years ago

sorry it works.just change CS pin 10 to 9 at the end in the mcp2515.cpp file. i'll test arduino canbus shield and a teensy board tomorow. thx

McNeight commented 7 years ago

@ludoboss7

Since this appears to be working for you, I'm going to close this issue.

-Neil