DRM for Driver Information System on S12G128. Reference Design



Similar documents
Flexible Active Shutter Control Interface using the MC1323x

Software Real Time Clock Implementation on MC9S08LG32

How To Control A Motor Control On An Hvac Platform

IRTC Compensation and 1 Hz Clock Generation

Connecting Low-Cost External Electrodes to MED-EKG

Freescale Embedded GUI Converter Utility 2.0 Quick User Guide

Blood Pressure Monitor Using Flexis QE128 Gabriel Sanchez RTAC Americas

Cyclic Redundant Checker Calculation on Power Architecture Technology and Comparison of Big-Endian Versus Little-Endian

etpu Host Interface by:

Installation of the MMA955xL CodeWarrior Service Pack Author: Fengyi Li Application Engineer

Using eflexpwm Module for ADC Synchronization in MC56F82xx and MC56F84xx Family of Digital Signal Controllers

Windows 7: Using USB TAP on a Classic CodeWarrior Installation (MGT V9.2 DSC V8.3)

Connecting to an SMTP Server Using the Freescale NanoSSL Client

MC13783 Buck and Boost Inductor Sizing

Hardware Configurations for the i.mx Family USB Modules

Local Interconnect Network (LIN) Physical Interface

How To Build A Project On An Eclipse Powerbook For Anarc (Powerbook) On An Ipa (Powerpoint) On A Microcontroller (Powerboard) On Microcontrollers (Powerstation) On Your Microcontroller 2 (Powerclock

Using WinUSB in a Visual Studio Project with Freescale USB device controller

How to Convert 3-Axis Directions and Swap X-Y Axis of Accelerometer Data within Android Driver by: Gang Chen Field Applications Engineer

Programming Audio Applications in the i.mx21 MC9328MX21

PowerQUICC II Pro (MPC83xx) PCI Agent Initialization

Handling Freescale Pressure Sensors

Using the Performance Monitor Unit on the e200z760n3 Power Architecture Core

USB HID bootloader for the MC9S08JM60

Freescale Semiconductor. Integrated Silicon Pressure Sensor. On-Chip Signal Conditioned, Temperature Compensated and Calibrated MPX4080D.

3-Phase BLDC Motor Control with Hall Sensors Using 56800/E Digital Signal Controllers

Understanding LCD Memory and Bus Bandwidth Requirements ColdFire, LCD, and Crossbar Switch

MCF54418 NAND Flash Controller

Generate Makefiles from Command Line Support in Eclipse-Based CodeWarrior Software

Configuring the FlexTimer for Position and Speed Measurement with an Encoder

Point-of-Sale (POS) Users Guide Lech José Olmedo Guerrero Jaime Herrerro Gallardo RTAC Americas

Performance Monitor on PowerQUICC II Pro Processors

Data Movement Between Big-Endian and Little-Endian Devices

Improving Embedded Software Test Effectiveness in Automotive Applications

Using the Kinetis Security and Flash Protection Features

Freescale Variable Key Security Protocol Transmitter User s Guide by: Ioseph Martínez and Christian Michel Applications Engineering - RTAC Americas

Initializing the TSEC Controller

VLE 16-bit and 32-bit Instruction Length Decode Algorithm

VGA Output using TV-Out Extension Solution i.mx21

Emulated EEPROM Implementation in Dual Flash Architecture on MC9S08LG32 With Demo Description

How To Measure Power Of A Permanent Magnet Synchronous Motor

Processor Expert Software Microcontrollers Driver Suite Getting Started Guide

Detecting a CPM Overload on the PowerQUICC II

Adding SDIO Wi-Fi Solution to i.mx Windows CE 5.0/Windows CE 6.0

NOT RECOMMENDED FOR NEW DESIGN

Ref Parameters Symbol Conditions Min Typ Max Units. Standby μa. 3 Range kpa. 4 Resolution 0.15 kpa. 5 Accuracy -20ºC to 85ºC ±1 kpa

Freescale Semiconductor. Integrated Silicon Pressure Sensor. On-Chip Signal Conditioned, Temperature Compensated and Calibrated MPX5500.

BLDC Motor Control with Hall Effect Sensors Using the 9S08MP

Real Time Development of MC Applications using the PC Master Software Visualization Tool. 1. Introduction. 2. Development of Motor Control.

User Interface Design using CGI Programming and Boa Web Server on M5249C3 Board

How To Fit A 2Mm Exposed Pad To A Dfn Package

AND8336. Design Examples of On Board Dual Supply Voltage Logic Translators. Prepared by: Jim Lepkowski ON Semiconductor.

Using XGATE to Implement LIN Communication on HCS12X Daniel Malik 8/16-Bit Products Division East Kilbride, Scotland

NOT RECOMMENDED FOR NEW DESIGN

MPC8245/MPC8241 Memory Clock Design Guidelines: Part 1

Using the High Input Voltage Charger for Single Cell Li-Ion Batteries (KIT34671EPEVBE)

RF Power Field Effect Transistors N- Channel Enhancement- Mode Lateral MOSFETs

Pressure Freescale Semiconductor

MSC8156 and MSC8157 PCI Express Performance

Freescale Semiconductor, Inc. Product Brief Integrated Portable System Processor DragonBall ΤΜ

Avoiding Read While Write Errors When Developing In-Software Flash Programming Applications for Kinetis and ColdFire+ MCUs

Robust Over-the-Air Firmware Updates Using Program Flash Memory Swap on Kinetis Microcontrollers

Freescale Semiconductor. Integrated Silicon Pressure Sensor

Comparison of MC9S08QE128 and MCF51QE128 Microcontrollers Scott Pape and Eduardo Montanez Systems Engineering, Freescale Microcontroller Division

Implementing Positioning Algorithms Using Accelerometers

Genesi Pegasos II Setup

i.mx28 Ethernet Performance on Linux

MLPPP in the Evolving Radio Access Network

NOT RECOMMENDED FOR NEW DESIGN

PQ-MDS-T1 Module. HW Getting Started Guide. Contents. About This Document. Required Reading. Definitions, Acronyms, and Abbreviations

White Paper. Freescale s Embedded Hypervisor for QorIQ P4 Series Communications Platform

MPXAZ6115A MPXHZ6115A SERIES. Freescale Semiconductor Technical Data. MPXAZ6115A Rev 4, 01/2007

Designing an Induction Cooker Using the S08PT Family

76-77 GHz RF Transmitter Front-end for W-band Radar Applications

Understanding Pressure and Pressure Measurement

Using the High-Input-Voltage Travel Charger for Single Cell Li-Ion Batteries (KIT34674EPEVBE)

NUD4011. Low Current LED Driver

Software Marketing, Embedded Real-Time Solutions

CodeWarrior Development Studio for Freescale S12(X) Microcontrollers Quick Start

Enhanced Serial Interface Mapping

Using Program Memory As Data Memory. 1. Introduction Program Memory and Data. Contents. Memory. Freescale Semiconductor Application Note

KIT34845EPEVME Evaluation Board

Prepared by: Paul Lee ON Semiconductor

3-Phase BLDC Motor Control with Hall Sensors Using the MC56F8013

AND8326/D. PCB Design Guidelines for Dual Power Supply Voltage Translators

Techniques and Tools for Software Analysis

Tire Pressure Monitoring Sensor Temperature Compensated and Calibrated, Fully Integrated, Digital Output

1 Introduction. Freescale Semiconductor Application Note. Document Number: AN3031 Rev. 1, 04/2010

Installing Service Pack Updater Archive for CodeWarrior Tools (Windows and Linux) Quick Start

Motion and Freefall Detection Using the MMA8451, 2, 3Q

ColdFire Security SEC and Hardware Encryption Acceleration Overview

Developing an Application for the i.mx Devices on the Linux Platform

2N5460, 2N5461, 2N5462. JFET Amplifier. P Channel Depletion. Pb Free Packages are Available* Features. MAXIMUM RATINGS

How to Do EEPROM Emulation Using Double Flash Array on MC9S08LC60 Ronald Gonzalez and Tatiana Orofino RTAC Americas

Efficient Low-Level Software Development for the i.mx Platform

Frequency Analysis in the Industrial Market Using Accelerometer Sensors

How To Use A Watt Saver On A Microcontroller (Watt Saver) On A Cell Phone Or Mp3 Player

SN54/74LS682 SN54/74LS684 8-BIT MAGNITUDE COMPARATORS SN54/74LS688 8-BIT MAGNITUDE COMPARATORS FAST AND LS TTL DATA 5-603

LC898300XA. Functions Automatic adjustment to the individual resonance frequency Automatic brake function Initial drive frequency adjustment function

MC14008B. 4-Bit Full Adder

Transcription:

DRM for Driver Information System on S12G128 Reference Design Document Number: DRM134 Rev. 0, 04/2012

2 Freescale Semiconductor, Inc.

Contents Section Number Title Page Chapter 1 Introduction 1.1 Introduction...5 1.2 Key Features of DIS Voice Module...5 1.2.1 Future Enhancement...6 Chapter 2 Application Block Diagram 2.1 Application Block Diagram...7 2.1.1 Main Blocks...7 2.1.2 Functionality...8 2.2 Module Explanation...9 2.2.1 MCU MC9S12G...9 2.2.2 MSDI MC33972...10 2.2.3 Audio Amplifier - TDA7350A...10 2.2.4 Relay Switches...10 2.2.5 Intelligent Power Control...11 2.3 Hardware Board...12 Chapter 3 Software 3.1 Audio Generation Technique...13 3.2 Software Design...13 3.2.1 Design Flow...13 3.2.2 Function Description...14 3.2.2.1 Configure_Output_Compare...15 3.2.2.2 SPI_Init...15 3.2.2.3 MC33972_Config...15 3.2.2.4 SwitchRelay...15 3.2.2.5 Check_MSDI_Inputs...16 Freescale Semiconductor, Inc. 3

Section Number Title Page 3.2.2.6 Decode_Message...16 3.2.2.7 Timer_ISR...16 4 Freescale Semiconductor, Inc.

Chapter 1 Introduction 1.1 Introduction New technologies in four wheelers that make them faster and safer have made their interaction with the driver important. Driver Information System (DIS) includes the instrument cluster located in front of the driver on dashboard which displays various information like speed of vehicle, distance travelled, fuel level, ambient temperature and others. Instrument cluster is gaining in sophistication with every passing day. Apart from the standard analog gauges (like odometer or speedometer), graphics LCD (or TFT) displays for infotainment, LED warning lights, audio warning messages, lane departure sensor, distance alert sensor and others provide the real time crucial information to the driver. The DIS described in this application is a module integrated with the car stereo system that generates audio messages when warnings like door is open, seatbelt is unlocked, initiates if the car ignition is ON. When car ignition is turned OFF, the DIS module turns ON the headlights for 45 sec. to assist the driver to walk on the pathway after he parks the vehicle. This 45 sec. time is programmable. This document describes the hardware design and the software implementation for the DIS application. 1.2 Key Features of DIS Voice Module The key features of DIS voice module are listed below: Messages comprise of 8-bit audio samples of sampling frequency 11 khz. A switch is provided to disable the currently playing warning message until the next ignition. Freescale Semiconductor, Inc. 5

Key Features of DIS Voice Module Messages are played on priority basis i.e. if multiple warning signals occur at the same time then the message with highest priority is played. Headlights will be turned ON for 45 sec. after the ignition is turned OFF. 1.2.1 Future Enhancement User can customize voice messages by deleting or loading audio samples on the flash memory using SPI. 6 Freescale Semiconductor, Inc.

Chapter 2 Application Block Diagram 2.1 Application Block Diagram Figure 2-1. Block Diagram of complete DIS This block diagram explains the integration of DIS module with the car stereo system. The DIS is incorporated between stereo and driver side speaker. 2.1.1 Main Blocks The main blocks of Fig 2-1 are as follows: DIS Module It generates the voice messages based on the input warning signals. Freescale Semiconductor, Inc. 7

Application Block Diagram Stereo It is the car s in-built stereo system. All digital warning inputs On the basis of these input signals, DIS module selects the voice message that needs to be played. Headlamp It refers to headlights of the car. Driver side speaker These are the speakers present in the casing of the dashboard. 2.1.2 Functionality As soon as ignition is switched ON, DIS module is powered up and user specific welcome message is played. With any of following conditions, user specific warning message is played: Front right door is open Front left door is open Rear right door is open Rear left door is open Hood is open Seatbelt not fastened Cabin light is ON Door is unlocked These warning messages are played until an action is taken for the corresponding warning. The message is played through same speaker (driver side) as used with stereo system. Hence, during message output, stereo is switched OFF and speaker inputs are switched from stereo to DIS module. If the Disable Warning switch is pressed, while a message is being played then that message will not be played until next ignition. When ignition is turned OFF, headlamp is turned ON for 45 sec. The DIS module consists of the following sub-modules: MCU MC9S12G - It is the heart of the system and is responsible for complete functionality of DIS module. Multiple Switch Detection Interface (MSDI) - It is used to detect the occurrence of warning signals and to communicate this occurrence to MCU using SPI bus. Relay Control It is used to switch ON/OFF headlamp & stereo and to switch the speaker input between stereo and DIS module. Serial Flash It is SPI based serial flash memory which will be used for future voice message extension. Intelligent Power Control Module It controls the power supply to MCU and keeps the MCU ON after the ignition is turned OFF. 8 Freescale Semiconductor, Inc.

Chapter 2 Application Block Diagram Figure 2-2. Internal Block Diagram of DIS Module 2.2 Module Explanation 2.2.1 MCU MC9S12G In DIS module, 48-Pin LQFP (Low-profile Quad Flat Package) of MC9S12G128 microcontroller is used which has 128KB of flash and 8KB of RAM. MC9S12G family is pin compliant from low end (MC9S12G16) to high end (MC9S12G240), so we can use any S12G 48-pin MCU as per the number of messages. The MC9S12G family is an optimized, automotive, 16-bit microcontroller product line focused on low-cost, high-performance, low power consumption, low pin-count and code-size efficiency. The following modules of MCU are used in this application: Serial Peripheral Interface (SPI) used for communication with MSDI switch Timer Module used for generating periodic interrupts Freescale Semiconductor, Inc. 9

Module Explanation Pulse Width Modulator (PWM) used for generating audio waves I/O Ports used for various input & output signals like ignition, Disable Warning switch and others. 2.2.2 MSDI MC33972 MC33972 MSDI is designed to detect the closing and opening of up to 22 switch contacts. The switch status, either open or closed, is transferred to the MCU through a SPI. The MC33972 device has two modes of operation, Normal and Sleep. In this application, we are using Normal mode which allows programming of the device and configuration of switch contacts as pull-up or pull-down. Advantages of using a MSDI: Component Optimization: MSDI replaces discrete components such as transistors, resistors and diodes in the existing circuit. Integrated system also increases reliability of the entire system. PCB space Optimization: Since the above mentioned discrete components are replaced by a single 32-pin SOIC package, the PCB space requirement is drastically reduced. Reduction in MCU I/O pin count: MSDI connects to MCU through SPI whereas discrete switches connect to MCU pins as GPIO or KBI. Hence requirement of MCU pins is greatly reduced. Improved yield in production line:reduction in number of components leads to reduction in the number of solder joints, the time required for assembling the PCBs and also the time required for visual inspection. 2.2.3 Audio Amplifier - TDA7350A The TDA7350A is a class AB audio power amplifier used for audio amplification and noise reduction in our design. 2.2.4 Relay Switches Two types of relay switches are used in DIS application: Omron G5V-2 DPDT relay:used to switch the speaker inputs from stereo signals to voice message signals (from DIS) and vice-versa. NEC EX2 DPDT relay:used to switch ON/OFF the stereo signal and switch ON/OFF the headlamp signal. 10 Freescale Semiconductor, Inc.

. Chapter 2 Application Block Diagram 2.2.5 Intelligent Power Control Figure 2-3. Block Diagram of Intelligent Power Control module It is a feature of the DIS that headlamp is kept ON after ignition is turned OFF. For this purpose, the power control module on DIS is made in such a way that it can keep the board powered up using battery voltage even after ignition is switched OFF. The module consists of two blocks: Signal Control Unit: transistor circuit that enables or disables the voltage regulator Voltage Regulator (L4979): converts the unregulated 12V input (from battery) to regulated 5V output When the ignition is switched ON, the signal control unit sends POWER_EN signal (generated from IGN_IN signal) to the voltage regulator. This enables the regulator and generates regulated Vcc from VBATT_IN. MCU gets powered up and it sends Watchdog Input in form of square wave to the regulator that prevents it from resetting. The MCU also sends active high POWER_EN_uC signal to the signal control unit, which causes POWER_EN to come from VBATT_IN signal. Till the time POWER_EN_uC line is high, VBATT_IN keeps the regulator enabled. Hence, when the ignition is turned OFF, Freescale Semiconductor, Inc. 11

Hardware Board the voltage regulator remains enabled and thus MCU remains powered up. The MCU now switches ON the headlamp relay for 45 sec. After that, the MCU will make POWER_EN_uC signal low that disables POWER_EN signal and in turn the voltage regulator gets switched OFF and hence power to MCU as well as board goes OFF. The board will perform the same cycle on next ignition. 2.3 Hardware Board Figure 2-4. Components mounted DIS hardware board 12 Freescale Semiconductor, Inc.

Chapter 3 Software 3.1 Audio Generation Technique In this application, audio generation is done by PWM signals, generated using PWM module (IP S12PWM8B8CV2) of the MCU. The basic principle involves using sampled data to vary the duty cycle of a PWM signal. The duty cycle values are updated at intervals specified by a timer. The signal produced by the PWM module is then fed to a low-pass filter, which effectively integrates the pulsed data and produces a signal that is decipherable by the human ear. The voice messages are.wav files which are converted into ASCII format and stored in flash memory in the form of arrays. The array elements serve as the duty cycle values of the PWM signal. When the MSDI communicates the warning signal to the MCU, the corresponding array is selected for generating PWM signal. The timer module is configured in output compare mode with the compare value as 1/f (f is the sampling frequency of the.wav file). At every output compare interrupt, the duty cycle register of PWM is updated with array elements of corresponding.wav file. 3.2 Software Design 3.2.1 Design Flow 1. When the MCU is powered up, pulsed output is given from the MCU to the Watchdog Input pin of voltage regulator to prevent it from resetting. 2. The welcome message is played. 3. The status of switches on MSDI is checked using SPI Bus. 4. If any switch is closed, then the relays are switched ON to stop stereo and change the speaker inputs from stereo to voice module. 5. The message is played accordingly and till the time the corresponding switch on MSDI is closed, the message is played with an interval of 5 seconds. Freescale Semiconductor, Inc. 13

Software Design 6. If the Disable Warning switch is pressed then the current message is stopped and its input signal is masked from the switch on MSDI until the next ignition. 7. If multiple switches on MSDI are closed at the same time, then the message will be played with input having highest priority. Figure 3-1. Software Flow Diagram 8. If no switch on MSDI is closed, then relays are switched OFF to move speaker inputs from voice module to stereo and switch ON the stereo. 9. Till the time ignition is ON, steps 2 to 7 are repeated continuously. 10. If ignition is turned OFF then headlamp is switched ON by switching its relay ON and the regulator enable bit is kept high for 45 seconds. If the ignition is turned ON during this time then step 2 onwards are performed. 11. Then, headlamp relay is switched OFF and enable pin of regulator is made low to switch OFF the voltage regulator output. 14 Freescale Semiconductor, Inc.

3.2.2 Function Description Chapter 3 Software 3.2.2.1 Configure_Output_Compare This function is used to configure the timer channel in Output Compare mode. Syntax void Configure_Output_Compare (void) Arguments Return Type 3.2.2.2 SPI_Init This function initializes the specified SPI by writing the internal registers which configure the data transfer width, Clock frequency of SPI, mode of operation of MCU and Chip Select pin of the SPI. Syntax void SPI_Init (void) Arguments Return Type 3.2.2.3 MC33972_Config This function is used to configure the MSDI - MC33972. As the supply for MC33972 is provided using Ignition signal, hence this function is called every time the ignition is turned ON. This configuration is done by sending SPI commands from the MCU to the MSDI Switch. Syntax void MC33972_Config (void) Arguments Return Type 3.2.2.4 SwitchRelay This function is used to switch ON/OFF the relays for stereo, headlamp and speaker input selection. Syntax void SwitchRelay (int device, int state) Arguments device: It is an int type variable which is used to specify the device whose state needs to be changed by switching of relay. state: It is an int type variable which is used to specify the state ON/OFF in which the Freescale Semiconductor, Inc. 15

Software Design device needs to be switched to. Return Type 3.2.2.5 Check_MSDI_Inputs This function is used to check the input switch nodes on MSDI. If any switch is closed, then the corresponding message is selected for playing. The selection is done on the basis of priorities i.e. if multiple switches on MSDI are closed at the same time, then the message corresponding to highest priority input is selected for playing. Syntax void Check_MSDI_Inputs (void) Arguments Return Type 3.2.2.6 Decode_Message This function decodes which switch on MSDI is closed. This occurs when a warning message needs to be played on the DIS. In case, the Disable Warning switch is pressed while a switch on MSDI is closed, then that warning message is not played till next ignition is received. Syntax UINT32 Decode_Message (void) Arguments Return Type The return type is unsigned long int (UINT32). It tells which switch input on MSDI has a valid input at the time of pressing the reset switch. 3.2.2.7 Timer_ISR This Interrupt Service Routine (ISR) is executed when there is match of timer counter with timer channel 7 output compare value. The frequency of this match is the sampling frequency of the audio samples (in this application, it is 11 khz). When a message is played, PWM duty cycle values are assigned in this ISR function. The Watchdog Input pin is also toggled in this ISR. Syntax void interrupt < interrupt vector number> Timer_ISR (void) Arguments Return Type 16 Freescale Semiconductor, Inc.

How to Reach Us: Home Page: www.freescale.com Web Support: http://www.freescale.com/support USA/Europe or Locations Not Listed: Freescale Semiconductor Technical Information Center, EL516 2100 East Elliot Road Tempe, Arizona 85284 +1-800-521-6274 or +1-480-768-2130 www.freescale.com/support Europe, Middle East, and Africa: Freescale Halbleiter Deutschland GmbH Technical Information Center Schatzbogen 7 81829 Muenchen, Germany +44 1296 380 456 (English) +46 8 52200080 (English) +49 89 92103 559 (German) +33 1 69 35 48 48 (French) www.freescale.com/support Japan: Freescale Semiconductor Japan Ltd. Headquarters ARCO Tower 15F 1-8-1, Shimo-Meguro, Meguro-ku, Tokyo 153-0064 Japan 0120 191014 or +81 3 5437 9125 support.japan@freescale.com Asia/Pacific: Freescale Semiconductor China Ltd. Exchange Building 23F No. 118 Jianguo Road Chaoyang District Beijing 100022 China +86 10 5879 8000 support.asia@freescale.com Information in this document is provided solely to enable system and software implementers to use Freescale Semiconductors products. There are no express or implied copyright licenses granted hereunder to design or fabricate any integrated circuits or integrated circuits based on the information in this document. Freescale Semiconductor reserves the right to make changes without further notice to any products herein. Freescale Semiconductor makes no warranty, representation, or guarantee regarding the suitability of its products for any particular purpose, nor does Freescale Semiconductor assume any liability arising out of the application or use of any product or circuit, and specifically disclaims any liability, including without limitation consequential or incidental damages. "Typical" parameters that may be provided in Freescale Semiconductor data sheets and/or specifications can and do vary in different applications and actual performance may vary over time. All operating parameters, including "Typicals", must be validated for each customer application by customer's technical experts. Freescale Semiconductor does not convey any license under its patent rights nor the rights of others. Freescale Semiconductor products are not designed, intended, or authorized for use as components in systems intended for surgical implant into the body, or other applications intended to support or sustain life, or for any other application in which failure of the Freescale Semiconductor product could create a situation where personal injury or death may occur. Should Buyer purchase or use Freescale Semiconductor products for any such unintended or unauthorized application, Buyer shall indemnify Freescale Semiconductor and its officers, employees, subsidiaries, affiliates, and distributors harmless against all claims, costs, damages, and expenses, and reasonable attorney fees arising out of, directly or indirectly, any claim of personal injury or death associated with such unintended or unauthorized use, even if such claims alleges that Freescale Semiconductor was negligent regarding the design or manufacture of the part. RoHS-compliant and/or Pb-free versions of Freescale products have the functionality and electrical characteristics as their non-rohs-complaint and/or non-pb-free counterparts. For further information, see http://www.freescale.com or contact your Freescale sales representative. For information on Freescale's Environmental Products program, go to http://www.freescale.com/epp. Freescale and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. 2012 Freescale Semiconductor, Inc. Document Number: DRM134 Rev. 0, 04/2012