Skip to main content
Visitor II
January 13, 2005
Question

ST10F276 CAN initialization - receives are transmitted

  • January 13, 2005
  • 2 replies
  • 768 views
Posted on January 13, 2005 at 15:05

ST10F276 CAN initialization - receives are transmitted

    This topic has been closed for replies.

    2 replies

    wjohnsonAuthor
    Visitor II
    January 12, 2005
    Posted on January 12, 2005 at 17:02

    Using a ST10F276 micro, we're trying to set up an object as a receive, with one specific identifier accepted. the first thing we do is make sure the object is not valid, by clearing the MSGVAL bit (even though this is just after a reset) like this:

    /* Wait for the previous object to finish writing */

    while(buffer->ptr->F1CR & IF_BUSY)

    ;

    /* set the MSG_VAL to not valid before configuring

    /* a whole object */

    buffer->ptr->F1A2 = 0;

    /* specify what to write */

    buffer->ptr->F1CM = IF_ARB | IF_WRRD;

    /* write it */

    buffer->ptr->F1CR = buffer->msg_obj;

    Then, we set up the object like this:

    /* wait for it to write */

    while(buffer->ptr->F1CR & IF_BUSY)

    ;

    /* there will be an array of pointers to message

    /* buffers. Put the Rx's first. */

    buffer->ptr->F1M1 = 0xFF00;

    buffer->ptr->F1M2 = 0xE3FF;

    buffer->ptr->F1A1 = 0x0005;

    buffer->ptr->F1A2 = 0xD800;

    buffer->ptr->F1MC = 0x1480;

    buffer->ptr->F1DA1 = 0;

    buffer->ptr->F1DA2 = 0;

    buffer->ptr->F1DB1 = 0;

    buffer->ptr->F1DB2 = 0;

    buffer->ptr->F1CM = 0xFF

    /* Write the data to the next object */

    buffer->ptr->F1CR = buffer->msg_obj;

    Unfortunately, when we do this initialization, a message is transmitted out on the bus with this identifier (0x18000005), but no data bytes. Has anyone seen behavior like this? Does anyone have any ideas for me to avoid this?

    Thanks,

    Wyatt

    wjohnsonAuthor
    Visitor II
    January 13, 2005
    Posted on January 13, 2005 at 15:05

    Thank you SOOOOO much! I can't believe I missed that. I never use remote frames, so that never even crossed my mind.

    Thanks again for your help!