AN2432 Freescale Semiconductor / Motorola, AN2432 Datasheet - Page 14

no-image

AN2432

Manufacturer Part Number
AN2432
Description
LIN Sample Application for the MC68HC908EY16 Evaluation Board
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
AN2432/D
unsigned char no_30 = 0;
/******************************************************************************
*
*
*
******************************************************************************/
void main (void)
{
CONFIG1 = 0x01;
CONFIG2 = 0x29;
PTB
DDRA
DDRB
DDRC
DDRD
while (ICGCR != 0x13)
{ ICGCR = 0x12; }
TBCR = 0x00;
TBCR = 0x02;
asm CLI;
LIN_Init();
while (1)
{
14
if (TBCR & 0x80)
{
Function name: Main
= 0x20;
= 0x7C;
= 0xE7;
= 0x83;
= 0x03;
TBCR |= 0x08;
count ++;
if (count & 0x80)
{
}
else
{
}
LIN_IdleClock ();
if (LIN_DriverStatus() & LIN_STATUS_IDLE) /* bus idle for 500 tries? */
{
}
else
{
/* PTB |= 0x20; */
PTD |= 0x01;
PTD &= ~(0x01);
PTD |= 0x02;
PTD &= ~(0x02);
LIN Sample Application for the MC68HC908EY16 Evaluation Board
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
/* disable COP
/* ext.clk, fast timebase
/* MC33399 enable high
/* A4, 5 & 6 out for LEDs
/* B5 out for 33399 enable */
/* enable MCLK (C2)
/* D0 & D1 out for LEDs
/* switch to ext. clock
/* and wait for switch
/* divide by 32768 (244Hz
/* @ 8MHz) & switch TBM on */
/* enable interrupts
/* initialise LIN drivers
/* is TBM flag set?
/* yes, clear it
/* increment tick counter
/* check MS bit of count
/* tick LED off
/* tick LED on
/* check for bus activity
/* yes, activity LED off
/* MC33399 enable low
/* no, bus activity LED on */
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
MOTOROLA

Related parts for AN2432