AN2103 Freescale Semiconductor / Motorola, AN2103 Datasheet - Page 43

no-image

AN2103

Manufacturer Part Number
AN2103
Description
Local Interconnect Network (LIN) Demonstration
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
AN2103
MOTOROLA
/************************* #Defines ******************************************/
/* Points to register block in memory */
#define AZ60_PORT (*(tPORT*) (0x0000))
#define AZ60_TIMER (*(tTIMER*) (0x0020))
#define AZ60_SI (*(tSI*) (0x0010))
#define AZ60_SIM (*(tSIM*) (0xFE00))
#define AZ60_KBD (*(tKBD*) (0x001A))
#define AZ60_MSCAN08 (*(tMSCAN*) (0x0500))
/******************************************************************************
Function Name
Engineer
Date
Parameters
Returns
Notes
******************************************************************************/
void main(void)
{
{
}
/* Local variables */
tU08 i;
MCUInitialisation();
LIN_Init();
/***************************************
LIN drivers TOC attached to output ports
Disabled on production software
***************************************/
/* Disable timer channels from ports */
AZ60_TIMER.tasc0.byte = AZ60_TIMER.tasc0.byte & 0xF3;
AZ60_TIMER.tasc1.byte = AZ60_TIMER.tasc1.byte & 0xF3;
/* Enable MC33399 device */
AZ60_PORT.pte.bit.pte3 = 1;
AZ60_PORT.ddre.bit.ddre3 = 1;
for (i=0; i<0xff; ++i)
/* Enable Global Interrupts */
asm
cli
/* Transmit Alive Message */
MsgWriteBuf[0] =
MsgWriteBuf[1] =
LIN_PutMsg(SlaveMsg[0].WriteMsg, MsgWriteBuf);
LIN_RequestMsg(SlaveMsg[0].WriteMsg);
if ((AZ60_PORT.ptd.byte & 0xF0) != 0x00)
{
}
ScheduleTableInit();
;
SystemFlags.bit.canmode=1;
:
:
:
:
:
:
ALIVE_COMMAND;
ALIVE_BYTE;
Main
R29414
09/02/2000
none
none
Main loop
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
// loop control
// Initialisation of MCU register
// LIN Drivers Initialisation service
//LIN I/F
// Wait for LIN to switch ON
// Copy transmit data to LIN buffers
// Transmit LIN message
// Standalone mode or CAN mode
// CAN mode
// Initialise schedule table
Master Code – Master08.C
Code Listings
43

Related parts for AN2103