2005-01-13 06:05 AM
ST10F276 CAN initialization - receives are transmitted
2005-01-12 08:02 AM
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, Wyatt2005-01-13 06:05 AM
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!