AN2320 Freescale Semiconductor / Motorola, AN2320 Datasheet - Page 22

no-image

AN2320

Manufacturer Part Number
AN2320
Description
Interfacing the MCF5272 to a Standalone CAN Controller
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
CAN Transmit and Receive
CAN_MsgObj_IntEnable
reception of data. It selects the interrupt node pointer to be used which can then be routed to the external
interrupt request signals, OUT1 or OUT0, using the 82C900 global control register.
void CAN_MsgObj_IntEnable(uint8 Msg, uint8 TxRx, uint8 IntNode)
{
/*Set msg obj receive interrupt node pointer*/
/*Msg obj Rx interrupt enable*/
/*Set msg obj transmit interrupt node pointer*/
/*Msg obj Tx interrupt enable*/
}
CAN_MsgObjRx_Enable
void CAN_MsgObjRx_Enable(uint8 Msg)
{
/*Msg obj valid */
QSPI_SendByte(CAN_MSG_CTRL + (Msg*0x20), 0xBF);
}
CAN_MsgObjTx_Start
message object (as for receive above), the new data flag must be set, the CPU update flag must signal
completion, and the transmit request flag must be set.
void CAN_MsgObjTx_Start(uint8 Msg)
{
/*Msg obj CPU update complete, can Tx msg automatically*/
QSPI_SendByte(CAN_MSG_CTRL+1 + (Msg*0x20), 0xF7);
/*Msg obj
QSPI_SendByte(CAN_MSG_CTRL+1 + (Msg*0x20), 0xFE);
/*Msg obj valid*/
QSPI_SendByte(CAN_MSG_CTRL + (Msg*0x20), 0xBF);
/*Msg obj Tx request flag set*/
QSPI_SendByte(CAN_MSG_CTRL+1 + (Msg*0x20), 0xEF);
}
22
if (TxRx == Rx)
QSPI_SendByte(CAN_MSG_CONFIG+2 + (Msg*0x20), IntNode);
QSPI_SendByte(CAN_MSG_CTRL + (Msg*0x20), 0xFB);
}
else
{
QSPI_SendByte(CAN_MSG_CONFIG+2 + (Msg*0x20), (uint8)(IntNode<<4));
QSPI_SendByte(CAN_MSG_CTRL + (Msg*0x20), 0xEF);
}
{
has new data*/
Interfacing the MCF5272 to a Standalone CAN Controller
sets up a message object to begin transmission. In addition to validating the
enables a receive message object to receive data on the CAN bus.
enables a message object to generate an interrupt on successful transmission or
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
MOTOROLA

Related parts for AN2320