Set Jaguar device number via cRIO

So I finally got the time to try out CAN. However, I can’t seem to address my black Jaguar.
Here’s the setup:
1 black jaguar, connected to cRIO via serial
1 120 ohm resistor between CAN_H and CAN_L
Here’s the code I’m using:

The enumeration command returns one element with a value of 0. If I interrupt the CAN or serial communication in any way (unplugging a cable, removing the termination resistor, or removing power to the jaguar), it returns an empty array.
There’s a couple documents saying that the default device number for a Jaguar is 1. Sounds like my results are a little strange.
Pressing the “user button” on the Jaguar doesn’t have any effect on the return of the enumeration command.

Is there anything I’m doing wrong?

Have you set an ID and updated the firmware of the black jag through BDC-Comm (on a PC)? I’m not sure how cooperative an unprogrammed jag is with the FRC code

I managed to dig up a USB to serial device, but I had the same problems.

Is the LED on the jag blinking yellow? If not you may be stuck in bootloader. There should be a recover device option in BDC-COMM, which should fix it.

I believe ID 0 means broadcast to all (or it may be host device, not sure). If the jag is somehow assigned to that ID, I’d expect the system to not work properly. Have you tried holding the user button while you turn the power on to the robot? That is supposed to reset the ID to 1.

Yes, the LED is blinking yellow. If I plug in a PWM cable, Normal PWM operation works perfectly (including the LED, brake, coast, and the limit switches).
If I connect another Jaguar on the CAN bus, it shows no change.
However, I think I made a mistake in a previous test. It makes no difference whether the termination resistor is present or not. It should be 120 ohms, and connecting the CAN low and CAN high, correct?

The data sheet says to use 120 ohm resistors, but in the cable assembly guide it says that 100 ohm work just fine.

Also, since you are using serial mode, there should be 2 resistors. One of them is in a jack at the end of the chain, and the other is inside the serial adapter, bridging the green and red wires.

I guess the only thing left to check is your wiring. Are you using a 6-conductor wire between the cRIO and the black jag? Have you tried a different wire? Are you sure you made the apapter properly? The end result inside of it should have been the red and green wires connected to a resistor, 3 more going to the DB-9 connector, and one left free. I remember I didn’t have the bus working for a while because I didn’t push the pins all the way into the DB-9 port

Thanks, I forgot to put one on both ends.
I’m using bdc-comm right now, for superstitious aid.
I’ve tried both 120 ohm and 100 ohm resistors, but no change. I’ve even measured the resistance between CANL and CANH after assembly, but it’s around 50 ohms, just as you’d expect.
I guess the next thing is to take out an O-scope and see if there’s any data being sent on the bus at all. There should be a heardbeat from bdc-comm.

Are you using the DB-9 to RJ14 (6p-6C) adapter that was specified in the instructions?
I have had bad luck in trying other adapters (like the ones at frys), you are using the one from digikey?

(Btw. all the part numbers from digikey can be found in this document http://firstforge.wpi.edu/sf/go/doc1030?nav=1)

Buy the cable? It’s just a female RJ25 connected to a female DB9. Is the digikey part specially shielded? I don’t have shielding over any of my CAN bus.

I tried to find a periodic signal on the CAN bus (the heartbeat), but I couldn’t find anything that would qualify for much more than periodic noise. (only a couple of microvolts, really noisy, and extremely unreliable. However, it didn’t seem to appear when I didn’t have bdc-comm running or I didn’t have my hand resting on my computer, if that makes any difference :slight_smile: )

Perhaps you aren’t using a proper wire. A standard 6-pin cable most likely won’t work for the same reason you need a crossover cable. A standard phone wire will swap the conductors and not work with CAN.

No, there is no shielding in the digikey adapter.

It seems that in other adapters (maybe only the ones I bought), that the spacing between the side of the adapter and the pins was slightly off.
The slot was large enough to allow the 6 pin cord to fit in and latch, but the off spacing would make the pins not line up causing no comms in either direction.

Try a continuity test between the pins of the 6 pin cord and the cords inside the adapter (or the DB9 pins).

Watch out for the 100 Ohm resistor legs if you tried to put the resistor into the 6P6C connector itself. I experienced many problems with the resistor shorting itself out if I tried building it like the manual says. I found that connecting the resistor to a wire pigtail coming out of the modular connector to be much more reliable.

HTH,

Mike

There is nothing a little epoxy can’t fix!

After crimping the resistor into the connector (and verifying that it works), take a little 2 part epoxy mixed well and cover the resistor and its legs.

Once it is cured, the resistor won’t be able move and the legs will not short each other out.

Yes, it seems fine. Less than 0.5 ohms per wire. (The leads on my meter are about 0.2 ohms)
I also double-checked my wires, and they are straight-through.
I’ve tried the terminating resistor both with and without a pigtail. I think with the pigtail is both more reliable, and easier to create.

Could somebody unplug their termination resistor, and try enumeration (with the cRIO or the BDC-COMM utility)?
Does it say there’s no no devices on the network at all, or does it say there’s one device with a device number of 0?

Neither.

I can still enumerate all 4 devices on the CAN bus.

Is that with a single termination resistor, or with none whatsoever?

Single termination (one inside the db9 to 6p-6c adapter)

Okay. The Getting Started guide said small networks may still work with a single termination. I’m not going to ask you to clip off your resistor.

I would do it if I had a second (or third) working adapter. :]
But, the only adapter that I have gotten to work is the digikey one, and we only ordered one of them. :rolleyes: