P MA 7 1 x x/ P M A51 x x SmartLEWISTM MCU RF Transmitter FSK/ASK 315/434/868/915 MHz Embedded 8051 Microcontroller with Function Library in ROM Applic atio n Whi tep a per May 2009 Wirel ess Con trol Edition May 2009 Published by Infineon Technologies AG 81726 Munich, Germany © 2009 Infineon Technologies AG All Rights Reserved. Legal Disclaimer The information given in this document shall in no event be regarded as a guarantee of conditions or characteristics. With respect to any examples or hints given herein, any typical values stated herein and/or any information regarding the application of the device, Infineon Technologies hereby disclaims any and all warranties and liabilities of any kind, including without limitation, warranties of non-infringement of intellectual property rights of any third party. Information For further information on technology, delivery terms and conditions and prices, please contact the nearest Infineon Technologies Office (www.infineon.com). Warnings Due to technical requirements, components may contain dangerous substances. For information on the types in question, please contact the nearest Infineon Technologies Office. Infineon Technologies components may be used in life-support devices or systems only with the express written approval of Infineon Technologies, if a failure of such components can reasonably be expected to cause the failure of that life-support device or system or to affect the safety or effectiveness of that device or system. Life support devices or systems are intended to be implanted in the human body or to support and/or maintain and sustain and/or protect human life. If they fail, it is reasonable to assume that the health of the user or other persons may be endangered. PMA71xx/ PMA51xx SmartLEWIS MCU Table of Contents Abstract 4 1 Introduction ........................................................................................................................................4 2 PMA as a Wireless Remote Control .................................................................................................5 3 PMA as a Contactless Sensor...........................................................................................................5 4 Periphal Block LF Receiver...............................................................................................................6 5 SW Function Library and Framework ..............................................................................................6 6 PMA Development Tools ...................................................................................................................7 7 Product Family, Fundamental Data and Chip Housing ..................................................................8 8 Summary .............................................................................................................................................9 Application Whitepaper 3 May 2009 PMA71xx/ PMA51xx SmartLEWIS MCU Abstract TM SmartLEWIS MCU – The flexible single-chip solution for wireless remote controls and wireless sensing. Wireless data transmission in the license-free ISM frequency bands below 1 GHz is very popular thanks to its low power consumption, low costs and comparably simple implementation. The strong rise in its deployment in established applications, such as in remote controls where it is used as a substitute for infrared technology, is now being flanked by many new applications where it is enabling new levels of ergonomics and new functionality. By Martin Gotschlich, Infineon Technologies AG 1 Introduction As the first product in the new SmartLEWIS™ MCU family, the PMA 7110 is predestined for easy implementation of a multitude of attractive wireless transmission applications. The highly integrated circuit monolithically combines an 8051 microcontroller, an RF transmitter and other interesting peripheral blocks on a single semiconductor chip. In particular, the analog-to-digital converter for connection of analog sensors and a 125-kHz LF receiver are noteworthy. The analog-to-digital converter is characterized by an additional configuration area for amplification of the three symmetrical inputs. The LF receiver is suitable for contactless triggering of transmission processes and for contactless configuration (e.g., personalization or charging with credit). An extensive library of SW functions is integrated into the ROM by default, thereby saving valuable flash memory. Typical applications can be implemented with comparatively little programming effort. 125 kHz LF trigger & data in 16-bit CRC generator / checker RAM 256 B PP9 Flash sector 0 6 kB user code digital IO GPIO I2C SPI ROM function library PP0 Flash sector 1/2 2 x 128 kB data EEPROM emulation PMA 71xx / 51xx 8-bit pseudo random number generator MHz 315 dBm 5 434 8 868 10 915 LF Rx 125 kHz 4 timers 16 bit µC 8051 RF Tx ASK/FSK PLL high sens. 1 high sens. 2 Manchester / bi-phase encoder ADC 10bit std. sens. battery voltage & temperature sensor system controller interrupt & wake-up logic power management brownout detector watchdog RC oscillator 12MHz RC oscillator 2 kHz RF XTAL oscillator 18 … 20 MHz 1.9 … 3.6 V Figure: Block diagram of the PMA 7110 The strengths of the PMA 7110 can be particularly demonstrated in two application segments as follows: conventional remote controls for control of an appliance or a system via an RF wireless link and wireless sensors, in which diverse test variables are autonomously monitored and with which measured values are sent to a receiver in the event of particular states or events. In addition, identification applications (e.g. smart tagging) can also be realized. Application Whitepaper 4 May 2009 PMA71xx/ PMA51xx SmartLEWIS MCU 2 PMA as a Wireless Remote Control Wireless remote controls in the free sub-1-GHz frequency ranges are finding ever greater use in a wide number of applications. These applications can be implemented with the PMA 7110 as a single-chip solution in the simplest way possible, but in which even demanding functions know no boundaries thanks to the extensive integrated peripheral blocks and the free programmability. Remote Keyless Entry (RKE) applications have been standard in the automotive sector for many years. Such applications can be implemented with the automotive-qualified derivative PMA 5110. Two functions in the PMA family play a special role in the security of the application as follows: to generate continuously changing key codes ('rolling codes'), the EEPROM emulation allows continuous storage of information in active operation (for each key action) in a reserved part of the nonvolatile flash memory. The encryption of the transmitted information is realized using the license-free AES algorithm (Advanced Encryption Standard), which is included as a basic feature in the extensive software library in the chip's ROM along with many other functions (further details are given below). Infineon also provides additionally an alternative encryption example code based on the license-free XTEA algorithm (Extended Tiny Encryption Algorithm). A pronounced growth in the number of applications for wireless remote controls can be seen in the consumer sector. The replacement of infrared remote controls in the entertainment and home electronics market has a key role to play in this growth. Apart from the multiroom remote controls (e.g., settop boxes in neighboring rooms), wireless remote controls – also acting as conventional infrared replacements – provide considerable additional ease of use because the remote controls no longer need to be directed toward the receiver. The ten free programmable digital inputs/outputs (General Purpose Input/Output, GPIOs) of the PMA 7110 can be directly linked with up to 30 buttons (and even up to 55 buttons with additional diodes). Eight of the ten lines can also be configured for wakeup signals in which case the remote control after sending the signal immediately switches to standby mode with very low power consumption; the remote control remains inactive until a button is pressed again. Depending on the design of the antenna used, the power consumption can be lower than that of any infrared remote controls operating at the same distance, even during transmission. This means that markedly smaller batteries can be used, which, on the one hand, enables new design possibilities for remote control housings and, on the other hand, that batteries may not need to be changed for the entire lifetime of a product. Oscillator open loop antenna 27mm 3V CR2032 passive antenna matching network Infineon in-circuit PMA5105 programming connector 43mm Figure: PMAfob – A Remote Keyless Entry application example with PMA 5105 3 PMA as a Contactless Sensor Contactless sensors can be very flexibly arranged, thus providing greater ease of use and simpler installation on the one hand, while enabling even unusual measurements to be performed on the other hand – for example, operation on moving objects such as rotating machine parts. The low power consumption of the PMA 7110 is also one of the key design criteria in this case because the battery capacity varies according to the specified target lifetime of the application, which in turn is important for the dimensions, weight and finally for the cost of the whole sensor module. Application Whitepaper 5 May 2009 PMA71xx/ PMA51xx SmartLEWIS MCU While sensors with a digital interface (e.g. SPI) can be easily connected to the GPIOs of the PMA 7110, the chip also allows a wide variety of inexpensive analog sensors to be operated in the total of three channels of the analog-to-digital converter (ADC). The flexible configuration of the symmetric inputs also enables high levels of input amplification so that additional preamplifiers can be dispensed with in many cases. A number of strategies could be employed to minimize the power consumption of the application. For example, a measured value is only to be transmitted over the air interface if particular threshold values are exceeded. Extremely long battery lifetimes can be realized if the contactless sensor is only 'woken up' by wireless activation as required by means of the LF receiver described in greater detail below. Along with the two timers in the 8051 microcontroller core, there are two further timers that can be used for complex timing scenarios. 4 Periphal Block LF Receiver The LF receiver is suitable for receiving amplitude-modulated 125-kHz signals that are magnetically induced in a receiver coil. Since the receiver is only activated by means of the induced energy, it consumes practically no power in standby mode. In the most straightforward case, the LF receiver can be used for contactless triggering of a transmission procedure. To do so, the user employs a 125-kHz transmission signal, a so-called trigger, activated in the vicinity of the RF transmitter. The RF transmitter responds with measured sensor data or an identification code. In a similar manner, data can also be sent to the RF transmitter using 125-kHz amplitude modulation. This function could be used, for example, for contactless calibration of a sensor transmission unit or for one-time storage of identification codes in the RF transmission device – for example, for customer data at the point of sale of the device. 5 SW Function Library and Framework Programming of the 8051-compatible microcontroller (regarded as standard in the industry) in C and Assembler is itself uncomplicated. Nonetheless, the SW function library stored in ROM in the PMA family allows very efficient access to all on-chip peripheral functions without a programmer having to know in detail the bits and bytes of the chip's system architecture. This means that the programmer can very quickly produce complex applications in relatively few, but very powerful, function calls. The following example of a C main routine shows how easily an RF (radio frequency) thermometer can be programmed. The SW library functions are indicated in bold typeface. void main(void) { // determine if reset or wake up if (!(DSR & BIT_WAKEUP)) { // after reset Switch2XTAL(); CalibrateIntervalTimer(1); ITPR = 5; // Change clock to external crystal // Interval frequency 1Hz // Set to 5sec } else { // Wakeup detected, determine which one if (WUF & BIT_WU_TIMER) { InitRF(&myRF_Config); Switch2XTAL(); // Change clock external crystal VCOTuningLong(); // Selects an appropriate tuning curve for // the VCO and enables the PLL RFC |= 0x01; // Enable PA MeasureTemperature(&value); // Measure internal temperature sensor datagram[TX_TEMPPOS] =value[0] >> 8; // Prepare datagram datagram[TX_TEMPPOS+1]=value[0] & 0xFF; Application Whitepaper 6 May 2009 PMA71xx/ PMA51xx SmartLEWIS MCU datagram[TX_TEMPPOS_R] =value[1] >> 8; datagram[TX_TEMPPOS_R+1]=value[1] & 0xFF; TransmitRF(datagram,TX_LEN); // Transmit datagram via RF link } } PowerDown(); // Power down } Figure: Example of code for an RF thermometer Another key advantage of this concept is that the size of the application-specific code can be kept very small since most of the code is already present in the preprogrammed function library in ROM. Subsequently, the 6KB flash memory allows considerably more extensive applications to be implemented than in comparable µC architectures in which the entire program code has to be stored in valuable flash memory. Another benefit deriving from this architecture is the significant reduction in flash programming times, enabling further cost efficiencies in the customer's production process. 6 PMA Development Tools Infineon provides extensive and powerful development tools for all products of the PMA 71xx and 51xx families, whereby the tooling is universal and independent of the used product variant The PMA Starter Kit, available for € 49, is especially interesting. The kit contains everything you need for initial evaluation and creation of uncomplicated applications. Its main component is a USB stick that supports all the major functions of the PMA 5110 chip, and also features a rechargeable lithium-ion battery to enable mobile operation of a newly created application. Figure: PMA Starter Kit with PMA RF USB Stick This development tool is very easy to use and only a few steps are needed for operation: • • • • • • Install the SW development tools from KEIL (license-free trial version available for download). Install the latest PMA Starter Kit software package Insert the PMA RF USB stick into a free USB port on the PC. Enter a few lines of C code in the prepared application framework. The powerful functions in the ROM SW library allow extremely lean source code in which the bits and bytes of the HW architecture do not have to be considered in detail. Compile the C source code and then load it into the flash memory of the PMA 7110 via the USB interface. Remove the USB stick from the PC and start the new application, which is powered by the rechargeable lithium-ion battery. Application Whitepaper 7 May 2009 PMA71xx/ PMA51xx SmartLEWIS MCU Secondary, Infineon offers the PMA Evaluation Kit. This enhanced development tool provides highest flexibility by giving easy access to all pins for detailed measurements and by supporting the ADC and LF receiver functionality. For further information on PMA tooling please visit www.infineon.com/pma_tooling 7 Product Family, Fundamental Data and Chip Housing LF receiver (125kHz) Operating temperature range PMA 7106 3-channel, 10-bit ADC PMA 7105 ASK/FSK UHF Transmitter Type 8051 µC + Flash The PMA derivatives from the 71xx series are intended for use in industrial and consumer applications and are designed for an operating temperature range from -40°C to +85°C. The 51xx series is Q100 automotivequalified and can be used in an operating temperature range from -40°C to +125°C. PMA supports the 315, 434, 868 and 915 MHz frequency bands and three different output power levels of 5, 8 and 10 dBm. All derivatives in the PMA product family are pin-compatible in a standard PG-TSSOP-38 package. Most of the printed circuit board layout can be left unchanged for product derivatives and country variants with different frequencies can be realized as mounting options of external components. The functional differences in the PMA product family refer to the availability of LF receiver and analog-to-digital converter, as shown in the table below: Target Applications ! ! ! ! ! - -40°C to +85°C - Remote Controls - Wireless sensors with digital sensor interface -40°C to +85°C - Wireless sensors with analog sensor interface PMA 7107 ! ! - ! -40°C to +85°C - Active Tagging / Door opener - Remote Control with contact-less configuration - Wireless sensors with contact-less trigger and configuration PMA 7110 ! ! ! ! -40°C to +85°C - Sophisticated wireless sensors with contact-less trigger and configuration PMA 5105 ! ! - - -40°C to +125°C - Applications in rough environment and with high quality requirements (extended temp. range and automotive qualification) - Remote Keyless Entry PMA 5110 ! ! ! ! -40°C to +125°C - High end applications in rough environment and with high quality requirements (extended temp. Range and automotive qualification) - Remote Keyless Entry Table: SmartLEWIS MCU family overview Figure: PG-TSSOP-38 package Application Whitepaper 8 May 2009 PMA71xx/ PMA51xx SmartLEWIS MCU 8 Summary Owing to the high level of integration, the PMA 71xx/51xx products in the SmartLEWIS™ MCU family enable a multitude of demanding high-frequency transmission applications on a single-chip basis in the area of wireless remote controls and wireless sensing. The extensive SW function library significantly accelerates development times and optimizes application quality. For further information, please visit www.infineon.com/PMA Application Whitepaper 9 May 2009 w w w . i n f i n e o n . c o m Published by Infineon Technologies AG B142-H9393-X-X-7600