• AVR Freaks

Hot!Microchip CAN bus analyzer not reading CAN bus.

Author
BHUSHAN
New Member
  • Total Posts : 27
  • Reward points : 0
  • Joined: 2019/02/04 23:17:18
  • Location: 0
  • Status: offline
2019/04/11 03:29:16 (permalink)
0

Microchip CAN bus analyzer not reading CAN bus.

Hi, I am using PIC32MX795F512L for CAN communication. As I am new to CAN communication therefore right now I am just trying to send 1 byte of data. I am also using Microchip's CAN bus analyzer to capture transmitted data. I have configured PIC32MX795F512L for Fosc = 8MHz and baud rate for CAN has been selected as 125Kbps. The whole code is attached with this post. Micro-controller's CAN module is transmitting the data frame correctly(if I am not wrong because EOF is not 7 recessive bits ) but my CAN bus  analyzer is showing Passive error(Rx Error 135 ).  I am using MPLAB v8.88 IDE and Microchip PIC32 C-compiler Toolsuite. I have also attached the DSO signals captured during transmission. 

Attached Image(s)

#1

1 Reply Related Threads

    BHUSHAN
    New Member
    • Total Posts : 27
    • Reward points : 0
    • Joined: 2019/02/04 23:17:18
    • Location: 0
    • Status: offline
    Re: Microchip CAN bus analyzer not reading CAN bus. 2019/04/12 01:04:49 (permalink)
    0
    Hi Sapiens,
    I changed my code and now I am able to communicate with Microchip CAN bus analyzer. My modified portion of code is given below:-
    /* Fbaud = Fosc/(2*N*BRP),  N = SYNC + PHSEG1 + PHSEG2 + PROPSEG = 16
    Here Fosc = 8MHz and BRP = 2 therefore Fbaud = 125kps */
    void CAN_BitTiming(void){
    C2CFG = 0x0001a701 ;
    }
     
    void main() {
     unsigned long int mult ;
    CAN2TxMessageBuffer * transmitMessage;
    CAN_ConfigurationMode();
    CAN_BitTiming();
    C2CONbits.ON = 1;
    CAN_AssignFIFO();
    CAN_NormalMode();
    buffer = (CAN2TxMessageBuffer *)(PA_TO_KVA1(C2FIFOUA0)) ;
    buffer -> CMSGSID.SID = 0x102 ;
    buffer -> CMSGEID.EID = 0xc000 ;
    buffer -> CMSGEID.IDE = 1 ;
    buffer -> CMSGEID.DLC = 1 ;
    buffer -> messageWord[2] = 0x77 ;
    C2FIFOCON0SET= 0x2000;
    C2FIFOCON0SET= 0x08;
    Timer_delay();
    }
    CAN bus analyzer is showing correct values for DLC(which is 1) and Data0(which is 0x77) but ID shown by CAN analyzser is not same as of transmitted by me. I have assigned SID as 0x102 and EID as 0xc000 but CAN analyzer is showing ID as 0x408c000x.
    Do anyone has an idea about this issue? Thanks in advance.
    #2
    Jump to:
    © 2019 APG vNext Commercial Version 4.5