TWR-K60N512-KEIL Freescale Semiconductor, TWR-K60N512-KEIL Datasheet - Page 145

no-image

TWR-K60N512-KEIL

Manufacturer Part Number
TWR-K60N512-KEIL
Description
K60N512 Keil Tower Kit
Manufacturer
Freescale Semiconductor
Series
Kinetisr
Type
MCUr

Specifications of TWR-K60N512-KEIL

Rohs Compliant
YES
Contents
4 Boards, Documentation, DVD
Peak Reflow Compatible (260 C)
Yes
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
For Use With/related Products
Freescale Tower System, K60N512
15.2.2 Receive process
FlexCAN requires three steps to configure an MB as an Rx MB to initiate a receive
process.
15.2.2.1 Code example and explanation
The receive process to prepare a Rx MB is:
15.2.3 Transmit process
FlexCAN requires four steps to configure an MB as a Tx MB to initiate a transmit
process.
15.2.3.1 Code example and explanation
The transmit process to prepare and start a Tx MB is:
// Follow 4 steps for Transmit Process
pFlexCANReg->MB[iTxMBNo].CS = FLEXCAN_MB_CS_CODE(FLEXCAN_MB_CODE_TX_INACTIVE)
// write inactive code
pFlexCANReg->MB[iTxMBNo].ID = (prio << FLEXCAN_MB_ID_PRIO_BIT_NO)
pFlexCANReg->MB[iTxMBNo].WORD0 = word[0];
Freescale Semiconductor
11. Enable the corresponding interrupts by setting required interrupt mask bits in
12. Negate the MCR[HALT] bit.
13. Wait till FlexCAN is out of freeze mode (MCR[FRZ_ACK] = 0).
// Write ID
| (wno<<FLEXCAN_MB_CS_IDE_BIT_NO)
| (bno<<FLEXCAN_MB_CS_RTR_BIT_NO)
;
| ((msgID & ~(CAN_MSG_IDE_MASK|CAN_MSG_TYPE_MASK))<<i);
// Deactivate the rx MB for cpu write
IMASKn register (for all MB interrupts), CTRLn register (for Bus off & Error
interrupts), and MCR register (for wakeup interrupt).
pFlexCANReg->MB[iMB].CS = LEXCAN_MB_CS_CODE(FLEXCAN_MB_CODE_RX_INACTIVE);
id2 = id & ~(CAN_MSG_IDE_MASK | CAN_MSG_TYPE_MASK);
if(id & CAN_MSG_IDE_MASK)
{
}
else
{
}
// Activate the MB for rx
pFlexCANReg->MB[iMB].CS = FLEXCAN_MB_CS_CODE(FLEXCAN_MB_CODE_RX_EMPTY);
pFlexCANReg->MB[iMB].ID = id2;
pFlexCANReg->MB[iMB].ID = id2<<FLEXCAN_MB_ID_STD_BIT_NO;
Kinetis Quick Reference User Guide, Rev. 0, 11/2010
Chapter 15 FlexCAN Module
145

Related parts for TWR-K60N512-KEIL