Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
01/25/08 13:29
Read: times


 
#149947 - Problem solved
Responding to: ???'s previous message
Problem solved: you HAVE to wait with this approach

// Receive Data from the IF2 buffer
bit receive_data (char MsgNum)
{
  SFRPAGE  = CAN0_PAGE; // IF2 already set up for RX

  CAN0ADR  = IF2CMDRQST;// Point to Command Request Reg.
  CAN0DATL = MsgNum;    // Move new data for RX from Msg Obj "MsgNum"
                        // Move new data to a
  // --initiates write to Msg Obj
  // 3-6 CAN clock cycles to move IF register contents to the Msg Obj in CAN RAM
  while (CAN0DATH > 0x7f); // wait for busy to go away !

  CAN0ADR  = IF2MSGC;
  if(!(CAN0DATH & 0x80)) {
    SFRPAGE  = LEGACY_PAGE;
    return(0);
  }
  CAN0DATH=0;

  CAN0ADR  = IF2DATA1;  // Point to 1st byte of Data Field


List of 4 messages in thread
TopicAuthorDate
CAN bus: losing Messages on Silabs F040            01/01/70 00:00      
   Problem solved            01/01/70 00:00      
      Question - Why does the example code work?            01/01/70 00:00      
         Why does it work            01/01/70 00:00      

Back to Subject List