Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

NI 9853 C Series CAN module Synchronization

OK, this is goning to be long to explain...First  of all Im using a CompactRIO 9004 system with 9104 Chassis and the NI9853 high speed CAN module. Ive been able to perform a loopback test between CAN0 and CAN1 ports of the 9853 module (with standard and extendend IDs). I also have a fully functional CAN network consisting of Microchip hardware, specifically two dsPIC30F4011's with the MCP2551 CAN transceiver and one 18f4553 with an MCP2515 CAN controller and a MCP2515 CAN transceiver, this network also works well within itself (I send messages through the CAN network and the PICs are able to control some servos). Im trying to interface the cRIO and NI9853 with this CAN network, but neither the NI9853 module will successfully transmit or recieve from any of the PICs. Funny thing is that I connect everything to the same physical bus (twisted pair cable with 120ohm terminators) and Im still able to transmit from CAN0 to CAN1 of the NI9853, and also the PICs are able to transmit/recieve within themselves. I think it all has to do with sync issues, the thing is; Ive gone as far as programatically writing the BTR0 and BTR1 registers of the NI9853 module (which has a Phillips SJA1000 CAN controller) to match those used by the Microchip hardware, and still no communication. Im trying to transmit at 1Mbit/s, using 20Mhz clocks on my external CAN network, for this Im using 10 time quantas to represent the nominal bit time, from what I understand from both CAN controller datasheets (MCP2515 and SJA1000) the definition of the segments and the sampling point for the bits is what is of importance (as well as the scaler value), Ive matched both to identical values by manipulating the BTR0 and BTR1 registers of the SJA1000 (NI's 9853) CAN controller. From what I know the FPGA on the cRIO runs at 40Mhz, with this a 20MHz clock for the NI9853 is possible. Here is the thing, when selecting the properties for the 9853 module and selecting a preset from the "Baud Rate" drop-list for any CAN port, if the "Advanced" button is pressed the "Specifiy Baud Rate as Bit Timing Registers" value changes accordingly to the preset value specified in the drop-list, that is, if I select 1000 kbits/s, BTR1 gets the value 0x14 and BTR0 gets 0x00; if I select 500 kbits/s BTR1 gets 0x1C and BTR0 gets 0x00. Also on the same properties window for the 9853, there is a "Module" tab, with a drop-list labeled "Module Clock" the values I can select here are 20Mhz and 10MHz. Turns out that the value of the baud rate as specified in the advanced tab by the bit registers is not affected if I select 10Mhz or 20Mhz; also in order to have a 1000 kbit/s speed with a 0x14 value on BTR1 a 16MHz clock speed should be used (according to the definitions of the SJA1000's datasheet for BTR1 and BTR0). The following images show what Im talking about: 

40.JPG     1000.JPG

 

module.JPG  register.JPG

 

Also all documentation I could find regarding nonstandard baud rates on the NI site apparently refers to the CAN controller NI hardware series 1 used (Intels 82527, which actually runs at 16Mhz) from what Ive been able to research this chip has identical Bit timing registers to the ones of the SJA1000 controller, proof of this is the document labeled "How to Configure CAN Ports for Custom Baud Rates" (http://zone.ni.com/devzone/cda/tut/p/id/4304), which shows a map of the registers of Intels chip, and is identical to the one found on the SJA1000s datasheet. On other document titled "How Can I Set Nonstandard Baud Rates in NI-CAN?" (http://digital.ni.com/public.nsf/allkb/CBA1FC627FFA0F8F862564DC0071B3A7?OpenDocument), the same information appears regarding the way the NI-CAN driver handles baud rates (again using Intels chip, which by the way is incorrectly specified to be running at 8Mhz). Using 20Mhz and the BTR1+BTR0 combination 0x1400, the SJA1000 yields 1.25Mbits/s, not even a possible speed on the CAN bus. Bottom line is, I think I cant interface my CAN network with the NI 9853, because of this strange issue. Im just wondering if anybody has any idea how to do this, or at least what is the speed the 9853 module runs on, with this I think I could at least try and find a value to match the 1Mbit on my network. Finally Ive attached the project Im running on the fpga target (Ive set the Module Clock on 20Mhz, disabled auto-start for both CAN ports and specified to run the Baud rate from the time registers using BTR1: 0x34 and BTR0: 0x00 values for the timing registers).  

Any help will be appreciated, thanks in advance...

0 Kudos
Message 1 of 2
(7,791 Views)

One final thing, this is the only thing regarding external sync that Ive found so far....its the "NI CAN Product Compatibility and Feature Table" (http://zone.ni.com/devzone/cda/tut/p/id/5859#_ftn1) take a look at the footnote it says a digital module is needed, would it be a digital 9401 module? Ive also got one of those.

0 Kudos
Message 2 of 2
(7,788 Views)