AN2575 Freescale Semiconductor / Motorola, AN2575 Datasheet - Page 16

no-image

AN2575

Manufacturer Part Number
AN2575
Description
MC68HC908EY16 ESCI LIN Drivers
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
AN2575/D
/******************************************************************************
*
*
*
*
*
*
*
*
*
*
*
*
*
*
******************************************************************************/
void main (void)
{
while (1)
{
16
CONFIG1 = 0x01;
CONFIG2 = 0x45;
ICGMR = 64;
DDRA = 0x70;
DDRB = 0x27;
DDRC = 0x83;
PTB
TBCR = 0x00;
TBCR = 0x02;
TASC
TASC0 = 0x44;
TASC
Initialise_Display();
asm cli;
LIN_Init();
if (TBCR & 0x80)
{
Function name: Main
Originator:
Date:
Function:
TBCR |= 0x08;
tick++;
if (tick & 0x01)
{
}
else
{
}
= 0x20;
= 0x30;
= 0x00;
PTA |= 0x10;
PTA &= ~(0x10);
P. Topping
21th March 2003
Initialise CONFIG registers, ICGMR, Ports and Timers.
Initialise LCD module & LIN drivers and enable interrupts.
Pace a slow loop (~4Hz for a 4MHz bus) using the timebase
module. Within this loop the keys are read, the LIN buffer
is read and the LCD module is updated. If requested by
pressing the PTA2 key, a trimming operation is performed.
ICGTR or ICGMR are incremented or decremented (according to
the level of PTA2) once per loop if the PTA3 key is pressed
PTD1 selects ICGTR or ICGMR for display and inc./dec.
Freescale Semiconductor, Inc.
For More Information On This Product,
MC68HC908EY16 ESCI LIN Drivers
Go to: www.freescale.com
/* dissable COP
/* slow clock for TBM
/* ICG nominal 15.9744 MHz */
/* port A 5-6, port B 0-2
/* and port C 0-1 for LCD
/* port B bit 5 for LPI
/* enable MC33399 LPI
/* divide by 2**22: ~4Hz @ */
/* 4MHz bus & enable TBM
/* reset timer A
/* IC TAch0 - rising edges */
/* and start timer A
/* initialise LCD module
/* enable interrupts
/* initialise LIN drivers
/* is TBM flag set?
/* yes, clear it
/* check bit 0 of tick
/* tick LED (PTA4) off
/* tick LED (PTA4) on
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
MOTOROLA

Related parts for AN2575