AN2103 Freescale Semiconductor / Motorola, AN2103 Datasheet - Page 49

no-image

AN2103

Manufacturer Part Number
AN2103
Description
Local Interconnect Network (LIN) Demonstration
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
AN2103
MOTOROLA
} //End of MCU Initialisation
/******************************************************************************
Function Name
Engineer
Date
Parameters
Returns
Notes
******************************************************************************/
void TxCANMsg (tU08 *MsgBuffer, tU16 CANId)
{
}
/******************************************************************************
Function Name
Engineer
Date
Parameters
Returns
Notes
******************************************************************************/
void TxCANBuffer(tTXBUF *Buffer, tU08 TxBufferID)
AZ60_PORT.ptb.byte = 0xFF;
AZ60_PORT.ddrb.byte = 0xFF;
AZ60_PORT.ptc.bit.ptc0 = 0;
AZ60_PORT.ddrc.bit.ddrc0 = 1;
/* CAN I/F Configuration */
SetMC33388Mode(NORMAL);
AZ60_PORT.ddrf.byte = PTF4|PTF3;
SystemFlags.byte = 0;
InitialiseMSCAN08();
StatusMsg.id.w[0] = 0x0000;
StatusMsg.dlr = 0;
StatusMsg.tbpr = 0;
/* Initialise TIMB Overflow */
AZ60_TIMER.tbsc.byte = 0x30;
AZ60_TIMER.tbmod.word = 0x3E8;
AZ60_TIMER.tbsc.byte = 0x40;
tU08 i;
StatusMsg.id.w[0] = ((CANId <<5) & 0xFFE0);
StatusMsg.dlr = sizeof(MsgBuffer);
for (i=0 ; i < StatusMsg.dlr ; i++ )
{
}
TxCANBuffer(&StatusMsg,MSCAN_TX0);
{
tU08
StatusMsg.dsr[i] = MsgBuffer[i];
i;
:
:
:
:
:
:
:
:
:
:
:
:
TxCANMsg
R29414
22/02/00
*MsgBuffer, CANId
None
TxCANBuffer
R38917
11/02/00
*Buffer, TxBufferID
None
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
// Port B o/p for LEDs
// put MC33388 into normal mode
// PTF3=EN and PTF4=STB pins on MC33388
// reset all system flags
// MSCAN Initialisation
// standard 11-bit ID = 1
// 0 data bytes
// set CAN status message ID, DLR and priority
// Reset TIMB
// 1ms overflow when 1Meg Bus and pre-scale=0
// Enable TIMB OVR Interrupt & Start timer
// Calculate id
// Calculate number of data bytes in buffer
// Transfer data bytes to CAN message buffer
Master Code – Master08.C
Code Listings
49

Related parts for AN2103