Pages: [1]   Go Down
Author Topic: CAN bus  (Read 4918 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 94
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Bonsoir,
Je m'intéresse à la mise en place d'un bus CAN pour connecter une dizaine d'Arduino.
Principal avantage, pas de maitre dédié ;-)

J'ai trouvé deux shields et pas mal d'infos ici :
http://www.arcan.es/?page_id=394
http://real2electronics.blogspot.com/2010/06/can-bus-mcp2515.html
http://www.sparkfun.com/commerce/product_info.php?products_id=10039

Je ne sais pas si l'Arcan est compatible Mega 2560, j'attends le retour du créateur.
Avez-vous testé des produits ou une solution fonctionnelle de communication CAN ?
Logged

0
Offline Offline
Edison Member
*
Karma: 16
Posts: 1579
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

It´s a pity, but I don´t speak french...  (But I can understand what it´s written in your post, 90%  of the words are similar to spanish). smiley-grin

For sure, the SPI <--> CAN module from avrcard which I´ve been tinkering with in my blog works with any Arduino version. I´ve done some stuff with Mega version.

The problem using shields prepared to Arduino Diecimila, Duemilanove or UNO are not compatible with the Mega versions. (because the SPI pins are not in the same physical position).
If you want to use them, you need to do some "hack" (like in the past with the ethernet shield).

If you want, you can prepare yourself a board (http://www.avrcard.com/Documents/can/can_spi_schema_1_1.pdf )

As you can see, all of them are based of the same chip (MCP2515 CAN Controller).

Regards,


 smiley-wink

Igor R.
http://real2electronics.blogspot.com
« Last Edit: January 07, 2011, 07:37:14 pm by igorreal » Logged


0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 94
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Igor,

Don't blame you, I can't speak spain myself. Let's communicate in english ;-)

In the future, I will perhaps prepare a board myself, by for the first checks, I prefer to buy them.
Do you think I can buy somes converters instead of shields, and use them with Arduino Can libraries ?
Could you advise me models of spi converters ?

Thanks !
Logged

0
Offline Offline
Edison Member
*
Karma: 16
Posts: 1579
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

You can use what you prefer, but I only advise you that these shields are not prepared for the Mega boards.

The MCP2515 Can controller uses SPI to communicate with the microcontroller. These pins are physically in:
  • Arduino UNO, Diecimila,Duemilanove => 13,12,11,10
  • Mega =>53,52,51,50
You can see a similar problem in the old ethernet shield:
http://mcukits.com/2009/04/06/arduino-ethernet-shield-mega-hack/

At the end, all these hardwares are using the same CAN controller (MCP2515), and the code is going to be compatible, the only difference maybe is the clock used, but it´s a small change to do in the code for the SPI clock prescaler.

If you want a shield because it has an extra feature that you want to use, you always can do this "hack", but if you are only interested in the CAN feature, I prefer a SPI <->CAN board.

You can check for yourself the schematics.
You can find the links in my blog with shields, code, SPI <-->CAN  => http://real2electronics.blogspot.com/2010/06/can-bus-mcp2515.html


Regards,  smiley-wink






Igor R.
« Last Edit: January 09, 2011, 06:44:42 am by igorreal » Logged


0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 94
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Igor,

Thanks for your explanations. I will do the trial with the avrcard board.  
Where could I download the library for Arduino ?

Thanks.
Karim
Logged

0
Offline Offline
Edison Member
*
Karma: 16
Posts: 1579
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Check the links in my blog, there are a lot....


 smiley-wink

Logged


0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 94
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I don't know which library I can use with avrcard , because of this sentence :
Quote
but it´s a small change to do in the code for the SPI clock prescaler.
Any help should be welcome  smiley-wink
Thanks!
Logged

0
Offline Offline
Edison Member
*
Karma: 16
Posts: 1579
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

hehehe

You are looking for something "plug & play"..... smiley-wink

All the code that I have in my blog is functional... Use the google translator at the beggining to try understand how it works. After you should able to understand all the libraries that you can find in internet.

For example you can use http://www.skpang.co.uk/catalog/product_info.php?cPath=140_142&products_id=706 (CAN-Bus ECU Reader demo sketch) , because they are also using a 16 Mhz for the MCP2515 as the avrcard hardware.


 smiley-grin


Logged


0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 94
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

OK, let's go to translate then smiley-wink
Thanks !
Logged

Pages: [1]   Go Up
Jump to: