0

I have a project involving communication between a raspberry pi 2 and arduino uno, does it matter of the shields are different ?

Second when communicating do they both need to be coded in the same language?

Does anyone know of any tutorials on this subject?

Thanks

Jonny Smyth
  • 29
  • 1
  • 7
  • Sorry, but.. What do you mean by "different shields" and "different languages? As long as they use the same protocol (it can be a general purpose one, such as serial, i2c, spi, can, ethernet, or a custom one you wrote) and have the same electrical specifications (which is usually not true for 5V arduino boards, since rPI is a 3.3V device - you will need voltage translators or post a better question) they will work. – frarugi87 Oct 28 '15 at 09:15
  • Ok sorry I'm new to this, does anyone know of tutorial in which it arduino and raspberry pi have been combined in a CAN network? – Jonny Smyth Oct 28 '15 at 09:17
  • there are many (you just have to open a random site - e.g. GOOGLE - and write "raspberry pi arduino can bus").. Anyway why CAN bus? there are easier to use protocols (serial, i2c,...) which benefit from direct hardware support. Do you really need CAN? – frarugi87 Oct 28 '15 at 09:23
  • CAN would be ideal due to the distances needed to travel, i2c doesn't offer enough distance - it's for a project where one of the aims is an investigation into can! I've worked with can before in microC , I have a central bode and 4 distributed nodes communicating back and forth on a schedule ! – Jonny Smyth Oct 28 '15 at 09:26
  • Obviously I have google'd raspberry pi to arduino can bus but nothing overly beneficial comes up!! – Jonny Smyth Oct 28 '15 at 09:29
  • Ok, then I think you'll have to write your own libraries or take the ones the shield prducer makes. And I don't know if there are restrictions on electrical values on the line, so you'll have to check. Anyway [this](https://www.cooking-hacks.com/documentation/tutorials/can-bus-module-shield-tutorial-for-arduino-raspberry-pi-intel-galileo/) is the first result when googling, [this](http://skpang.co.uk/catalog/pican-canbus-board-for-raspberry-pi-p-1196.html) is the second (rPI only), [this](https://www.sparkfun.com/products/13262) is the third (arduino only).... Check the shields producers – frarugi87 Oct 28 '15 at 09:32

1 Answers1

0

As long as both shields comply with CAN spec, and the software in both ends uses the same configuration (bitrate, CAN message structure, CAN IDs) there should be no problem in using different platforms and different languages to communicate between them.

Note that in many shields the power for the CAN transceiver is provided from the "vehicle" and not from the platform that you use (arduino, RPi) to provide better protection to the platform, and you might need to provide such power source (the arduino might do, (although the RPi can provide 5V from pin 2).

MByD
  • 135,866
  • 28
  • 264
  • 277