From Saturday, Nov 23rd 7:00 PM CST - Sunday, Nov 24th 7:45 AM CST, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

FIRST Robotics Competition Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

RoboRIO CAN with Teensy coprocessor

Hello,

We are trying to develop a system for connecting many arbitrary  sensors to the RoboRIO for FRC.

Is there a current standard method of connecting a Teensy microcontroller (or similar microcontroller) to the RoboRIO's CAN bus to access via WPILib? We decided on the Teensy because it had built in CAN controller.

We had trouble with I2C over long distances and would prefer to avoid networking as it is not real time and the 2016 router only has one extra port. The RoboRIO's FRC FPGA image only offered one UART port, which we do not think will be enough (we can use the Teensy's to connect to arbitrary sensors), in addition to being slower than the CAN bus for large data transfers.

Thank you

0 Kudos
Message 1 of 4
(5,174 Views)

I'm not sure what language you are using, but at least in LabVIEW there is a CAN API for accessing the bus directly. You could use that to talk to your micro, but you would want to select arb IDs that fit into the scheme originally layed out by Luminary Micro (if you want to coexist with FRC CAN devices).

Message 2 of 4
(3,903 Views)

We are using Java.

We found the CANJNI FRCNetworkCommunicationCANSessionMuxSendMessage and FRCNetworkCommunicationCANSessionMuxReceiveMessage, but other functions seem to be unavailble.

0 Kudos
Message 3 of 4
(3,903 Views)

What other functions do you need? The only others even provided by the driver are a stream capture API for not missing consecutive messages received with the same arb id. And since you are in control of the messages on your mirco, you could just avoid doing that. The send and receive are all you should need.

0 Kudos
Message 4 of 4
(3,903 Views)