AN2343 Freescale Semiconductor / Motorola, AN2343 Datasheet - Page 12

no-image

AN2343

Manufacturer Part Number
AN2343
Description
HC908EY16 LIN Monitor
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
AN2343/D
Function Name
Engineer
Date
Parameters
Returns
Notes
*****************************************************************************/
void Disable_ICG(void)
{
}
/****************************************************************************
Function Name
Engineer
Date
Parameters
Returns
Notes
*****************************************************************************/
void Initialise_Ports(void)
{
}
/****************************************************************************
Following display routines are to be used in conjunction with a Hitachi LCD
display.
This application only uses a 7 line interface, connected as follows:
Display
EY16 Port C1 C0 A6 A5 B2 B1 B0
The interface will be initialised into four bit mode, where each byte transfer is completed
12
unsigned short delay1 = 0;
EY16ICG.icgcr.byte = 0x0A;
EY16ICG.icgcr.byte = 0x1A;
while (delay1++ != 100);
EY16ICG.icgcr.byte = 0x12;
while (!(EY16ICG.icgcr.byte & 0x13))
{
}
EY16PORT.pta.byte = 0x00;
EY16PORT.ptb.byte = 0x00;
EY16PORT.ptc.byte = 0x00;
EY16PORT.ptd.byte = 0x00;
EY16PORT.pte.byte = 0x00;
EY16PORT.ddra.byte = 0x70;
EY16PORT.ddrb.byte = 0x20;
EY16PORT.ddrc.byte = 0x00;
EY16PORT.ddrd.byte = 0x00;
EY16PORT.ddre.byte = 0x00;
EY16PORT.ptb.byte = 0x20;
D7 D6 D5 D4 RS RW E
:
:
:
:
:
:
:
:
EY16ICG.icgcr.byte = 0x12;
:
:
:
:
:
:
:
:
:
Disable_ICG
C. Culshaw
06/09/02
None
None
The EY16 defaults to its internal clock generator (ICG).
For this application, disable the ICG & select the
external crystal
Initialise_Ports
C. Culshaw
06/09/02
None
None
For this LIN application, Port B bit 5 is used to enable
the LIN Physical Interface
General purpose LEDs are connected to port A bits 4,5,6
& port D bits 0 & 1
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
HC908EY16 LIN Monitor
// ICG and ECLK ON
// set CS
// now put ICG OFF
// CS = ECLK, Ext clk ON and ICG off
// Ensure all port registers
// ’cleared’ to default
// Set port A bits 4,5,6 (LEDs) to O/P, rest input
// Set port B bit 5 (LINEN) to O/P, rest input
// Set port C to input & do not output MCLK
// Set port D to input
// Set port E to input
// LIN enabled
MOTOROLA

Related parts for AN2343