Building a CAN API for Arduino DUE

Hi Palliser, any progress on this?

hello that_kid and thank you for ask.

For all those who have followed this post, I would like to inform you that we still working very hard building the API and runing tests, with the valuable help of Atmel. For obvious reasons (Christmas and New Year) we had few latencies but I hope that, as soon as possible, we will publish the library and sample sketches in github. On the other hand, I think it is timely and appropriate, to see from those that already have built their DIY pseudo CAN shields, to show us their progress. Thank y'all again for your patience.

Thanks for the update, I have my samples in but now I need to get a board to solder them to. My goal is to make my own board but that won't happen until I recover from my broken foot. Meanwhile I'm getting everything that I can ready to help with the testing.

Hi that_kid. I am sorry to know about your broken foot. Just take it easy. Even thou I have my shield working OK, I still looking for a better out-of-the-shelf board that fits better the design. I am also working on some eagle files to build, at some time, my own design. Remember that for the two transceiver we are going to need 8 pins of the Arduino DUE (CANRX0, CANTX0, CANEN0, CANRS0, CANRX1, CANTX1, CANEN1, CANRS1). For my tests, I didn't use the EN and RS pins. I just connected them to +3.3 and ground respectively.

Palliser:
Hi that_kid. I am sorry to know about your broken foot. Just take it easy. Even thou I have my shield working OK, I still looking for a better out-of-the-shelf board that fits better the design. I am also working on some eagle files to build, at some time, my own design. Remember that for the two transceiver we are going to need 8 pins of the Arduino DUE (CANRX0, CANTX0, CANEN0, CANRS0, CANRX1, CANTX1, CANEN1, CANRS1). For my tests, I didn't use the EN and RS pins. I just connected them to +3.3 and ground respectively.

I've been lurking on this thread since you started it. I would be happy to collaborate on the Eagle files and even fab a board as this fits with my plans. I would be happy to produce a run and share the rate with the good people here. My board would integrate modbus via MAX485 as well with very little extra cost. I also would love even a very beta copy of your sketch if possible.

Hi zabaat. I am very happy for your interest to contribute on the CAN shield development. At this very moment, even thou I have done successful tests with the TI SN65HVD234 transceivers, we don't know precisely if they are going to be the best and final choice. I hope to get soon a feedback from Atmel about their tests (they are building their own DIY pseudo CAN shield). I also expect to receive next week a couple of DUEs I ordered almost two months ago to do some networking tests. Regarding the sketch, as I mentioned before here, it should be available in github on the next days. You could start ordering the parts and building your own shield to be prepared to run tests once the API is released to public. Finally your idea of the gateway is very good knowing the need to integrate CAN with other protocols. Just hold it until the time comes. Regards!

Palliser:
Hi that_kid. I am sorry to know about your broken foot. Just take it easy. Even thou I have my shield working OK, I still looking for a better out-of-the-shelf board that fits better the design. I am also working on some eagle files to build, at some time, my own design. Remember that for the two transceiver we are going to need 8 pins of the Arduino DUE (CANRX0, CANTX0, CANEN0, CANRS0, CANRX1, CANTX1, CANEN1, CANRS1). For my tests, I didn't use the EN and RS pins. I just connected them to +3.3 and ground respectively.

Thanks Palliser, I was also thinking of building my own board as well. I have some other parts I want to add for other functions from the DUE. In the meantime I'll just get a small board that I can mount the transceivers to for testing. The good thing about not being able to move around much is that I can think more about my designs.

Hi All,
I'm very excited about this project and I'm constantly watching this thread for news and source.
BTW what we did here [Q]: Tailoring the Due to Eclipse.. - #32 by system - Arduino Due - Arduino Forum may be very helpful for the project Have a look.
I'm planning to use a debugger too with the arduino , but that is still a working in progress.
Happy new year at everyone
Zad

For those that already have in mind an automotive application for the Arduino Due and the almost ready for release CAN API, while it seems to be too early, I believe is timely for them to start seeking out as much information as possible of the CAN protocol of their vehicles and get familiar with it. For example, the specific type of CAN standard and some specifications like CAN identifiers, Bit rate, message type (default 11-bit identifier?), data format, range definition, etc... I must say, during some tests, often, I had to stop my test and spend a considerable amount of time searching for needed CAN info. Oh, I forgot: try to get an OBD-II male connector (plug) and where is the OBD-II connector located in your car (Most are located under the steering column).

I wanted to show, briefly, how I started building my second DIY pseudo CAN shield. I decided to use two SN65HVD235 transceivers in order to compare them with the two SN65HVD234 I used in my first shield. For these 235s I also used a different SchmartBoard: The model 206-0004-01, and instead of keep it intact, I did cut it. Here a picture of the two 235s soldered in the SchmartBoard, with pin headers and a pinout.

*WARNING: This pinout corresponds to the SN65HVD234 transceivers. Not the 235 ones

I wanted to present it here, for those that have not started yet their shield, as an example to be followed using the previous schematic I published in this post. Even thou 234 and 235 transceivers are very similar, differ in the pin 5. For the 234 this pin corresponds to EN (enable) for an ultralow-current (50-nA) sleep mode and for the 235 this pin 5 corresponds to AB that implements a bus listen-only loopback which allows baud rate synchronization.

Notice that this second CAN shield, more than a shield, will work as a side car (alone or inserted in a bread board) unlike the first one which is a true shield. I made it that way to avoid soldering work. I hope to be uploading more pictures of my progress with it.

