Use of second CAN port Duinomite Mega

Started by KeesZagers, January 22, 2014, 03:16:42 PM

Previous topic - Next topic

KeesZagers

On the schematic of Duinomite Mega I saw that PIN D0 and PIN D1 on the Arduino connector (also GPIO-4 and GPIO-8) are connected to the U5RX and U5TX of the PIC32 controller through R2 and R3, zero ohm resistors. However the pins are also directly connected to D0 and D1. U5RX and U5TX are also connected to the RS232 buffer which goes to the D9 RS232 connector. It is so far clear to me that if I want to use both the RS232 and the D0 and D1 digital I/O I have to cut R2 and R3.
My situation however is still more complex. I don't want to use either the RS232 nor the D0 and D1, but I want to use the second CAN module which is in the controller. The C2RX and C2TX happen to be on the same pins as the U5TX and U5RX. So I like to expand the Duinomite with an Arduino module with only a CAN transceiver chip connected to the pins D0 and D1. In software I will disable the COM port and the digital I/O ports and switch on the CAN2 port. Does someone know a reason why it will not work and even more important: does someone expect to see firework?

JohnS

Should work.

Make sure you also set outputs digital not analog.

John

KeesZagers

Thanks John,

I think however that I should set them as digital input, not output.

Kees

JohnS


KeesZagers

Second CAN port works without problems. I had prepared the software already for a long time, but up to now had not the hardware available. I have tested it now with a standard CAN transceiver chip connected to the D0 and D1 lines on the Arduino connector. However it is also possible to use a galvanic isolated transceiver or a so-called low-speed fault-tolerant transceiver. Anyway it is possible to use a more industrial or automotive CAN connection.

My software is now dedicated to one CAN port, so you have to select which port you choose. In the next version it will be possible to make a bridge between the two ports. The module can copy all messages on one port to the other and vice versa. Also the filtering on messages can be active, which means only dedicated messages are copied. The bridge can be used for a longer CANbus or a connection between two CANbusses running on different bitrates.

JohnS

Have you thought of where to put it - your site (if you have one) or github or Olimex or ...?

John

KeesZagers

Sorry John,

This is not an issue which belongs to this item on the list. I started another issue about a year ago. Who is using the CANbus on the Duinomite? As I got no real reactions on this, I stopped promoting the special CAN version of the DMBasic software. This is also why I would like to have the MPIDE environment working for the complete hardware to have an alternative for the DMBasic.

JohnS

I would expect DMBasic users mainly updated to MMBasic but I have no idea who may use CAN (or even if MMBasic supports it as I'm really a C user, though not through MPIDE).

I sort of figured if you mentioned it then maybe you wanted to make it available.  I suppose Olimex might put it on their web site if you'd like that.

CAN is on my ToDo list but "one day" rather than now!

John

KeesZagers

Software support is available for two CANports now. In Basic you can configure the two ports with bitrate settings and filtering and after that CANBRIDGE links the ports. In hardware a shield has to be added with an extra transceiver chip (MCP2551), but that is all. Just wondering if someone else is interested in this feature?