Interfacing µC to PC using CAN Bus.

Discussion in 'Embedded Systems and Microcontrollers' started by vrvrao, Feb 25, 2013.

  1. vrvrao

    Thread Starter New Member

    Sep 17, 2012
    20
    0
    Hello,

    I need to interface µC to Computer using CAN Bus.

    We are using PCAN USB ( including PCAN View) from PEAK at One end and

    A TI C2000 (F28335) DSP with CAN Transreciver at other.

    I at attaching here the CCS code used for DSP controller to TX and RX data, when we debug code, i can see data at CANA_H and CANA_L pins of DSP but not in PCAN View.

    So, i need some help if there is some who had worked with TI DSP and CAN.

    Thanks,

    Raja.
     
    • can.txt
      File size:
      7.1 KB
      Views:
      135
    Last edited: Feb 25, 2013
  2. Papabravo

    Expert

    Feb 24, 2006
    10,140
    1,789
    Is the CAN Controller set for the correct baudrate, aka bit timing parameters? Are the mask and match filters set for promiscuous mode, that is will they let all messages through? Those are the big two reasons why receivers won't receive.
     
  3. vrvrao

    Thread Starter New Member

    Sep 17, 2012
    20
    0
    Hello Bravo,
    thanks for reply.

    Ya, both baudrates are set to 100Kbit/s. Am using filter in Extended mode.
    Do i have to modify any settings.

    When can be BUS Heavy ?

    Thanks,
    raja.
     
  4. Papabravo

    Expert

    Feb 24, 2006
    10,140
    1,789
    I don't know what Extended Mode means. Does it mean you are using 29-bit identifiers?

    I also don't know what BUS Heavy refers to. Perhaps a more precise description of the problem you are having would help.
     
  5. vrvrao

    Thread Starter New Member

    Sep 17, 2012
    20
    0
    Hello Bravo,

    Ya, Extended means 29-bit id.

    When i run the code is can see pulses in CRO at CANH and CANL pins of µC but when i look at PCAN veiw ther is no data received and also we can see BUS heavy status at below, as shown in pic am attaching.

    I want to verify the data, so can you tell me how can i read data from CANH and CANL pulses in CRO.

    Thanks,

    raja.
     
    • pcan.pdf
      File size:
      279.2 KB
      Views:
      36
  6. Papabravo

    Expert

    Feb 24, 2006
    10,140
    1,789
    I still don't have a clue about what "BUS HEAVY" means. I asked for a description, not a repeat of your original post. If it means "BUS OFF" then your node has racked up enough errors to be disabled. Do you have the ability to see ERROR FRAMES? Can you see the values in the RX and TX error counters? This will provide clues. It sounds as if your receiver cannot hear its transmitter. Every time you transmit there is a bit error, the node generates an error frame, and after 32 of those the node goes "BUS OFF".

    How many nodes are there on this network? If you are expecting a single node to receive its own transmission I fear you will be disappointed since that does not happen.
     
  7. vrvrao

    Thread Starter New Member

    Sep 17, 2012
    20
    0
    Hi Bravo,

    I dont know about Bus Heavy,In pcan view we can no of errors but not error frames.

    In PCan view we a window trace where we can see no of received , Tramsited or Erroer data.
    Regarding nodes, we have one node as µC and other as PCAN USB.
    I agree that receiver is not detecting the transmitter.

    So, How can i make it work.

    thnks,

    Raja.
     
  8. Papabravo

    Expert

    Feb 24, 2006
    10,140
    1,789
    A typical CAN transceiver produces a quasi-differential signal with respect to a common ground. If you connect the logic level signals for TX to RX and RX to TX then neither transmitter will be able to hear itself and you will get the behavior you describe.

    When you construct a short CAN bus you must have a terminator which will establish the recessive level at Vcc/2. On a long trunk cable there should be 120 Ohms at each end. Along this trunk cable you can have unterminated stubs. Imagine shrinking the long cable to zero length. The two terminators in parallel become 60 Ohms and you still have the unterminated stub. The two nodes can be located anywhere along the stub.

    Last point is to select your bit timing parameters so that the sample point is as close to the end of the bit cell as possible. This is difficult to do if your parts use anything other than crystal oscillators.

    How about you make a schematic showing the controllers, the transceivers, the bus, and the terminators.
     
Loading...