Nice, I'm going to try my hand at making my own surface mount board. I need to get my hands on a laser printer first. For testing I'll start with making a board just to hold the tranceiver. If all goes well I can have the trancievers plus the other components I need for my project.

Hello that_kid. I hope your foot is doing better. Here another picture of my second DIY pseudo CAN shield and a brief comparison between the two shields:

SHIELD ADVANTAGE DISADVANTAGE
#1 Compact Prone to hot spots (soldering)
#2 Easy-to-assemble Bulky and messy

Hello Palliser the foot is coming along. I'm now able to walk on it but I still have the boot on my foot, still it feels good to be on both feet again. I see you got your second DUE, while gathering the things I need for my board I'm also working on learning more about Arduino programming. I should be good and ready by the time I'm able to move around more.

Palliser:
Hello that_kid. I hope your foot is doing better. Here another picture of my second DIY pseudo CAN shield and a brief comparison between the two shields:

SHIELD ADVANTAGE DISADVANTAGE
#1 Compact Prone to hot spots (soldering)
#2 Easy-to-assemble Bulky and messy

I think I'll be building an interface in the near future -so will be following this thread closely. I've messed about with CAN decoding in the past - using USB can interfaces ( Lawicwl CanUSB), and various monitoring / message filtering software. I hate being locked out of my car's software, so using DUE as a smart interface makes sense.
The mixture of 11 & 29 bit messages (and several different bus speeds) makes life pretty complex, and given that vehicle manufacturers like to hide useful features.. lets hope the energy & problem solving in the Arduino community can cut through the BS :slight_smile:
Lawicel do an AVR/CAN adapter, with some sample code available.
Also worth looking at : http://rbei-etas.github.com/busmaster/
With some contributions from Bosch - who started it all... open source code on github.
looking forward to see what libraries develop!

Graeme

Hi everybody!

I`m quite new to the Arduino world, but not to the uC world. I'd like to collaborate as much as possible with the development of the CAN API for the Arduino DUE. I actually have several DUE and other Arduino boards (with the necessary shields) and USB CAN interfaces, as well as other applications that are extensively using CAN BUS.

I'm very sorry of not having been able to start collaborating with you earlier, but I really would like to help as much as possible in any task you give me.

Cheers!

Lufe

lufegimenez:
Hi everybody!

I`m quite new to the Arduino world, but not to the uC world. I'd like to collaborate as much as possible with the development of the CAN API for the Arduino DUE. I actually have several DUE and other Arduino boards (with the necessary shields) and USB CAN interfaces, as well as other applications that are extensively using CAN BUS.

I'm very sorry of not having been able to start collaborating with you earlier, but I really would like to help as much as possible in any task you give me.

Cheers!

Lufe

Except we can't contribute or do anything, it's really fun this way...

zabaat,
What you're saying is partly true, until the new CAN library is published. The Atmel engineer that developed a prior CAN API for the SAM3X8H, is supporting Arduino with this CAN interface for Due. Once the library is on github, everyone should start to test/discuss/contribute. And I say partly because at this very moment people in this forum could be contributing, let's say, with the design of the shield. Electric schematics have been published here. I have also shown a couple of my shield approaches. What I would like to hear in this post is: My pseudo CAN shield is ready. Here a picture of it, but I have yet to see any of them here. Does that really matter? Yes, because otherwise, you can't do any test or discuss or contribute just with the sketch or the classes. Am I right?

Palliser:
zabaat,
What you're saying is partly true, until the new CAN library is published. The Atmel engineer that developed a prior CAN API for the SAM3X8H, is supporting Arduino with this CAN interface for Due. Once the library is on github, everyone should start to test/discuss/contribute. And I say partly because at this very moment people in this forum could be contributing, let's say, with the design of the shield. Electric schematics have been published here. I have also shown a couple of my shield approaches. What I would like to hear in this post is: My pseudo CAN shield is ready. Here a picture of it, but I have yet to see any of them here. Does that really matter? Yes, because otherwise, you can't do any test or discuss or contribute just with the sketch or the classes. Am I right?

Oh, I guess I was waiting the same way, thinking what use is a can shield in my efforts to contribute to the testing when I have no sketch or classes. Since it's now clear that is what I need to do to get access. I will build the shield as you have listed and post it's picture. I have had 20 of the chips and 4 Dues for a couple weeks now, definitely would have built this had I known.

I already posses a good understanding of the protocol, USB-CAN adapters and debugging software tools to tackle this. I even have a project that needs it.

I would suggest making a closed project at least for people that understand it is in beta stage so you can control the feedback you get.

I'm in the same position as Zabaat.

I'll build the Pseude shield ASAP and post pics. Maybe I try out another HW solution from the IC I have right here. I would also like to be collaborating with a beta release and feedback you directly.

Cheers

Lufe

lufegimenez:
I'm in the same position as Zabaat.

I'll build the Pseude shield ASAP and post pics. Maybe I try out another HW solution from the IC I have right here. I would also like to be collaborating with a beta release and feedback you directly.

Cheers

Lufe

Lufe - I'm working to build a better "industrial protocol" arduino board, integrating modbus / rs232 (12v) and CAN and 2x Due chips. I just saw Palliser's ethernet addin and am debating adding that in by exposing those pins off of the dues for future expansion for profinet if possible. Is this something you would be interest in collaborating in?