DataSheet.es    


PDF AN2264 Data sheet ( Hoja de datos )

Número de pieza AN2264
Descripción AN2264
Fabricantes Motorola Semiconductors 
Logotipo Motorola Semiconductors Logotipo



Hay una vista previa y un enlace de descarga de AN2264 (archivo pdf) en la parte inferior de esta página.


Total 20 Páginas

No Preview Available ! AN2264 Hoja de datos, Descripción, Manual

Application Note
AN2264/D
Rev. 0, 3/2002
LIN Node Temperature
Display
Freescale Semiconductor, Inc.
by Peter Topping
8/16 Bit Applications Engineering
Motorola, East Kilbride
Introduction
Many of the problems of excessive wiring within a car can be resolved by using
a serial multiplex bus like CAN or LIN. The LIN (Local Interconnect Network,
reference 1) bus is lower in cost and ideally suited to use within a door or in
other areas in the car where its limited data rate of 20,000 baud is adequate.
The display of external temperature is an application which falls into this
category. As a common location for the outside temperature sensor is in a wing
mirror, the data often originates from the door. The actual display is, however,
within the car some distance away and the LIN bus is eminently suitable to
facilitate the connection. A LIN node requires only 3 wires; there is one LIN data
line, the other two connections being the positive and negative supplies.
This application note presents the design of a temperature display LIN slave
node. It was developed as part of a complete door project which also included
the keypad module described in application note AN2205. The messaging
scheme for the door incorporated a byte for temperature in the mirror response
field as shown in table 1. The LIN master is, in this case, the body controller.
On a regular basis, say every 100ms, the master sends a frame header with
the mirror’s ID and it responds with the two-byte message shown. It includes a
byte with the temperature encoded in half Centigrade degree increments from
–30°C to 97.5°C. In this case the data is read directly by the temperature
display node (slave to slave communication) but could alternatively be read by
the master and retransmitted to the relevant slave node.
For More Information On This Product,
Go to: www.freescale.com
© Motorola, Inc., 2002

1 page




AN2264 pdf
Software
MOTOROLA
Freescale Semiconductor, Inc.
AN2264/D
Software
The temperature display module uses the Motorola/Metrowerks LIN drivers so
all I/O activity is handled outwith the application code which simply uses a
“LIN_GetMsg()” to receive the data provided by the sensor in the door mirror.
The use of the LIN drivers results in fairly simple application software for the
temperature node. In order to respond to a master request command frame (ID
0x3C), the user code has to include the function void LIN_Command(). This is,
for instance, how the master would request all slave nodes to go into their
low-power standby or “sleep” mode. In this application, sleep mode is entered
when there is no bus activity and this function is just a dummy while(1).
The main software flow diagram is shown in figure 2 and the complete code
listed in section 5. Once the variables have been declared, the CONFIG and
I/O registers are initialised. The CONFIG1 value of 0x71 disables the COP
while the CONFIG2 value of 0x19 configures the MCU as an
MC68HC908AZ60A (as opposed to an AS60A). Interrupts are enabled so that
the LIN drivers, once initialised by LIN_init(), can function. The main while loop
uses the programmable interrupt timer (PIT) to facilitate a 200Hz repetition rate
based on an 8MHz crystal. Once every 5ms the PIT overflow flag is set and the
main loop is executed to convert the binary input data into 7-segment format.
The 200Hz rate is also used to cycle round the 4 LED digits facilitating a flicker
free 50Hz multiplexed display. Although the LIN buffer is read and the
temperature converted into 4-digit 7-segment format every time, only one digit
is actually driven every 5ms.
The LIN driver function LIN_IdleClock can check whether or not there is any
bus activity. If not it increments a counter whose value is compared with
LIN_IDLETIMEOUT (defined in slave.cfg). If this number is exceeded the
function LIN_DriverStatus() ceases to return a 1 (LIN_STATUS_RUN)
indicating that the bus has been idle for, in this application, 2 seconds. If this is
detected, the enable pin of the MC33399 is taken low and the MCU is powered
down by the disabling of the LT1121. The code also sets the display to “….”.
This is irrelevant in the powered down application but gave an indication of a
detected idle condition in the development environment where the emulated
MCU’s power was not controlled by the LT1121. In this application it also made
sense to show a special display if temperature data was not being provided to
the module. Without this addition the display would continue to show the last
received temperature (or –30°C if none had been received since the last power
up). This feature was incorporated using LIN_MsgStatus(0x0A) in conjunction
with the variable error_count and forces the display to “----” after a second of
not receiving a LIN message with an ID of 0A (see figure 4).
To perform the conversion, the temperature byte is transferred to the variable
bits and, if the temperature is positive, the offset of 60 (30 C°) subtracted. This
would result in an incorrect underflowed value in bits if the temperature is
LIN Node Temperature Display
For More Information On This Product,
Go to: www.freescale.com
5

5 Page





AN2264 arduino
Freescale Semiconductor, Inc.
/******************************************************************************
*
* Function:
LIN_Command
* Description:
User call-back.
* Called by the driver after successful transmission or
* receiving of the Master Request Command Frame (ID: 0x3C).
* Returns:
never returns
*
******************************************************************************/
void LIN_Command()
{
while (1)
{
}
}
/*****************************************************************************
*
* Function name: Main
* Originator: P. Topping
* Date:
5th January 2002
*
******************************************************************************/
void main (void)
{
unsigned char bits;
unsigned char units;
unsigned char tens;
unsigned char negative;
unsigned char error_count;
CONFIG1 = 0x31;
CONFIG2 = 0x11;
/* disable LVI and COP
*/
/* AZ60A, MSCAN disabled */
DDRA
DDRB
DDRC
DDRD
DDRE
DDRF
DDRG
DDRH
= 0xFF;
= 0xFF;
= 0x3F;
= 0xFF;
= 0xFD;
= 0x7F;
= 0x07;
= 0x03;
/* configure unused port */
/* pins as outputs
*/
/* segment drive
*/
/* LIN interface (MC33399) */
/* digit drive via FETs */
PTE = 0x04;
/* MC33399 enable high
*/
asm CLI;
/* clear interrupt mask */
LIN_Init();
/* initialise LIN drivers */
PITSC = 0x10;
PMODH = 0x27;
PMODL = 0x10;
/* start PIT at /1
*/
/* /10000 for a repetition */
/* rate of 200Hz @ 8MHz. */
while (1)
{
if (PITSC & 0x80)
/* is PIT overflow set? */
MOTOROLA
LIN Node Temperature Display
For More Information On This Product,
Go to: www.freescale.com
AN2264/D
Software listing
11

11 Page







PáginasTotal 20 Páginas
PDF Descargar[ Datasheet AN2264.PDF ]




Hoja de datos destacado

Número de piezaDescripciónFabricantes
AN2262Wireless HC08 ModemMotorola Semiconductors
Motorola Semiconductors
AN2264AN2264Motorola Semiconductors
Motorola Semiconductors

Número de piezaDescripciónFabricantes
SLA6805M

High Voltage 3 phase Motor Driver IC.

Sanken
Sanken
SDC1742

12- and 14-Bit Hybrid Synchro / Resolver-to-Digital Converters.

Analog Devices
Analog Devices


DataSheet.es es una pagina web que funciona como un repositorio de manuales o hoja de datos de muchos de los productos más populares,
permitiéndote verlos en linea o descargarlos en PDF.


DataSheet.es    |   2020   |  Privacy Policy  |  Contacto  |  Buscar