AN2343 Freescale Semiconductor / Motorola, AN2343 Datasheet - Page 14

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 Write_Line2(unsigned char msg_id)
{
14
while (Busy_Status() == 0x01);
if (regsel == 1)
else
// shift data to allow high nibble to be written to display
Display_Port(data/16);
Clock_Display();
// mask & transmit low nibble
Display_Port(data & 0x0F);
Clock_Display();
asm NOP;
char nibble_pos = 0x00, byte;
unsigned char hi_nibble, lo_nibble;
switch (msg_id)
{
{
}
{
}
:
:
:
:
:
:
:
:
case 0x20:
case 0x30:
EY16PORT.ptb.byte |= 0x04;
EY16PORT.ptb.byte &= ~(0x04);
Write_Line2
C. Culshaw
06/09/02
msg_id - id of message to be displayed
None
Update second line of display with the received message
data bytes
Currently set up to act on ids 0x20 & 0x30 only
for(byte = 0; byte < 4; byte++)
{
}
break;
// Message 0x30 is a 8 byte message, but because of display size
// & since only the first 5 bytes are being used in this
// application, then only display these 5 bytes.
for(byte = 0; byte < 5; byte++)
Freescale Semiconductor, Inc.
For More Information On This Product,
// Extract high nibble, then add ascii offset
hi_nibble = (Message_20[byte]/16) + 0x30;
// Extract low nibble, then add ascii offset
lo_nibble = (Message_20[byte]&0x0F) + 0x30;
// if either nibble between A & F, additional ascii offset required
if (hi_nibble > 0x39)
if (lo_nibble >= 0x39)
DisplayChar(2, nibble_pos++, hi_nibble);
DisplayChar(2, nibble_pos++, lo_nibble);
nibble_pos++;
Go to: www.freescale.com
HC908EY16 LIN Monitor
// Read busy status (Display D7)
// Display E Hi / Lo
// Display E Hi / Lo
// Convenient Break point setting!
hi_nibble+=0x07;
lo_nibble+=0x07;
// Display RS high
// Display RS low
MOTOROLA

Related parts for AN2343