434 MHz Wireless Triple Axis Accelerometer Reference Design (ESTAR) Designer Reference Manual ESTARRM Rev. 0 02/2007 freescale.com 434 MHz Wireless Triple Axis Accelerometer Reference Design Designer Reference Manual by: Petr Gargulák and Pavel Lajšner Freescale Czech Systems Laboratories Rožnov pod Radhoštěm, Czech Republic To provide the most up-to-date information, the revision of our documents on the World Wide Web will be the most current. Your printed copy may be an earlier revision. To verify you have the latest information available, refer to: http://www.freescale.com The following revision history table summarizes changes contained in this document. For your convenience, the page number designators have been linked to the appropriate location. Revision History Date Revision Level February 2007 0.00 Description First draft Page Number(s) N/A 434 MHz Wireless Triple Axis Accelerometer Reference Design, Rev. 0 Freescale Semiconductor 3 434 MHz Wireless Triple Axis Accelerometer Reference Design, Rev. 0 4 Freescale Semiconductor Table of Contents Chapter 1 Introduction 1-1 1-2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 MMA7260QT 3-Axes Accelerometer Sensor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 Chapter 2 434 MHz Wireless Triple Axis Accelerometer Reference Design Introduction 2.1 2.2 2.3 2.3.1 2.3.2 2.3.3 2.3.4 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 ESTAR Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 Featured Products . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 Triple Axis Accelerometer MMA7260QT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 Microcontroller MC9S08QG8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 MC33696 ISM Bands Low Power Transceiver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 Microcontroller MCHC908JW32 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 Chapter 3 Sensor Board Description 3.1 3.2 3.2.1 3.2.2 3.3 3.3.1 3.3.2 3.3.3 3.3.4 3.4 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.6 3.4.7 3.4.8 3.4.9 3.4.10 3.4.11 3.5 3.6 3.7 Board Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A/D Conversion of XYZ Levels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ADC Module Init: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ADC Measurement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Power Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Broadcast Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Normal Run Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Deep Sleep Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . MC33696 Power Management Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ESTAR Sensor Board Hardware Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Analog Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . g-select Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . g-sleep Connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . BDM (Background Debug Mode) Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Button Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . MC33696 to MC9S08QG8 Microcontroller Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . MC33696 RF Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Clocking Options of MC9S08QG8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . LED Indicator Connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Power Supply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Sensor Board Schematic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Bill of Materials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Sensor Board Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Memory Usage in MC9S08QG8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 17 18 18 19 20 21 21 22 22 22 22 22 22 23 23 24 25 25 25 26 27 28 28 434 MHz Wireless Triple Axis Accelerometer Reference Design , Rev. 0 Freescale Semiconductor 5 Chapter 4 USB Stick Board Description 4.1 4.2 4.2.1 4.2.2 4.2.3 4.2.4 4.2.5 4.2.6 4.2.7 4.2.8 4.2.9 4.3 4.4 4.5 USB Stick Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ESTAR USB Stick Board Hardware Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . USB Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Power Supply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . MC33696 to MCHC908JW32 Microcontroller Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . Oscillator and Clocking Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . LED Indicators Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Button Connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . MON08 Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Optional Serial Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . USB Stick Schematics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Bill of Materials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . USB Stick Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Memory Usage in MCHC908JW32 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 31 31 31 32 32 32 33 33 33 34 35 36 36 Chapter 5 Software Design 5.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2 ECHO Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2.1 Echo Driver Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.3 ESTAR RF Protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.3.1 Packet Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.3.1.1 ID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.3.1.2 Header . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.3.1.3 Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.3.1.4 RX Strength . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.3.1.5 Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.3.2 ESTAR Protocol Commands Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.3.2.1 CMD_TEST . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.3.2.2 CMD_TRIAX_DATA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.3.2.3 CMD_ACK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.3.2.4 CMD_CALIB_R . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.3.2.5 CMD_CALIB_W . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.3.2.6 CMD_CALIB_ACK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.3.3 ESTAR RF Protocol Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.3.3.1 USB Stick RF State Machine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.3.3.2 Sensor Board RF State Machine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.3.3.3 RF Communication Overview, Establish Connection Time Flow . . . . . . . . . . . . . . . . . . 5.4 STAR Protocol and ESTAR Extensions (over USB) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.4.1 Communication Handshake ‘R’ (0x52) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.4.1.1 Extended Communication Handshake ‘r’ (0x72) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.4.2 Accelerometer Data Transfer ‘V’ (0x56) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.4.2.1 Extended Accelerometer Data Transfer ‘v’ (0x76) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.4.3 Calibration Data ‘K’ (0x4B) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.4.4 Calibration Process ‘k’ (0x6B) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 37 37 38 38 39 39 39 39 40 40 40 40 40 41 41 41 41 41 42 42 44 44 44 45 45 46 46 434 MHz Wireless Triple Axis Accelerometer Reference Design , Rev. 0 6 Freescale Semiconductor 5.4.4.1 Remaining STAR Demo Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.4.5 Additional ESTAR Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.4.5.1 g-Select Reading ‘G’ (0x47) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.4.5.2 g-Select Setting ‘g’ (0x67) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.4.5.3 Info ‘I’ (0x49) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.4.5.4 ESTAR Help ‘H’(0x48), ‘h’(0x68) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.4.5.5 Signal Strength (user friendly) ’s’(0x73) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.4.5.6 Signal Strength (binary) ‘S’(0x53) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.4.5.7 Read MC33696 Registers on USB Dongle ‘A’(0x41), ‘a’(0x61) . . . . . . . . . . . . . . . . . . . 5.4.5.8 Temperature and Battery ‘T’(0x54), ‘t’(0x74) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.4.5.9 Working Mode ‘M’(0x4D), ‘m’(0x6D) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.4.5.10 Show Calibration Data ‘q’(0x71) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.4.5.11 Read g-Select ‘N’(0x4E),’n’(0x6E) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.4.5.12 Debug On ‘U’ (0x55) and Debug Off ‘u’ (0x75) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.4.6 Further Debug and Test Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.4.6.1 Semi-Automatic Self-Calibration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.5 Bootloader . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.5.1 Bootloading Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.5.2 Dualboot Guidelines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.5.2.1 Dualboot Applications Switching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 47 47 47 47 48 48 48 49 49 49 50 50 50 51 51 51 52 54 55 Chapter 6 Application Setup 6.1 6.1.1 6.1.2 ESTAR Installation Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 USB stick Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 AN2295 Bootloader Drivers Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 Appendix A References 434 MHz Wireless Triple Axis Accelerometer Reference Design , Rev. 0 Freescale Semiconductor 7 434 MHz Wireless Triple Axis Accelerometer Reference Design , Rev. 0 8 Freescale Semiconductor Chapter 1 Introduction 1.1 Introduction This paper describes the design of a 434 MHz Wireless Triple Axis Accelerometer Reference Design (ESTAR), a wireless demonstration of the 3-axes accelerometer MMA7260QT sensors from Freescale. The reference design will enable you to see how Freescale's accelerometers can add additional functionality to applications in various industries. The accelerometer measurements can be grouped into 6 sensing functions - Fall, Tilt, Motion, Positioning, Shock and Vibration - for multifunctional applications. The RD3162MMA7260Q development tool offers robust wireless communication using the easy-to-use 433.92 MHz frequency MC33696 transceiver. 1.2 MMA7260QT 3-Axes Accelerometer Sensor The MMA7260QT low cost capacitive micromachined accelerometer features signal conditioning, a 1-pole low pass filter and temperature compensation, and g-Select, which allows a selection from 4 sensitivities. Zero-g offset full scale span and filter cut-offs are factory set and require no external devices. This device includes a sleep mode making it ideal for handheld battery powered electronics. 434 MHz Wireless Triple Axis Accelerometer Reference Design, Rev. 0 Freescale Semiconductor 9 Introduction 434 MHz Wireless Triple Axis Accelerometer Reference Design, Rev. 0 10 Freescale Semiconductor Chapter 2 434 MHz Wireless Triple Axis Accelerometer Reference Design Introduction 2.1 Introduction The 434 MHz Wireless Triple Axis Accelerometer Reference Design (ESTAR) has been designed as a wireless complement to the previous STAR (Sensing Triple Axis Reference design) RD3112MMA7260Q demo. A 433.92 MHz radio-frequency (RF) link based on the low-cost MC33696 family is used for connection from the sensor to the PC, allowing the visualization of key accelerometer applications Figure 2-1 ESTAR Demo Overview The demo consists of the two boards: • Sensor Board (or remote board) containing the MMA7260QT 3-axes accelerometer, S08 family MC9S08QG8 8-bit microcontroller and the 433.92 MHz RF chip MC33696 for wireless communication. • USB stick, again with the MC33696 RF front-end, and the HC08 family MCHC908JW32 for the USB communication. 434 MHz Wireless Triple Axis Accelerometer Reference Design, Rev. 0 Freescale Semiconductor 11 ESTAR Features MC33696 MC33696 S08QG8 HC908JW32 MMA7260QT Figure 2-2 ESTAR Block Diagram 2.2 ESTAR Features Features of the ESTAR include: • Sensing of acceleration in 3 axes across four ranges (0-1.5 g, 2 g, 4 g and 6 g) • Wireless communication of sensor data through 433.92 MHz • Typical wireless range is 20 m, two walls or one floor • Data rate is 19.2 kb/s, half duplex • USB communication of the receiver part – Virtual serial port class - interface for GUI and terminal – HID class - mouse for windows • 2 push buttons provide: – wake-up function – user functions, mouse buttons for HID class • Current consumption: – in normal run mode: 4.5 - 5.5 mA depending on battery voltage – in sleep mode: less than 4.5 µA • Support low power mode for all parts • Sensor Board powered by a coin-sized CR2032 battery • 8-bit/16-bit working modes 2.3 Featured Products This demo consists of several Freescale products whose main features are listed below. 2.3.1 Triple Axis Accelerometer MMA7260QT The ESTAR board is a demonstration tool for the MMA7260QT, a 3-axes low-g accelerometer. The MMA7260QT has many unique features that make it an ideal solution for many consumer applications, 434 MHz Wireless Triple Axis Accelerometer Reference Design, Rev. 0 12 Freescale Semiconductor Featured Products such as freefall protection for laptops and MP3 players, tilt detection for e-compass compensation and mobile phone scrolling, motion detection for handheld games and game controllers, position sensing for g-mice, shock detection for warranty monitors, and vibration for out of balance detection. Features such as low power, low current, and a sleep mode with a quick turn on time, allow the battery life to be extended in end use applications. The 3-axes sensing in a small QFN package requires only a 6 mm x 6 mm board space, with a profile of 1.45 mm, allowing for easy integration into many small handheld electronics. There are several other derivatives of the MMA7260QT, including: • MMA7261QT with a selectable 2.5 g to 10 g range • MMA6270QT is an XY dual axes accelerometer • MMA6280QT is an XZ dual axes accelerometer All members of this sensor family are footprint (QFN package) compatible which simplifies evaluation and design of the target application. 2.3.2 Microcontroller MC9S08QG8 The MC9S08QG8 is a highly integrated member of Freescale’s 8-bit family of microcontrollers based on the high-performance, low-power consumption HCS08 core. Integrating features normally found in larger, more expensive components, the MC9S08QG8 MCU includes a background debugging system and on-chip in-circuit emulation (ICE) with real-time bus capture, providing a single-wire debugging and emulation interface. It also features a programmable 16-bit timer/pulse-width modulation (PWM) module (TPM), that is one of the most flexible and cost-effective of its kind. The compact, tightly integrated MC9S08QG8 delivers a versatile combination from a wealth of Freescale peripherals and the advanced features of the HCS08 core, including extended battery life with a maximum performance down to 1.8 V, industry-leading Flash and innovative development support. The MC9S08QG8 is an excellent solution for power and size-sensitive applications, such as wireless communications and handheld devices, small appliances, Simple Media Access Controller (SMAC)-based applications and toys. MC9S08QG8 Features • Up to 20 MHz operating frequencies at >2.1 volts, and 16 MHz at <2.1 volts • 8 K Flash and 512 bytes RAM • Support for up to 32 interrupt/reset sources • 8-bit modulo timer module with an 8-bit prescaler • Enhanced 8-channel, 10-bit Analog-to-Digital Converter (ADC) • Analog comparator module • Three communication interfaces: SCI, SPI and IIC 2.3.3 MC33696 ISM Bands Low Power Transceiver The MC33696 is a highly integrated transceiver designed for low-voltage applications. It includes a programmable PLL for multi-channel applications, an RSSI circuit, a strobe oscillator that periodically wakes up the receiver while a data manager checks the content of incoming messages. A configuration switching feature allows automatic configuration changes between two programmable settings with no need for an MCU. 434 MHz Wireless Triple Axis Accelerometer Reference Design, Rev. 0 Freescale Semiconductor 13 Featured Products MC33696 Features • 304 MHz, 315 MHz, 426 MHz, 434 MHz, 868 MHz, and 915 MHz ISM bands • OOK and FSK transmission and reception • 20 kbps maximum data rate using Manchester coding • 2.1 V to 3.6 V or 5 V supply voltage • Programmable via SPI • 6-kHz PLL frequency step • Current consumption: – 13.5 mA in TX mode – 9.2 mA in RX mode – Less then 1 mA in RX mode with strobe ratio = 1/10 – 250 nA standby and 25 µA off currents • Configuration switching — allows fast switching of two register banks • Receiver includes: – Sensitivity of -104 dBm – Digital and analog RSSI (Received Signal Strength Indicator) – Automatic walk-up function (strobe oscillator) – Embedded data processor with programmable word recognition – Image cancelling mixer – 380-kHz IF filter bandwidth – Fast walk-up time • Transmitter includes: – 7 dBm output power – Programmable output power – FSK done by PLL programming 2.3.4 Microcontroller MCHC908JW32 The MCHC908JW32 is a member of the low-cost, high-performance M68HC08 Family of 8-bit microcontroller units (MCU’s). All MCU’s in the family use the enhanced M68HC08 central processor unit (CPU08) and are available in a variety of modules, memory sizes and types, and package types. MCHC908JW32 Features • Maximum internal bus frequency: 8 MHz at 3.5 - 5 V operating voltage • Oscillators: – 4-MHz crystal oscillator clock input with a 32-MHz internal phase-lock loop – Internal 88-kHz RC oscillator for timebase wakeup • 32,768 bytes user program FLASH memory with security feature • 1,024 bytes of on-chip RAM • 29 general-purpose Input/Output (I/O) ports: • 8 keyboard interrupt with internal pull-up – 3 pins with direct LED drive – 2 pins with 10 mA current drive for PS/2 connection 434 MHz Wireless Triple Axis Accelerometer Reference Design, Rev. 0 14 Freescale Semiconductor Featured Products • • • • • 16-bit, 2-channel Timer Interface Module (TIM) with selectable input capture, output compare, PWM capability on each channel, and external clock input option Timebase module PS/2 clock generator module Serial Peripheral Interface module (SPI) Universal Serial Bus (USB) 2.0 Full Speed functions: – 12 Mbps data rate – Endpoint 0 with an 8-byte transmit buffer and an 8-byte receive buffer – 64 bytes endpoint buffer to share amongst endpoints 1 - 4 434 MHz Wireless Triple Axis Accelerometer Reference Design, Rev. 0 Freescale Semiconductor 15 Featured Products 434 MHz Wireless Triple Axis Accelerometer Reference Design, Rev. 0 16 Freescale Semiconductor Chapter 3 Sensor Board Description 3.1 Board Overview The Sensor Board provides measurement of the accelerations in 3 axes and transmits the measured values through 433.92 MHz ISM band wireless communication. Also, two on-board push buttons enable the sending of additional application commands. The Sensor Board accommodates: • MMA7260QT - 3 axes accelerometer (4 ranges: 1.5g, 2g, 4g, 6g) • MC9S08QG8 - HCS08 microprocessor • MC33696 - RF low power transceiver for ISM bands The Sensor Board utilizes a small footprint size dual-layer Printed Circuit Board (PCB) containing all the necessary circuitry for MMA7260QT accelerometer sensing and transferring data over a radio frequency (RF). The board is powered by a Lithium coin-sized CR2032 battery. MC33696 B1 and B2 Buttons MMA7260QT LED Q1 Crystal CR2032 Battery Holder and MC9S08QG8 on opposite side 433.92 MHz Loop Antenna Figure 3-1 Sensor Board Overview The block diagram of the board is shown in Figure 3-2. 434 MHz Wireless Triple Axis Accelerometer Reference Design, Rev. 0 Freescale Semiconductor 17 Board Overview SPI MC9S08QG8 MCU SEB CONFB MC33696 433.92 MHz RF X Y Z sleep g-select CR2032 Lithium Battery Matching Circuit Antenna MMA7260Q Accelerometer Figure 3-2 Sensor Board Block Diagram The main task of the Sensor board is to: • periodically wake-up from power saving mode • measure all three XYZ acceleration values from the sensor • compose a data frame using simple ESTAR RF Protocol • use ECHO Driver to send this data frame over the RF link • wait for an acknowledgment from the other end (here, the USB stick) • go to sleep This basic loop repeats roughly 16 times per second providing nearly a real-time response from the sensor. The Sensor Board can be woken up using any push button on the board. Switch off of the Sensor Board is done automatically after dead time from the last push of a button. Figure 3-3 shows in more detail how different software and hardware modules co-operate with each other. 434 MHz Wireless Triple Axis Accelerometer Reference Design, Rev. 0 18 Freescale Semiconductor A/D Conversion of XYZ Levels MC9S08QG8 software calibration data ESTAR RF protocol handler Sensor data ECHO driver Analog-to-Digital converter (ADC) module MMA7260Q sleep g-select GPIO TIM SPI module SEB CONFB MC33696 Figure 3-3 ESTAR Sensor Board Software Overview For the Sensor board operation, several of the MC9S08QG8’s hardware modules are used: • Analog to Digital Converter (ADC) - measurement of accelerometer data, battery voltage and temperature • Synchronous Peripheral Interface (SPI) - communication with the MC33696 (configuration and receive) • Time/Pulse-Width Modulator (TIM) - generation of Manchester code for outgoing messages • General Purpose Input/Output (GPIO) - control of the MC33696, buttons, LED and g-select signals 3.2 A/D Conversion of XYZ Levels The 3-axes accelerometer sensor MMA7260QT provides three separate analog levels for the X, Y and Z axes. These outputs are ratiometric which means that the output offset voltage and sensitivity will scale linearly with applied supply voltage. This is a key feature when interfacing to a microcontroller with A/D converter reference levels tied to a power supply, because it provides system level cancellation of supply induced errors in the analog to digital conversion process. During the analog-to-digital conversion in the microcontroller, 10-bit or 8-bit resolution is used according to active mode of ESTAR. MC9S08QG8 A/D channels 1, 2 and 3 are connected to X (channel 3), Y (channel 2) and Z (channel 1) outputs of the MMA7260QT. The microcontroller’s APCTL1 register enables these ADC channels for pin I/O control by the ADC module. The ADCCFG register controls the selected mode of operation, clock source, clock divide, and configuration for low power or long sample time. 434 MHz Wireless Triple Axis Accelerometer Reference Design, Rev. 0 Freescale Semiconductor 19 A/D Conversion of XYZ Levels 3.2.1 ADC Module Init: APCTL1 Enable analog ADCSC1 ADCSC2 ADCCFG = (APCTL1_ADPC1_MASK | APCTL1_ADPC2_MASK | APCTL1_ADPC3_MASK); inputs */ = 0x1f; /* Initialization ADC */ = 0x00; /* Initialization ADC */ = ADCCFG08; /* Where ADCCFG08 is: #define ADCCFG08 high speed */ #define ADCCFG16 high speed */ 0b01100000 /* set prescale to 8, ADICLK=BUS, 8-bit, 0b01111000 /* set prescale to 8, ADICLK=BUS, 10-bit, Actual ADC measurements are done in the main software loop. There is a macro (called POWSUM) that allows configuration of measurement to take several measurements of each channel during one loop. E.g. changing POWSUM to 3, 2^3 = 8, each channel will be measured 8 times, with POWSUM 6, each channel is measured 64 times. By default, POWSUM is 4, for 16 measurements of each channel. Before result values are provided, the accumulated values are left justified to the 16-bit range and inverted where necessary (may be required depending on the physical MMA7260QT device orientation relative to the Earth gravity). Raw (i.e. not calibrated) values are actually sent, the calibration and calculation of an exact g value is done internally in the PC software. 3.2.2 ADC Measurement The following routine is used for accelerometer measurement: byte i; unsigned int xx,yy,zz,tt,bb; ADCCFG = (estarmode_key == MODE08)? ADCCFG08 : ADCCFG16; xx=yy=zz=tt=bb=0; for (i=0;i< (1 << POWSUM);i++) { ADCSC1 = ADC_AXIS_X; //read X channel while(!ADCSC1_COCO); xx+= ADCR; ADCSC1 = ADC_AXIS_Y; while(!ADCSC1_COCO); yy+= ADCR; //read Y channel ADCSC1 = ADC_AXIS_Z; while(!ADCSC1_COCO); zz+= ADCR; } //read Z channel G_SLEEP = 0; /* Send accelerometr to sleep mode */ if(estarmode_key == MODE16) // switch between 8 and 16 bits mode { // 16 bits mode 434 MHz Wireless Triple Axis Accelerometer Reference Design, Rev. 0 20 Freescale Semiconductor Power Management xx = (xx << (16-(10+POWSUM))); echoTransmitBuffer[7] = (unsigned char) echoTransmitBuffer[8] = (unsigned char) yy = (yy << (16-(10+POWSUM))); echoTransmitBuffer[9] = (unsigned char) echoTransmitBuffer[10] = (unsigned char) zz = (zz << (16-(10+POWSUM))); echoTransmitBuffer[11] = (unsigned char) echoTransmitBuffer[12] = (unsigned char) } else { // 8 bits echoTransmitBuffer[7] = (unsigned char) echoTransmitBuffer[8] = (unsigned char) echoTransmitBuffer[9] = (unsigned char) } ((xx & 0xff00)>>8);// Axis X high (xx & 0x00ff);// data: Axis X low ((yy & 0xff00)>>8);// Axis Y high (yy & 0x00ff);// data: Axis Y low ((zz & 0xff00)>>8);// Axis Z high (zz & 0x00ff);// data: Axis Z low mode (xx >> POWSUM);// data: Axis X (yy >> POWSUM);// data: Axis Y (zz >> POWSUM);// data: Axis Z 3.3 Power Management A CR2032 Lithium battery provides a fairly limited charge for such a realtime-like demo that demands frequent transmissions. Some sort of power management has to be implemented in order to keep the current consumption at a reasonable level. Typically, current consumptions of the Sensor board components are as follows: • 433.92 MHz transceiver MC33696 – in Stand-by mode, 250 nA – in Transmit mode, 13.5 mA – in Receive mode, 9.2 mA • 8-bit microcontroller MC9S08QG8 – in Stop mode, 750 nA – in Wait mode, 1 mA – in Run mode, 3.5 mA • low-g triaxial sensor MMA7260QT – in Sleep mode, 3 µA – in Normal mode, 500 µA It is obvious that in a battery operated application care must be taken to ensure the lowest possible current consumption, especially when the maximum current (provided by the battery) is somehow limited. A CR2032 Lithium battery cannot provide current in the range of 20 mA for long periods of time. To alleviate high current surges, an additional large capacitor has been designed - see Section 3.4.10. For decreasing current consumption the ESTAR Sensor Board works in three different modes: • Broadcast Mode - ESTAR Sensor Board looking for a USB stick • Normal Run Mode - Normal ESTAR Sensor Board work • Deep Sleep Mode - all components on the Sensor Board are sleep/stop/standby mode 434 MHz Wireless Triple Axis Accelerometer Reference Design, Rev. 0 Freescale Semiconductor 21 Power Management Table 3-1 ESTAR Current Consumption ESTAR current consumption Battery voltage [V] 3 2.7 2.4 Broadcast [mA] 7.3 7.3 7.3 Normal run 8-bit [mA] 4.52 4.45 4.3 Normal run 16-bit [mA] 5.22 5.05 4.85 Deep sleep [uA] 4.3 3.7 3 2.1 6.5 3.89 4.34 2.6 ESTAR Current Consumption 8 6 5 4 Current [mA] [ uA] 7 3 2 1 0 3 2.8 Broadcast [mA] 2.6 Battery voltage [V] Normal run 8-bit [mA] 2.4 2.2 Normal run 16-bit [mA] 2 Deep sleep [uA] Figure 3-4 ESTAR Sensor Board Current Consumption 3.3.1 Broadcast Mode When a battery is connected to the Sensor Board, or after each wake-up from Deep Sleep Mode, the ESTAR Sensor Board goes into Broadcast Mode. In this session, the Sensor Board is periodically looking for a USB stick via the 5.3.2.1 CMD_TEST command with a ~60ms delay. When the Sensor Board doesn’t succeed after 30 tests (a time of about 2.1 s), then it moves on to the Deep Sleep Mode again. 434 MHz Wireless Triple Axis Accelerometer Reference Design, Rev. 0 22 Freescale Semiconductor Power Management 3.3.2 Normal Run Mode For transmission and reception operations using the MC33696, a specific scheme has been used to ensure the battery is not depleted or overloaded. Targeting a 16 samples per second (~60 ms period) transmission rate, the following scheme for one transmission/sleep cycle is used for the data transfer: MC9S08QG8: Wait Wait Run Wait Wait/Run Wait MC33696: Standby TX Standby RX Standby MMA7260QT: Sleep Normal Sensor stabilizes wake-up Sensor being measured Sleep time data transmitted optional receive window NOT TO SCALE Figure 3-5 Normal Run Mode Details As shown on the previous diagram, all parts of the Sensor Board remain most of the time in Wait/Sleep/Standby modes, in which the total current consumption is below 500 µA. During each loop, once the data has been acquired from the sensor, transmission over the MC33696 transceiver is initiated. The current consumption of the transmitter is ~17 mA at that time, but only for a short period of time (typically ~7 ms). In order to keep the sensor board informed on the status of connection (for example, if the data-receiving side - USB stick - is out of range, disconnected, etc.), the reception has to be turned on after the data has been transmitted. This is not really required within each loop cycle. In the actual implementation only on every 8th loop is there a check to see if the Sensor Board receives any acknowledgment from the last 8 transmissions. If not, then the software significantly reduces the dead time to Deep Sleep Mode. The dead time is actually set to 2 minutes and starts from each push on a board button. More details can be found in the 5.3 ESTAR RF Protocol description. For the receive window, the MC33696 Strobe oscillator is used. This option mainly reduces the current consumption. 3.3.3 Deep Sleep Mode When the dead counter in Broadcast Mode or Normal Run Mode overflows, the software puts the MC33696 into the standby mode, MMA7260QT to the sleep mode and the MC9S08QG8 into the stop3 mode. Before the MCU is put into stop3 mode, all pins are set as inputs and the pull-ups internal resistors are enabled (except those pins routed to the MC33696, because digital pins on the MC33696 are in logical zero during standby mode). 434 MHz Wireless Triple Axis Accelerometer Reference Design, Rev. 0 Freescale Semiconductor 23 ESTAR Sensor Board Hardware Overview 3.3.4 MC33696 Power Management Features MC33696 provides two power saving modes: • mode1 - can be used in receive mode. When activated, the strobe oscillator periodically wakes up the MC33696 from standby. This is a power efficient and accurately timed way of waking-up the application after a specified time. After wake up, the internal counter can put the chip into standby again after ON time passes. If, during ON time, the chip receives any message preamble with the right ID, it receives the complete message then goes into standby again. This feature is fully utilized within the MC33696. The microcontroller only sets the required registers in the MC33696. • mode 2 - standby is used for switching off the device and mostly for power saving. 3.4 ESTAR Sensor Board Hardware Overview This section describes the Sensor board in terms of the hardware design. The MC9S08QG8 microcontroller drives both the MMA7260QT sensor and the MC33696 RF transceiver. The structure is evident from Figure 3-2, Sensor Board Block Diagram. In the following sections, the details of the H/W structure are described. 3.4.1 Analog Connections The MMA7260QT sensor is directly connected to the AD0, AD1 and AD2 inputs of the analog-to-digital converter. The software filtering, also described in Section 3.2, substitutes for external RC filters. 3.4.2 g-select Connections The G-sel1 and G-sel2 MMA7260QT sensor input pins (used for selection of the acceleration range) are connected to pins PTB0 and PTB7 of the microcontroller. The range can be controlled by software. If the MMA7260QT is in sleep mode then PTB0 and PTB7 (or their alternate SCI functionality of RxD1 and TxD1, or KBI or AD inputs) may be used. These signals are also routed to the BDM connector - pins 3 and 5. Pin PTB0 is also used for LED control. 3.4.3 g-sleep Connection SLEEP is connected to the microcontroller PTA4 pin sharing its alternate RESET function when BDM communication is active. 3.4.4 BDM (Background Debug Mode) Connections A J2 connector is a non-standard footprint primarily intended for in-factory programming and testing via “spring-needle” type of connections. The J2 connector carries all standard signals for Background Debug Mode communication; therefore, if required, one may solder wires and a standard 2x3 pin 2.54 mm (100 mil) pitch header for regular BDM re-programming. The pin numbering is shown in Figure 3-6. 434 MHz Wireless Triple Axis Accelerometer Reference Design, Rev. 0 24 Freescale Semiconductor ESTAR Sensor Board Hardware Overview 1 2 4 6 3 5 Figure 3-6 BDM Connector Layout 3.4.5 Button Connections Two buttons (S1 and S2) are connected directly to pins PTA5 and PTB1. Both have internal pull-up resistors. The first button is connected to IRQ and the second to the Keyboard interrupt module, therefore allowing a direct microcontroller wake-up from the Stop modes. 3.4.6 MC33696 to MC9S08QG8 Microcontroller Interface In order to fit all the necessary circuitry onto a 16-pin microcontroller, the full recommended MC33696 interface has had to be reduced. The full MC33696 interface includes the following connections: • 3-wire Synchronous Peripheral Interface (SPI) connection (MISO, MOSI, SPICLK) • Data - output pin from TIM module • Serial interface enable (SEB) • Configuration mode (CONFB) • Receive Strength Signal Indicator Control input (RSSIC) • RSSI analog output (RSSIOUT) • Data Clock output to microcontroller (DATACLK) • Low Voltage Detect output (LVD) • Strobe oscillator external control input (STROBE) On the ESTAR Sensor Board, the following signals are not used (reason, compensation): • RSSIC - saving pins on the MCU, this signal is connected permanently to VCC, so RSSI is not triggered and the measured value of RSSI is floating. • RSSIOUT - saving pins on the MCU, the RSSI value is read by the digital interface. • DATACLK - saving pins on the MCU, used time is generated from the TIM module in the MCU. • LVD - saving pins on the MCU, this function is not used • STROBE - saving pins on the MCU, the ESTAR Sensor Board permanently uses the strobe oscillator in receive mode. 434 MHz Wireless Triple Axis Accelerometer Reference Design, Rev. 0 Freescale Semiconductor 25 ESTAR Sensor Board Hardware Overview SPI, DATA, SEB and CONFB are vital for the communication and configuration of the MC33696. SPI is connected to the MC9S08QG8 SPI module (pins PTB4/MISO1, PTB3/MOSI1 and PTB2/SPSCK1). DATA is connected to both the microcontroller pins PTA0/TPM1CH0 and PTB4/MISO1. • in transmit mode - pin PTB3/MOSI1 is in high-Z state and pin PTA0/TPM1CH0 generates the transmitted message. • in receive and configuration mode - pin PTA0/TPM1CH0 is in high-Z state and pin PTB3/MOSI1 is used for the SPI module Serial Interface Enable (SEB) allows individual selection in a multiple device system, where all devices are connected via the same bus. When SEB is set high, pins SCLK, MOSI, and MISO are set to high impedance. Configuration Mode (CONFB) signal is used to control configuration mode. On a CONFB falling edge, the on chip SPI is set to slave mode and prepared to receive a command byte via the SPI from the MCU. This pin has the highest priority on chip. RSSI Control Input (RSSIC) signal controls receive strength signal indicator in sample mode. RSSI Analog Output (RSSIOUT) provides an analog value of receive strength signal. Data Clock Output (DATACLK) can be used for the external clock input timer module to simplify generating Manchestr code. Low Voltage Detect Output (LVD) indicates a lower Vdd voltage than the internal reference threshold of 1.8 V. Strobe Oscillator Control Pin (STROBE) can be used as an external control pin for active mode in receive, or to connect an external capacitor for the strobe oscillator. 3.4.7 MC33696 RF Interface The RF interface (antennas) was designed with cost and board size in mind. Therefore, a PCB layout antenna is used. Several PCB antenna designs are available for the 433.92 MHz band (F-antenna, dipole, loop). Because of the space limitation on the PCB a loop antenna has been selected. The MC33696 transceiver is designed with separated RFIN (receive) and RFOUT (transmit) paths. To combine both signal paths, a reference layout from a datasheet is used. On the Sensor Board the “smile”-like antenna layout is used, because of the space restriction on the ring board design. Figure 3-7 ESTAR Sensor Board Antenna Layout The matching is provided by coil L2 and capacitors C17, C18. For the type and size of the components, refer to the BOM 434 MHz Wireless Triple Axis Accelerometer Reference Design, Rev. 0 26 Freescale Semiconductor ESTAR Sensor Board Hardware Overview 3.4.8 Clocking Options of MC9S08QG8 An MC9S08QG8 internal oscillator (ICG) is used as the main clock source for the microcontroller. The protocol related timing is derived from the MCU bus clock. When the microcontroller itself is clocked from an internal oscillator, the oscillator pins can be used as GPIO. This is highly beneficial to the limited pin count microcontroller. 3.4.9 LED Indicator Connection The LED diode signal is shared with g-select1/RXD. The reason is a limited pin count on the microcontroller. 3.4.10 Power Supply The Sensor board is powered by a Lithium coin-sized battery. The choice was the popular CR2032. A surface mounted SMTU series battery holder is placed on the underside of the PCB. The SMTU series holders provide (by mechanical construction) battery reverse protection, so no additional circuitry is required. A large tantalum capacitor (C1, 470 µF/4 V) improves the response of the power supply to current peaks caused by reception or transmission. Coin-sized Lithium CR2032 batteries are targeted at a maximum continuous discharge current in the range of 3 mA. Such a large capacitor helps to supply enough current to the MC33696 during a receive/transmit without significant Vdd voltage drops. 434 MHz Wireless Triple Axis Accelerometer Reference Design, Rev. 0 Freescale Semiconductor 27 3.3pF C18 C16 1nF GND L2 100nH GND 100pF C10 C11 1nF C9 100pF 8 7 6 5 4 3 2 1 GNDPA2 RFOUT GNDPA1 VCC2VCO GNDLNA RFIN VCC2RF RSSIOUT GND C4 6.8pF 1nF Q1 C5 NX3225GA - 24Mhz 1 2 GND C15 1nF MC33696 ECHO+ 100nF GND 100nF C8 R3 470K - 1% VDD GNDDIG RSSIC SPICLK MOSI MISO CONFB 22 21 20 VDD GND 18 17 19 SEB 24 23 TO MCU only input only output GND BDM VDD J2 BDM + BUTTON2/TXD G_SEL1/RxD SLEEP/BDM BUTTON1/RES LED C1 GND BATT1 470uF/4V Battery/Renata CR2032 SOURCE Figure 3-8 Sensor Board Schematic 100nF C6 C7 MISO MOSI SCLK SEB DATACLK GND VDD GND GND C14 100nF CONFB XTALOUT 10 U3 C13 1nF - 5% C12 100pF VDD G_SEL2 CONFB SEB MISO VCCINOUT 11 32 BUTTON1/RES SLEEP/BDM VCC2OUT 12 VDD L1 39nH 1 2 3 4 5 6 7 8 VCCDIG 13 MC33696 + RF MC9S08QG8CDTE C driver ECHO.C / H request signals RSSIC, CONFB, SEB PTA0/KBI0/AD0/TPM1CH0/ACMP1+ PTA5/RESET/IRQ/TCLK PTA1/KBI1/AD1/ACMP1PTA4/BKGD/MS/ACMP1O PTA2/KBI2/AD2/SDA1 Vdd PTA3/KBI3/AD3/SCL1 Vss PTB0/KBI4/AD4/RxD1 PTB7/SCL1/EXTAL PTB1/KBI5/AD5/TxD1 PTB6/SDA1/XTAL PTB2/KBI6/AD6/SPSCK1 PTB5/TPM1CH1/SS1 PTB3/KBI7/AD7/MOSI1 PTB4/MISO1 VCCDIG2 14 Timer chanel output MOSI 16 ADC_X 15 ADC_Y 14 ADC_Z 13 G_SEL1/RxD 12 LED1 BUTTON2/TXD 11 SPICLK 10 MOSI 9 U2 3 15 MCU 4 31 RBGAP GND XTALIN 9 SWITCH 30 VCC2IN 29 GNDSUBD 28 STROBE 27 LVD 26 VCCIN 25 GNDIO GND 16 2 4 6 1 3 5 GND GND D1 LED 470R R1 LED1 C2 10nF VDD C3 10nF SLEEP/BDM G_SEL2 G_SEL1/RxD 12 2 1 SLEEP g-Sel2 g-Sel1 U1 ADC_Z BUTTON1/RES GND BUTTON2/TXD ADC_Y 13 GND SPICLK MOSI MISO 1 1 1 1 ADC_X 14 15 GND SPICLK MOSI MISO TEST POINTS Alps SKRP S1 Alps SKRP S2 BUTTONS GND Z Y X MMA7260QT VDD ACCELEROMETER 3 VDD EGND1 EGND2 EGND3 EGND4 17 18 19 20 VSS 4 1 2 3 4 3 4 28 1 2 3.4.11 Sensor Board Schematic ESTAR Sensor Board Hardware Overview 434 MHz Wireless Triple Axis Accelerometer Reference Design, Rev. 0 Freescale Semiconductor Bill of Materials 3.5 Bill of Materials Table 3-2 Sensor Board Bill of Materials Item Quantity Reference Part Manufacturer Manufacturer Order Code 1 1 BATT1 battery holder CR2032 Renata SMTU 2032-1 2 1 C1 100uF/6.3V AVX TAJB107K006R 3 2 C2,C3 10nF AVX 06035C103KAZ2A 4 1 C4 6.8pF PHYCOMP 223886715688 5 4 C5,C11,C15,C16 1nF AVX 06035C102KAT2A 6 1 C13 1nF - 5% AVX 6 4 C6,C7,C8,C14 100nF AVX 06033G104ZAT2A 7 3 C9,C10,C12 100pF AVX 06035A101JAT2A 9 1 C18 3.3pF AVX 06032U3R3BAT2A 8 1 D1 KP-1608SEC Kingbright KP-1608SEC 9 1 J2 BDM + serial N/A 10 1 L1 39nH TDK MLG1608B39NJT 11 1 L2 100nH TDK MLG1608B10JT 12 1 Q1 24MHz NX3225GA NDK NX3225GA 24MHz S1-4085-8050-8 13 1 R1 470R resistor 0603 package any available 15 1 R3 470k - 1% resistor 0603 package any available 16 2 S1,S2 switch SKRP Alps SKRPADE010 (or SKRPACE010 or SKRPABE010) 18 1 U1 MMA7260QT Freescale MMA7260QT (MMA7260QR2 for tape and reel) 19 1 U2 MC9S08QG8CDTE Freescale MC9S08QG8CDTE 20 1 U3 MC33696 Freescale MC33696FJE/R2 434 MHz Wireless Triple Axis Accelerometer Reference Design, Rev. 0 Freescale Semiconductor 29 Sensor Board Layout 3.6 Sensor Board Layout Copper Silk Screen Solder Mask φ34.5mm Top Bottom 34.5mm=1.36in Figure 3-9 Sensor Board PCB Layout (1:1) 3.7 Memory Usage in MC9S08QG8 Table 3-3 Memory Usage in MC9S08QG8 Memory Usage in MC9S08QG8 Type Hexadecimal Value DECimal Value READ_ONLY (R) 1422 5154 READ_WRITE (R/W) AC 172 Available Memory in MC9S08QG8 READ_ONLY (R) 2000 8192 READ_WRITE (R/W) 200 512 434 MHz Wireless Triple Axis Accelerometer Reference Design, Rev. 0 30 Freescale Semiconductor Chapter 4 USB Stick Board Description 4.1 USB Stick Overview The USB Stick provides a communication bridge between the Sensor Board connection over RF and the PC application via the USB interface. On board there are also three indication LED’s and one push button. The USB Stick accommodates: • MCHC908JW32 - HC08 microprocessor with USB module • MC33696 - RF low power transceiver for ISM bands The USB Stick board utilizes the small footprint as the Sensor Board, being also a dual-layer printed circuit board (PCB). It contains the MC33696 RF transceiver connected through an 8-bit MCHC908JW32 microcontroller to the USB. It’s main task is to receive data from the Sensor Board and transfer it to the PC over the USB link. PCB Antennas MC33696 Button LED indicators MCHC908JW32 USB “A” Type Plug Figure 4-1 USB Stick Board Overview The USB stick board is powered from the USB. See Figure 4-2 for the stick board block diagram. 434 MHz Wireless Triple Axis Accelerometer Reference Design, Rev. 0 Freescale Semiconductor 31 USB Stick Board Description +5 V USB USB SPI MCHC908JW32 MCU DATACLK SEB CONFB STROBE RSSIC MC33696 433.92 MHz RF MATCHING CIRCUIT Antenna VDD Figure 4-2 USB Stick Board Block Diagram Figure 4-3 shows in more detail how different software and hardware modules co-operate with each other. For the USB Stick board operation, several MCHC908JW32 peripheral modules are used. • USB 2.0 Full-speed module (USB) - provides the interface with the PC • Synchronous Peripheral Interface (SPI) - communication with the MC33696 (configuration and receive) • Timer/Pulse-Width modulator (TIM) - generates Manchester code for outgoing messages • General Purpose Input/Output (GPIO) - control for the MC33696, button and LED’s There are two main sw tasks running on the USB Stick board. • receive data from the MC33696 transceiver and store in the RAM buffer • handle the USB module communication, decode and provide the data from the RAM buffer These two tasks are somewhat independent and the only common point between them is the accelerometer, temperature, battery and buttons data buffer in RAM. The RF software communicates with the Sensor Board and retrieves the latest accelerometer data. This is stored in RAM and can be independently read by the PC application via the USB link. All transfers over RF are acknowledged. The protocol employed on the PC side is just a subset of the simple STAR protocol used in the original RD3112MMA7260Q demo. The protocol is described in Section 5.4. 434 MHz Wireless Triple Axis Accelerometer Reference Design, Rev. 0 32 Freescale Semiconductor ESTAR USB Stick Board Hardware Overview MCHC908JW32 Software Sensor & Button Data “Virtual Serial Port” or Mouse USB Protocol Handler ESTAR RF Protocol Handler Low-Level USB Protocol Driver ECHO Driver Serial Peripheral Interface (SPI) Module Simple STAR Protocol Handler TIM GPIO USB 2.0 Full Speed Module MC33696 USB Connection to PC Figure 4-3 ESTAR USB Stick Board Software Overview 4.2 ESTAR USB Stick Board Hardware Overview This section describes the USB Stick board in terms of the hardware design. The MCHC908JW32 microcontroller drives the MC33696 RF transceiver and communicates over USB with the PC. Refer to Figure 4-2. 4.2.1 USB Connections Two USB communication lines are connected directly via R1 to PTE2/D+ and R2 to PTE3/Dmicrocontroller pins. There, the R1 and R2 resistors define the output impedance of both drivers (ZDRV as per chapter 7 of the USB 2.0 specifications). Terminating the D+ line with a 1.5 kΩ pull-up resistor (required for full-speed signalling) is internal in the MCHC908JW32. A USB “A” type SMT Plug is designed at the edge of the USB Stick board allowing the stick to be connected directly into a USB hub. 4.2.2 Power Supply The USB Stick board uses a low-power bus-powered function for board power supply.The specifications are defined in chapter 7.2.1.3 of the USB 2.0 specifications. This means that a maximum of one unit load (100 mA) may be drawn by the USB Stick board. 434 MHz Wireless Triple Axis Accelerometer Reference Design, Rev. 0 Freescale Semiconductor 33 USB Stick Board Description Voltage delivered by USB (VBUS) is defined as a minimum 4.4 V and a maximum 5.25 V on a Low-power Bus-powered Function. Ferrite beads are included on the VBUS and GND USB connections to minimize EMI. The recommended type is listed in the BOM. 4.2.3 MC33696 to MCHC908JW32 Microcontroller Interface On the USB Stick board, the full recommended MC33696 interface has been used. This includes the following connections: • 3-wire Synchronous Peripheral Interface (SPI) connection (MISO, MOSI, SPICLK) • Output data from TIM module (DATA) • Serial interface enable (SEB) signal • Configuration control (CONFB) signal • Strobe external control (STROBE) signal • RSSI control (RSSIC) signal • Data Clock signal (DATACLK) The SPI connection is attached to the MCHC908JW32 SPI module signals (MISO, MOSI, SPCLK). The STROBE signal is routed to GPIO signal PTA3. The remaining three signals (SEB, CONFB and RSSIC) are connected to the GPIO signals of port D (PTD0, PTD2 and PTD1). All signals are described in more details in Section 3.4.6. The MC33696 uses 5 V logic to interface with the MCU; the MC33696 also works with 3.3 V. 4.2.4 Oscillator and Clocking Options The MCHC908JW32 microcontroller requires a stable clock, mainly for the Full-speed USB module operations. USB specifications define an overall 2500 ppm (0.25%) accuracy. Basically, any generic 4 MHz crystal is sufficient for such accuracy. The main issue with 4 MHz crystals are their physical size. Due to the nature of crystal resonating elements, the 4 MHz crystals are simply far too big for the USB Stick in the ESTAR demo. Another option is a SAW resonator (e.g., CERALOCKTM series from Murata). These are usually sorted and selected by the manufacturer to fit the USB 2.0 Full-speed accuracy required. Today, only 6, 12, 24 and 48 MHz versions are available from Murata. A 6 MHz version has been used in the USB Stick design, although the 6 MHz frequency is outside the MCHC908JW32 microcontroller specifications. For final applications we recommended using a 4 MHz crystal that fits the current specification of the MCHC908JW32 MCU. 4.2.5 LED Indicators Connections The MCHC908JW32 microcontroller allows a direct drive of the LED’s on its three pins. PTB0, PTB1 and PTB5 are high-current open-drain outputs, so the LED’s D1, D2 and D3 are connected to these high-current outputs. 434 MHz Wireless Triple Axis Accelerometer Reference Design, Rev. 0 34 Freescale Semiconductor ESTAR USB Stick Board Hardware Overview 4.2.6 Button Connection One button is implemented on the USB Stick board. It is connected to the IRQ microcontroller pin that has an internal pull-up and allows for an easy software interrupt. 4.2.7 MON08 Interface For MCHC908JW32 in-circuit programming, a MON08 interface is required. Several pins must be connected to specific voltage levels in order for the MCHC908JW32 to enter the Monitor mode. The details are described in the MCHC908JW32 data sheet, Chapter 7 Monitor ROM (MON). To minimize the number of MON08 connections, several pins are hardwired to specific voltage levels directly on the USB Stick board. Namely, PTA1 to Vdd, PTA2 and PTC1 to GND. Pins PTA0, RST, IRQ and OSC1, together with the power supply lines, are routed to PCB pads MON08 connector (J3). There is no standard physical connector to be soldered onto the J3 footprint. The J3 connector pads are used during manufacturing for the initial in-circuit programming. Further re-programming of the USB Stick maybe done using an AN2295 Bootloader as described in Section 5.5. 4.2.8 Optional Serial Interface For the purpose of evaluating the USB functions of the MCHC908JW32 microcontroller, a few other pins were routed to an additional PCB pads connector (J2). The two TIM timer pins are connected to J2 allowing emulation of SCI, IIC or such like serial interfaces in software. A simple example of a USB to UART converter software is a part of the AN3153 Application Note - Using the Full-Speed USB Module on the MCHC908JW32. 434 MHz Wireless Triple Axis Accelerometer Reference Design, Rev. 0 Freescale Semiconductor 35 R5 R4 R3 MIRQ C2 100pF Alps SKRP 3 4 GND LED D3 LED D2 LED D1 Q2 R7 1M GND VDD 1 25 26 OSC1 USB_DUSB_D+ R2 33R R1 33R J1 USB-A-MALE GND FB2 BEAD 1 2 3 4 FB1 BEAD VDD MRESET MIRQ OSC1 RXD TXD 21 23 24 37 38 34 27 28 6 1 48 47 46 45 40 39 36 MRESET MIRQ GND RxD STROBE PTA0 Murata CSTCR6M00G53 2 180 180 180 CONNECTORS, INTERFACES GND 1 2 S1 GND C10 2.2nF R6 1k VDD VDD VDD C1 10nF 1 3 5 1 3 5 uMON08 J3 Serial J2 2 4 6 2 4 6 VDD GND VDD GND 2 3 12 20 MOSI MOSI SPICLK MOSI MISO 1 1 GND RSSIC 1 GND RSSIC CONFB 1 SEB CONFB SEB 1 SPICLK 1 1 MOSI MISO TESTPOINTS TxD DATACLK RxD SEB CONFB RSSIC 13 14 15 16 17 18 19 22 7 4 41 5 USB_D+ USB_DSPICLK MOSI MISO 30 31 11 10 9 8 C3 1uF 1 C23 1nF DATACLK 1 SWITCH DATACLK SWITCH 3.3pF C22 L1 82nH GND C17 1nF GND C15 100pF C14 100pF C16 1nF GND 4 3 SWITCH GNDPA2 RFOUT GNDPA1 VCC2VCO GNDLNA RFIN VCC2RF RSSIOUT VCC_33V 8 7 6 5 4 3 2 1 U1 1nF Q1 C6 NX3225GA 24MHz 1 2 GND C5 6.8pF C20 1pF VCC_33V Figure 4-4 USB Stick Schematics PTA0 GND NC NC NC NC GND NC NC NC PTD0 PTB0 PTD1 PTB1 PTD2 PTB5 U2 PTD3 MC68HC908JW32FC PTD4 PTD5 RESET PTD6 IRQ PTD7 CGMXFC PTC0/T1CH0 PTC1/TCLK1 OSC1 PTC2/T1CH1 OSC2 PTC3 PTE2/PS2CLK/D+ PTE3/DPTE4/SPCLK PTE5/MOSI PTE6/MISO PTE7/SS 43 PTA0/KBA0 PTA1/KBA1 PTA2/KBA2 PTA3/KBA3 PTA4/KBA4 PTA5/KBA5 PTA6/KBA6 PTA7/KBA7 32 REG25V C4 100nF 35 REG33V C13 C12 100p1nF 5% VDD MC33696 ECHO+ 100nF GND 100nF C7 C8 100nF C9 MISO MOSI SCLK R8 470K - 1% GND GNDDIG RSSIC DATACLK SEB SPICLK MOSI MISO CONFB DATACLK RSSIC GND 23 22 21 20 19 18 17 TO MCU 24 GND SEB C11 100n CONFB 10 MC33696 + RF XTALOUT VDD VCCINOUT 11 GND 32 GND VCC2OUT 12 MCU, USB, RS232, MON08 1 2 1 2 29 GNDSUBD VCCDIG 13 L3 15nH 28 STROBE STROBE VCCDIG2 14 42 EPGND EPGND EPGND EPGND EPGND EPGND EPGND EPGND EPGND 108 107 106 105 104 103 102 101 100 27 LVD 15 VDD VSS33 VSSPLL 29 33 31 XTALIN 26 VCCIN RBGAP VDDPLL VSS 44 30 VCC2IN SWITCH 9 25 GNDIO GND Freescale Semiconductor 16 4.2.9 USB Stick Schematics ESTAR USB Stick Board Hardware Overview 434 MHz Wireless Triple Axis Accelerometer Reference Design, Rev. 0 36 Bill of Materials 4.3 Bill of Materials Table 4-1USB Stick Bill of Material Item Quantity 1 1 C1 Reference 10nF Part AVX Manufacturer 06035C103KAZ2A Manufacturer Order Code 2 4 C2,C13,C14,C15 100pF AVX 06035A101JAT2A 3 1 C3 1uF PHYCOMP 223824619863 4 1 C5 6.8pF PHYCOMP 223886715688 5 4 C6,C16,C17,C23 1nF AVX 06035C102KAT2A 6 5 C4,C7,C8,C9,C11 100nF AVX 06033G104ZAT2A 7 1 C20 1pF PHYCOMP 223886715108 8 1 C22 3.3pF AVX 06032U3R3BAT2A 9 1 C10 2.2 nF AVX 06035C222KAZ2A 10 1 C12 1 nF 5% AVX 06035A102JAT2A 11 3 D1,D2,D3 KP-1608SEC Kingbright KP-1608SEC 12 2 FB1,FB2 Ferrite bead TDK GLF1608T100M 13 1 J1 USB-A-MALE Molex 48037-1000 14 1 J2 Serial N/A only footprint 15 1 J3 MON08 N/A only footprint 16 1 L1 82nH TDK MLG1608B82NJT 17 1 L3 15nH TDK MLG1608B15NJT 18 1 Q1 NX3225GA 24MHz NDK NX3225GA 24MHz S1-4085-8050-8 19 1 Q2 CSTCR6M00G15 Murata CSTCR6M00G15 20 2 R1,R2 33R resistor 0603 package any available 21 3 R3,R4,R5 820R resistor 0603 package any available 22 1 R6 1k resistor 0603 package any available 23 1 R7 1M resistor 0603 package any available 24 1 R8 470k - 1% resistor 0603 package any available 25 1 S1 Alps SKRP ALPS SKRPAB 26 1 U1 MC33696 Freescale MC33696FJE/R2 27 1 U2 68HC908JW32 Freescale 68HC908JW32 434 MHz Wireless Triple Axis Accelerometer Reference Design, Rev. 0 Freescale Semiconductor 37 USB Stick Board Description 4.4 USB Stick Layout Copper Silk Screen Solder Mask Top 53mm 26 mm Bottom 26mm = 1.02 in 53mm = 2.09 in Figure 4-5 USB Stick PCB layout (1:1) 4.5 Memory Usage in MCHC908JW32 Table 4-2. Memory Usage in MCHC908JW32 Memory usage in MCHC908JW32 for Virtual Serial Port Application Type Hexadecimal Value Decimal Value READ_ONLY (R) 2DA3 11683 READ_WRITE (R/W) 1AA 426 Memory Usage in MCHC908JW32 for HID Class Application READ_ONLY (R) 1820 6176 READ_WRITE (R/W) 119 281 Available Memory in MCHC908JW32 READ_ONLY (R) 8000 32768 READ_WRITE (R/W) 400 1024 434 MHz Wireless Triple Axis Accelerometer Reference Design, Rev. 0 38 Freescale Semiconductor Chapter 5 Software Design 5.1 Introduction This section describes the design of the ESTAR software blocks (mainly communication, because others are general code which needn’t be described). The software description comprises these topics: • ECHO Driver modifications description • ‘Air’ ESTAR RF Protocol protocol description • Serial STAR Protocol and ESTAR Extensions (over USB) protocol description • AN2295 Bootloader (over USB) implementation notes • Accelerometer reading in Section 3.2 5.2 ECHO Driver The Echo driver is a simple ANSI C based code stack available as sample source code which can be used to develop proprietary RF transceiver applications using the MC33696. 5.2.1 Echo Driver Features • • • • • • Compact footprint: – 2.1K FLASH – 77 bytes + transmit buffer (MAX_DATA) + receive buffers((MAX_DATA+2) x count buffers) RAM MC33696 compatible Very-low power, proprietary, bi-directional RF communication link ANSI C source code targeted at the HCS08 and HC08 core Sample application included, extremely easy to use Liberally commented 434 MHz Wireless Triple Axis Accelerometer Reference Design, Rev. 0 Freescale Semiconductor 39 Software Design 5.3 ESTAR RF Protocol The ESTAR demo uses very simple protocol to transfer the accelerometer, button, voltage, temperature and calibration data between the Sensor Board and the USB Stick over the RF medium. The protocol is built on top of the ECHO Driver drivers that are available for the MC33696 transceiver. All data is transferred in packets. This protocol is primarily targeted at simple demo purposes, allowing a fast transfer of the accelerometer data in short packets with minimum overheads and with minimum battery loads (most of the receive windows are eliminated, short transmit packets, etc.). 5.3.1 Packet Format The ESTAR packet is contained inside the MC33696 standard packet structure. The used packet becomes a payload data for the MC33696 standard packet and contains the following fields: • ID • Header • Command • RX Strength • Data RF Signal P+ID P+ID P+ID P+ID P+ID P+Header Data EOM P+ID Preamble+ID Echo Driver Packet Format P+Header Preamble+Header EOM End Of Message Packet Length Data Only for Sensor USB ESTAR Packet Structure Command RX Strength Data ESTAR Command Byte Structure 4 Status Bits 4-Bits Command Figure 5-1 Packet Format 434 MHz Wireless Triple Axis Accelerometer Reference Design, Rev. 0 40 Freescale Semiconductor ESTAR RF Protocol 5.3.1.1 ID The ID value is used for identifying both transmitting and receiving devices. Packets with a different ID are simply ignored. This field is 6 bits long. 5.3.1.2 Header The Header serves as identification sequence bits at the start of the load data bits. This field is 4 bits long. 5.3.1.3 Command This byte is split into two parts: the lower 4 bits contain the command number, the upper 4 bits contain the status bits. The upper bits - status is defined as follows: • Sensor Board to USB Stick – MODE_BIT (0x20) - shows which mode of operation (16/8 - bits) the Sensor Board just worked in – ACK_BIT (0x10) - informs the USB board if a previous acknowledgment was received • USB Stick to Sensor Board – MODE_BIT (0x20) - informs the Sensor Board which is the latest mode of operation – G_SEL bits (0x80,0x40) - these bits transmit the actual request for MMA7260Q scale to the Sensor Board. The g-range data is intended to switch the g-range of the accelerometer sensor. The lower bits contains commands which are defined and listed in Table 5-1. Table 5-1 ESTAR Command List Command Command Code Direction Data CMD_TEST (0x01) Both none CMD_TRIAX_DATA (0x02) Sensor Board to USB Stick accelerometer values, button levels, voltage, temperature CMD_ACK (0x04) USB Stick to Sensor Board acknowledgment for CMD_TRIAX_DATA CMD_CALIB_R (0x05) Both calibration data from Sensor Board and request for it CMD_CALIB_W (0x06) USB Stick to Sensor Board calibration data to Sensor Board CMD_CALIB_ACK (0x07) Sensor Board to USB Stick acknowledgment for CMD_CALIB_W command 5.3.1.4 RX Strength This field reports the strength of the last received packet on the Sensor Board. This value simply tells us how well the other side receives ‘our packets’. This is used only for additional ESTAR command over USB protocol Signal Strength (user friendly) ’s’(0x73). This field is 8 bits long. 434 MHz Wireless Triple Axis Accelerometer Reference Design, Rev. 0 Freescale Semiconductor 41 Software Design 5.3.1.5 Data The Data field follows the Command field and may be empty if the actual command doesn’t require any additional data. The data format is dependent on the Command. A detailed description is in the next chapter. 5.3.2 ESTAR Protocol Commands Description 5.3.2.1 CMD_TEST This command is sent when the Sensor Board tries to establish connection with the USB Stick. The Sensor Board first sends this command and then waits for response. This sequence is repeated several times until it gets a response. Once a USB Stick receives this command, it responds with a CMD_TEST command. 5.3.2.2 CMD_TRIAX_DATA Once the connection is established, the Sensor Board starts to periodically transmit accelerometer, button, voltage, temperature and g-range status data towards the USB Stick. The Data field contains 11 or 6 bytes, depending on actual working mode; the actual X, Y and Z accelerometer values, a byte with status information, raw temperature and raw voltage. Data Bytes: 0 1 Status 2 3 X Value g-Range bits: msb 7 6 4 Y Value 5 6 Z Value Unused 7 8 9 Raw Temperature 10 Raw Voltage Button 2 Button1 5-2 1 0 lsb Figure 5-2 CMD_TRIAX_DATA Data Format Each transmission of a CMD_TRIAX_DATA packet is acknowledged by a CMD_ACK packet from the USB Stick. 5.3.2.3 CMD_ACK This command is sent as the data acknowledgement for CMD_TRIAX_DATA so the Sensor Board is informed that the connection is still alive. If the receive window is opened by the Sensor Board and the CMD_ACK has not been received, the operation (periodic transmission of a CMD_TRIAX_DATA packet) continues but the Sensor Board will cut the dead time (the time till board switch off) by ~40 seconds. When dead time counter overflows, the Sensor Board goes into deep sleep mode. 434 MHz Wireless Triple Axis Accelerometer Reference Design, Rev. 0 42 Freescale Semiconductor ESTAR RF Protocol 5.3.2.4 CMD_CALIB_R This command is used for two purposes. 1. From the USB Stick to the Sensor Board - used as a request to read the calibration data stored in the Sensor Board Flash memory 2. From the Sensor Board to the USB Stick - used as a reply to the request and immediately transmits a message with the same command along with the calibration data. The data format is shown in Figure 5-3: Data Bytes: 0 1 X value (0 g) 2 3 X value (1 g) 4 5 Y value (0 g) 6 7 Y value (1 g) 8 9 Z value (0 g) 10 11 Z value (1 g) Figure 5-3 CMD_CALIB_R Data Format 5.3.2.5 CMD_CALIB_W This command carries the calibration data provided by the USB Stick for the Sensor Board and is sent instead of a CMD_ACK packet. The calibration data is intended to be stored in the Sensor Board Flash memory. The USB Stick keeps sending a CMD_CALIB_W until the Sensor Board confirms receipt using a CMD_CALIB_ACK packet. 5.3.2.6 CMD_CALIB_ACK This command is only used to acknowledge command CMD_CALIB_W as described in Section 5.3.2.5. 5.3.3 ESTAR RF Protocol Description State machines are implemented in both devices for RF protocol. Each device has slightly different steps because they have different functions and requirements on power saving. All other services in the USB Stick are based on interrupts routines. 5.3.3.1 USB Stick RF State Machine The state machine in the USB Stick contains 4 states: 1. NOT INIT - in this state software inits all software and hardware resources for RF. After everything has been initialized, the software jumps to the next state NO_RF. 2. NO_RF - in this state, the software waits for the first transmission from the Sensor Board. After receiving a proper message with the CMD_TEST command, the state machine passes over to ACTIVE_RF. LED1 and LED2 are blinking in this state. 3. ACTIVATE_RF - this state activates the service for the first information exchange between the Sensor Board and the USB Stick (mainly calibration data saved on the Sensor Board).When all the first transmissions have finished the software jumps to the final state, RF_WORK. 4. RF_WORK - in this state the software is periodically receives a transmission from the air and services it. If no transmission is received in a long time (time is set to <10s), the software automatically jumps to the first state NOT_INIT. 434 MHz Wireless Triple Axis Accelerometer Reference Design, Rev. 0 Freescale Semiconductor 43 Software Design 5.3.3.2 Sensor Board RF State Machine The state machine in the Sensor Board has 4 steps too, but different: 1. NOT_INIT - this state has a very similar function to the NOT_INIT state of the USB Stick state machine. 2. NO_RF - in this state, the software periodically transmits a preliminary command CMD_TEST and then waits for the correct reply. If the Sensor Board doesn’t receive a correct answer, then transmission is repeated up to 30 times and then the Sensor Board goes into the RF_SLEEP state. If the Sensor Board receives a correct answer then the state machine jumps to state RF_WORK. 3. RF_WORK - in this state the software periodically transmits data to the USB Stick by CMD_TRIAX_DATA and answers all other commands from the USB Stick (mainly the CMD_CALIB_W command). During this time there is dead running time which can send the device into sleep mode (RF_SLEEP). Under normal conditions this time is set as 2 minutes from the last button press, but if the Sensor Board doesn’t receive any acknowledgement after 8 consecutive transmissions, the dead time is reduced by ~40 seconds. If dead time overflows, the state machine jumps to the final state of RF_SLEEP. 4. RF_SLEEP - in this state the software only switches off the periodic timer for the CMD_TRIAX_DATA and puts the device into sleep mode. When any button on the Sensor Board is pushed, the system is woken up and the state machine is set to NOT_INIT state. 5.3.3.3 RF Communication Overview, Establish Connection Time Flow Complete initialization of RF communication takes only six steps under ideal conditions, as shown in picture Figure 5-4. This figure shows a really ideal situation, but the reality is different. In these cases, the ESTAR can repeat all commands and transfers until it receives a correct answer or the dead counter in any device overflows. Step 1. - After the Sensor Board wakes up from sleep mode it periodically sends the CMD_TEST command. Then the USB Stick can receive one of many CMD_TEST commands and jumps into the ACTIVATE_RF state. Step 2. - The Sensor Board doesn’t know that the USB Stick has received the CMD_TEST command and sends the next one. Step 3. - The USB Stick is in the ACTIVATE_RF state and generates an acknowledgment (CMD_TEST) in reply to the CMD_TEST command from the Sensor Board. Step 4. - Because the Sensor Board is placed in the RF_WORK state, it starts to periodically generate the CMD_TRIAX_DATA command and send it over the air. Step 5. - The USB Stick is still in the ACTIVATE _RF state. After the command CMD_TRIAX_DATA is received from the Sensor Board, USB Stick requests calibration data using the CMD_CALIB_R command. Step 6. - If the Sensor Board receives in the RF_WORK state a CMD_CALIB_R command, it immediately sends the actual calibration data saved in Flash memory. When the USB Stick receives this message the preparation stage for communication ends, and both devices are ready for normal communication. Step n. - The Sensor Board continues transmitting CMD_TRIAX_DATA messages and waits for an acknowledgment CMD_ACK from the USB Stick board. Step n+1. - After each correctly received CMD_TRIAX_DATA command from the Sensor Board, the USB Stick transmits a CMD_ACK command as an acknowledgment. 434 MHz Wireless Triple Axis Accelerometer Reference Design, Rev. 0 44 Freescale Semiconductor ESTAR RF Protocol Step x. - This step is used only when the user writes calibration data to the Sensor Board over a terminal or GUI (RD3152MMA7260Q_SW.exe). The USB Stick transmits a CMD_CALIB_W command with the new calibration data. Step x+1. - When the Sensor Board receives a CMD_CALIB_W command with new calibration data, it immediately transmits a CMD_CALIB_ACK command as an acknowledgment. Sensor Board NOT_INIT USB Stick Board AIR NOT_INIT 1. step - S->U req. CMD_TEST NO_RF NO_RF 2. step - S->U req. CMD_TEST 3. step - U->S ack. CMD_TEST 4. step - S->U data CMD_TRIAX_DATA ACTIVATE_RF 5. step - U->S req. CMD_CALIB_R 6. step - S->U data CMD_CALIB_R n. step - S->U data CMD_TRIAX_DATA RF_WORK n+1. step - U->S ack. CMD_ACK x. step - U->S data CMD_CALIB_W RF_WORK x+1. step - S->U ack. CMD_CALIB_ACK RF_SLEEP S->U - Sensor to USB U->S USB to Sensor req. - request ack. - acknowledgment data - data message Time Figure 5-4 RF Protocol Overview of Both Software State Machines in Both Devices 434 MHz Wireless Triple Axis Accelerometer Reference Design, Rev. 0 Freescale Semiconductor 45 Software Design 5.4 STAR Protocol and ESTAR Extensions (over USB) The ESTAR demo uses a subset of the original STAR demo protocol commands. This way, most of the software originally developed for the RD3112 (STAR) is also usable with the ESTAR. The STAR demo communicates over the RS232 serial line with a simple text-based protocol. The same protocol is used in ESTAR for communication between the USB Stick and a PC (over a virtual serial port). The PC application sees the same interface (serial port) and the same protocol as if a STAR demo was connected. 5.4.1 Communication Handshake ‘R’ (0x52) Initially, a handshake (commands needed to test/establish the connection between the PC and the ESTAR demo) is conducted. This is accomplished by the PC sending an ‘R’ command, the ESTAR demo responding with ‘N’. In this way, the PC application sees that the demo is ready for communication. Communication is reset, operation mode is set to 8-bit (default value) and any debug or system modes are disabled. All subsequent commands will carry only 8-bit values (backward compatibility). ‘R’ PC to demo ‘N’ demo to PC Figure 5-5 Communication Handshake ‘R’ (0x52) 5.4.1.1 Extended Communication Handshake ‘r’ (0x72) To determine whether an ESTAR or STAR demo is connected, the ESTAR (and ZSTAR) demo implements an Extended Handshake Communication command. Once the PC sends the ‘r’ command, the ESTAR demo responds with a ‘z’ and switches itself to 16-bit mode. All subsequent commands will carry left justified 16-bit values (extended values). The communication uses big endianism, i.e., more significant byte first. ‘r’ PC to demo ‘z’ demo to PC Figure 5-6 Extended Communication Handshake ‘r’ (0x72) 434 MHz Wireless Triple Axis Accelerometer Reference Design, Rev. 0 46 Freescale Semiconductor STAR Protocol and ESTAR Extensions (over USB) 5.4.2 Accelerometer Data Transfer ‘V’ (0x56) The PC sends the Values ‘V’ command, the demo responds with 6 bytes (or 9 bytes in 16-bit mode) in the following sequence: 'x', X-value, 'y', Y-value, 'z', Z-value, simply an ‘x’ character followed by the actual X-axis accelerometer binary value, then a ‘y’ followed by the actual Y-axis accelerometer binary value and a ‘z’ followed by the actual Z-axis accelerometer binary value. Since the ESTAR demo caches the last (over the air) transmitted values, these values are immediately provided to the PC. ‘V’ PC to demo ‘x’ X-axis value ‘y’ Y-axis value ‘z’ Z-axis value demo to PC Figure 5-7 Accelerometer Data Transfer ‘V’ (0x56) 5.4.2.1 Extended Accelerometer Data Transfer ‘v’ (0x76) The ESTAR demo has two buttons placed on the Sensor Board. The microcontroller on the Sensor board is capable of measuring the internal bandgap voltage reference and temperature. To acquire the actual state of these values, the original ‘V’ command has been extended to a ‘v’ command, providing the same information, followed by a ‘s’ character and a binary byte containing the actual state. The least two significant bits are used, the others are used for packet error ratio. If a button is pressed, the actual bit is set to ‘1’, otherwise, the bit is ‘0’. The status data is followed by a ‘t’ character with the raw temperature value, and finally a ‘b’ character followed by the raw bandgap voltage value. ‘v’ PC to demo ‘x’ X-axis value ‘y’ Y-axis value ‘z’ Z-axis value ‘s’ buttons + packet err ‘t’ raw temperature ‘b’ raw bandgap demo to PC Figure 5-8 Extended Accelerometer Data Transfer ‘v’ (0x76) To obtain a true battery voltage from the raw bandgap value, the following formula may be used: 65536 V batt = ------------------------- ¥ 1.20V rawbgap (5-1) assuming rawbgap has a 16-bit format value. In 8-bit mode, the number 65536 must be changed to 256. The real temperature can be calculated from the bandgap reference voltage and the raw temperature value; first, the true voltage of the temperature sensor is obtained: rawtemperature V temp = ---------------------------------------------- ¥ 1.20V rawbgap (5-2) 434 MHz Wireless Triple Axis Accelerometer Reference Design, Rev. 0 Freescale Semiconductor 47 Software Design then, if the temperature is above 25°C, i.e. voltage is above 0.7012V, the real temperature is: V temp – 0.7012 temperature = 25 – ⎛⎝ ----------------------------------------⎞⎠ 0.001646 (5-3) otherwise (temperatures below 25°C): V temp – 0.7012 temperature = 25 – ⎛⎝ ----------------------------------------⎞⎠ 0.001769 (5-4) 5.4.3 Calibration Data ‘K’ (0x4B) The calibration data is the accelerometer values for specific g (acceleration) levels. The values for 0 g and 1 g (Earth gravity) are provided for each axis. These values are stored in the Flash memory of the Sensor Board and are transferred to the USB Stick once the air connection is established (as described in Section 5.3.2.4). These values are stored in the USB Stick for retrieval by the PC using the ‘K’ command. The PC sends the Calibration data ‘K’ command, the demo responds with 9 bytes in 8-bit mode (or 15 bytes in 16-bit mode) in the following sequence: 'X', Xval0, Xval1, 'Y', Yval0, Yval1, Z', Zval0, Zval1, simply an ‘X’ character followed by the 0g and 1g X-axis calibration accelerometer binary values, and the same for Y- and Z-axes. ‘K’ PC to demo ‘X’ x (0 g) x (1 g) ‘Y’ y (0 g) y (1 g) ‘Z’ z (0 g) z (1 g) demo to PC Figure 5-9 Calibration Data ‘K’ (0x4B) 5.4.4 Calibration Process ‘k’ (0x6B) The calibration process is initiated by a ‘k’ command from the PC, followed by 6 bytes of calibration data. These are stored in the Flash memory of the Sensor Board. More in Section 5.3.2.5. The calibration data contains 6 bytes in 8-bit mode (or 12 bytes in 16-bit mode) in the following sequence: Xval0, Xval1, Yval0, Yval1, Zval0, Zval1 - 0g and 1g calibration accelerometer binary values for X-, Yand Z-axes. No response from the demo is provided. Verification of the calibration data stored can be done using the Calibration Data ‘K’ (0x4B) command. ‘k’ x (0 g) x (1 g) y (0 g) y (1 g) z (0 g) z (1 g) PC to demo demo to PC Figure 5-10 Calibration Process ‘k’ (0x6B) 434 MHz Wireless Triple Axis Accelerometer Reference Design, Rev. 0 48 Freescale Semiconductor STAR Protocol and ESTAR Extensions (over USB) 5.4.4.1 Remaining STAR Demo Commands The remaining STAR commands, such as 'F', 'G', 'H', '0', '1', '2', '3' and 'E' are not yet implemented in this version of the ESTAR demo. 5.4.5 Additional ESTAR Commands 5.4.5.1 g-Select Reading ‘G’ (0x47) The ESTAR demo allows dynamic selection of the g-range for the accelerometer sensor (see details in Section 3.4.2), thus additional commands are implemented to read and change the g-range. When the PC issues a ‘G’ command, the ESTAR demo responds with the g-range actually selected. A ‘0’, ‘1’, ‘2’ or ‘3’ character is returned where ‘0’ is for the 1.5g range, ‘1’ for 2.0g, ‘2’ for 4.0g and ‘3’ for the 6.0g range. If a different sensor (e.g. MMA7261QT) is implemented on the Sensor Board, the g-ranges are 2.5g, 3.3g, 6.7g and 10g respectively. ‘G’ PC to demo g-select value demo to PC Figure 5-11 g-Select Reading ‘G’ (0x47) 5.4.5.2 g-Select Setting ‘g’ (0x67) To select the g-range of the sensor on the ESTAR Sensor Board, a ‘g’ command is issued. It needs to be followed by the required g-range (‘0’, ‘1’, ‘2’ or ‘3’). The USB Stick board then communicates this selection to the Sensor Board over the air (see more in Section 5.3.1.3). No response from the demo is provided. To verify which g-range has been selected, the g-Select Reading ‘G’ (0x47) command can be used. ‘g’ g-select value PC to demo demo to PC Figure 5-12 g-Select Setting ‘g’ (0x67) 5.4.5.3 Info ‘I’ (0x49) The Info command ‘I’ has only been added to determine which version, compile date, and author of the USB Stick software has been implemented. The demo returns plain text information, and this command is usually issued over terminal (e.g., HyperTerminal) software. 434 MHz Wireless Triple Axis Accelerometer Reference Design, Rev. 0 Freescale Semiconductor 49 Software Design ‘I’ PC to demo info text, version, date, etc. demo to PC Figure 5-13 Info ‘I’ (0x49) 5.4.5.4 ESTAR Help ‘H’(0x48), ‘h’(0x68) The help command only returns plain text information on all ESTAR commands; this command is implemented for an easier human interface over a terminal ‘H’ or ‘h’ PC to demo Help text for ESTAR commands demo to PC Figure 5-14 ESTAR Help ‘H’(0x48), ‘h’(0x68) 5.4.5.5 Signal Strength (user friendly) ’s’(0x73) This command return in a user friendly representation values on the receive strength signals for both devices. Values are in hex code and the scale is 0x00 - 0x1F. ‘s’ PC to demo Information on the signal strength both devices demo to PC Figure 5-15 Signal Strength (user friendly) ’s’(0x73) 5.4.5.6 Signal Strength (binary) ‘S’(0x53) This command sends the same information as the command Signal Strength (user friendly) ’s’(0x73), but in binary code. It’s designed for the demo application RD3162MMA7260Q_SW.exe. 434 MHz Wireless Triple Axis Accelerometer Reference Design, Rev. 0 50 Freescale Semiconductor STAR Protocol and ESTAR Extensions (over USB) ‘S’ PC to demo ‘s’ RSSI USB RSSI key demo to PC Figure 5-16 Signal Strength (binary) ‘S’(0x53) 5.4.5.7 Read MC33696 Registers on USB Dongle ‘A’(0x41), ‘a’(0x61) The USB Stick reads all the MC33696 registers (bank A) on the board and then returns them in friendly mode to the terminal. All values are in hex code. ‘A’ or ‘a’ PC to demo Return MC33696 registers values demo to PC Figure 5-17 Read MC33696 Registers on USB Dongle ‘A’(0x41), ‘a’(0x61) 5.4.5.8 Temperature and Battery ‘T’(0x54), ‘t’(0x74) The Temperature and battery command returns the received temperature and battery values from the Sensor Board in user friendly mode. Temperature is in non computed raw format (hex), but battery voltage is calculated in the USB Stick up to two digits after decimal point. If the Sensor Board is not connected, the USB Stick informs the user. ‘T’ or ‘t’ PC to demo Information on the Sensor board temperature and voltage demo to PC Figure 5-18 Temperature and Battery ‘T’(0x54), ‘t’(0x74) 5.4.5.9 Working Mode ‘M’(0x4D), ‘m’(0x6D) The USB Stick returns the actual working mode (8/16 bit) for both devices in user friendly mode. If the Sensor Board is not connected, the USB Stick informs the user. 434 MHz Wireless Triple Axis Accelerometer Reference Design, Rev. 0 Freescale Semiconductor 51 Software Design ‘M’ or ‘m’ PC to demo Information on the mode (8-16bit) for both devices demo to PC Figure 5-19 Working Mode ‘M’(0x4D), ‘m’(0x6D) 5.4.5.10 Show Calibration Data ‘q’(0x71) The command Show calibration data ‘q’ returns calibration data from RAM memory in the USB Stick. If the Sensor Board is not connected the command returns the value from the last communication with it. If the sensor board has never been connected, the command returns the default values from Flash memory. ‘q’ PC to demo Calibration data shown in decimal system demo to PC Figure 5-20 Show Calibration Data ‘q’(0x71) 5.4.5.11 Read g-Select ‘N’(0x4E),’n’(0x6E) This command has a similar function as in Section 5.4.5.1). The only difference is in visualization. This is a user friendly command. If the Sensor Board is not connected, the USB Stick informs the user. ‘N’ or ‘n’ PC to demo G-select information in user friendly mode demo to PC Figure 5-21 Read g-Select ‘N’(0x4E),’n’(0x6E) 5.4.5.12 Debug On ‘U’ (0x55) and Debug Off ‘u’ (0x75) Various debug information can be observed after issuing a ‘U’ command, usually using terminal (e.g. HyperTerminal) software. Mainly, information on the air protocol is displayed in text. The debug information is no longer displayed after issuing a ‘u’ command or Communication Handshake ‘R’ (0x52). 434 MHz Wireless Triple Axis Accelerometer Reference Design, Rev. 0 52 Freescale Semiconductor Bootloader ‘U’ ‘u’ PC to demo various debug information mainly on air protocol no debug info demo to PC Figure 5-22 Debug On ‘U’ (0x55) and Debug Off ‘u’ (0x75) 5.4.6 Further Debug and Test Commands 5.4.6.1 Semi-Automatic Self-Calibration For the purpose of easier semi-automatic calibration of the ESTAR demo, an additional Calibration command ‘Q’ (0x51) has been added. This command is usually issued over terminal (e.g. HyperTerminal) software. A user is required to place the Sensor Board into 3 specific positions, in which the Earth gravity will induce a maximum acceleration in each of X, Y, and Z axes. After issuing the first ‘Q’ command, the Sensor Board must be placed flat, i.e. with the Z-axis aiming towards the Earth’s core. After the second issue of a ‘Q’ calibration command, the board’s X-axis has to be aimed towards the Earth’s core. The board should ‘stay’ on its right edge. Next, the Y-axis is calibrated, with the board ‘staying’ on its top edge. Finally, after issuing the fourth ‘Q’ command, the calibration data is sent to the Sensor Board, actually using the CMD_CALIB_W command. Text help is provided during the self-calibration process. 5.5 Bootloader There’s bootloader software implemented in MCHC908JW32 microcontroller. The bootloader is based on AN2295 Application Note - Developer’s Serial Bootloader for M68HC08 and HCS08 MCU’s and AN2295SW accompanied software. The original AN2295 bootloader targets serial connections between the PC and applications, and since the MCHC908JW32 implements a virtual serial port application, the USB version of the AN2295 bootloader has been created to allow reprogramming of Flash memory in the USB Stick. The USB virtual serial port software is fully described in AN3153 Application note - Using the Full-Speed USB Module on the MCHC908JW32; the MCHC908JW32 bootloader implements the same virtual serial port but under a different PID (the PC sees that serial port as a different application from ESTAR). The bootloader drivers installation guide can be found in chapter 6.1.2 of AN2295 Bootloader Drivers Installation. 434 MHz Wireless Triple Axis Accelerometer Reference Design, Rev. 0 Freescale Semiconductor 53 Software Design 5.5.1 Bootloading Procedure 1. Find the folder with binaries on the installation CD: 2. Start (double-click) the CMD.EXE shortcut, a command line window should appear: 3. Now type: hc08sprg [bootloader com port number] [binary (S file) that you want to bootload], just like this: hc08sprg.exe com6 ESTAR_Dualboot.S19 434 MHz Wireless Triple Axis Accelerometer Reference Design, Rev. 0 54 Freescale Semiconductor Bootloader 4. Press ENTER and initial bootloader communication will start: If this screen does not appear, remove the USB stick and start from the beginning. 434 MHz Wireless Triple Axis Accelerometer Reference Design, Rev. 0 Freescale Semiconductor 55 Software Design 5. Just confirm with Y, and the binary will be loaded onto the USB stick: The bootloader disappears (in Device Manager) and the newly loaded software starts to execute. Using this procedure the software in the USB Stick can be changed anytime. 5.5.2 Dualboot Guidelines NOTE: The USB Stick comes with two factory set dualboot-aware applications already pre-programmed. USB Stick and AN2295 Bootloader software provide a way of having two different software (devices) in one USB Stick. In order to do this, two dualboot-aware versions of the software need to be consecutively bootloaded onto the USB Stick: Follow the sequence of instructions in the 5.5.1 Bootloading Procedure for two dualboot versions of software: 1. First bootload ESTAR_Dualboot.S19. After bootloading, ESTAR Triaxial Demo (COMx) should appear in Device Manager. 2. Next, remove the USB stick again, press the button, re-insert the stick and bootload HID ESTAR_Dualboot.S19 software in. After bootloading, a new device (ESTAR Triaxial Mouse) should appear: 434 MHz Wireless Triple Axis Accelerometer Reference Design, Rev. 0 56 Freescale Semiconductor Bootloader The ‘tilt’ mouse will install automatically and also appear in the Device Manager: 5.5.2.1 Dualboot Applications Switching Having both dualboot-aware applications programmed onto the USB Stick, they can be switched just by quickly pressing the button (having the USB Stick inserted into the USB slot). The applications will appear and disappear accordingly. Please note that the ‘tilt’ mouse application must have sensor board calibrated correctly (e.g. using RD3152MMA7260Q_SW.exe or Semi-Automatic Self-Calibration procedure). 434 MHz Wireless Triple Axis Accelerometer Reference Design, Rev. 0 Freescale Semiconductor 57 Software Design 434 MHz Wireless Triple Axis Accelerometer Reference Design, Rev. 0 58 Freescale Semiconductor Chapter 6 Application Setup 6.1 ESTAR Installation Procedure 6.1.1 USB stick Installation First of the all, install the USB stick to your PC. Please follow the next steps. 1. Plug the USB stick into a USB slot.The ‘Found New Hardware’ announcement should appear: 2. Then the installation wizard starts searching for new hardware. Choose “Install from a list or special location” 434 MHz Wireless Triple Axis Accelerometer Reference Design, Rev. 0 Freescale Semiconductor 59 Application Setup 3. Point to the Installation CD as the driver path: 4. Installation should continue: 434 MHz Wireless Triple Axis Accelerometer Reference Design, Rev. 0 60 Freescale Semiconductor ESTAR Installation Procedure 5. If you are using Windows XP SP1, you will be asked to stop or continue installation because the drivers are not certified by Microsoft. Select the “Continue Anyway” button 6. Installation should successfully finish. 434 MHz Wireless Triple Axis Accelerometer Reference Design, Rev. 0 Freescale Semiconductor 61 Application Setup 7. Check whether a new serial port (ESTAR Triaxial Demo) has appeared in your Device Manager (My Computer, right click, Manage, Device Manager): 8. If required, the ESTAR Triaxial Demo COM port may be renumbered using the standard procedure in the Windows operating system: Right click for Properties, Port Settings tab, Advanced button and change the COM port number accordingly. 434 MHz Wireless Triple Axis Accelerometer Reference Design, Rev. 0 62 Freescale Semiconductor ESTAR Installation Procedure 9. Launch the RD3152 software “RD3152MMA7260QSW.exe" and select the COM port number which you may have assigned in Device Manager. If no error message appears, the COM port is opened correctly and the software communicates with the USB stick. 10. Now let’s go and check the data from the ESTAR Sensor Board. Raw data, 2D/3D screen, or Scope work should be used for this purpose. While moving (turning, shaking) with an ESTAR Sensor Board, data from each separate axis should change accordingly. The RD3152MMA7260QSW calibration screen can be used for sensor calibration (calibration data is stored in the Sensor Board). 6.1.2 AN2295 Bootloader Drivers Installation This procedure assumes that ESTAR Demo drivers are already installed. The drivers are also common for the bootloader (= are already present in the Windows folders). If not, the procedure will be identical to the ESTAR drivers installation. 1. Press the Button on the USB stick and insert it into a USB connector (keeping the button pressed when inserted). The following window appears: 434 MHz Wireless Triple Axis Accelerometer Reference Design, Rev. 0 Freescale Semiconductor 63 Application Setup 2. The PC searches for an appropriate driver (as in the ESTAR Demo, in some instances a folder with drivers (star.inf and usbser-zstar.sys) needs to be selected). 3. If the PC shows a window for a digital signature then click Yes, and the bootloader port will be installed (as seen in the Device manager): 4. Right click My computer on the Desktop > Properties, Hardware tab, Device Manager button. 5. A similar setup should be observed: 6. Note down the COM port number (here, COM8); this is the port number of the Bootloader. When the software in the USB stick needs to be updated, the Bootloader can be invoked anytime, just by pressing the button while inserting the USB stick into the USB slot. 434 MHz Wireless Triple Axis Accelerometer Reference Design, Rev. 0 64 Freescale Semiconductor Appendix A References The following documents can be found on the Freescale web site: http://www.freescale.com. 1. 2. 3. 4. 5. 6. 7. AN2295 Application Note - Developer’s Serial Bootloader for M68HC08 and HCS08 MCU’s AN3153 Application Note - Using the Full-Speed USB Module on the MCHC908JW32 MC9S08QG8 Datasheet MCHC908JW32 Datasheet MMA7260QT Datasheet USB2.0 Specification (www.usb.org) AN2961 Echo Driver Software 434 MHz Wireless Triple Axis Accelerometer Reference Design, Rev. 0 Freescale Semiconductor 65 434 MHz Wireless Triple Axis Accelerometer Reference Design, Rev. 0 66 Freescale Semiconductor How to Reach Us: Home Page: www.freescale.com Web Support: http://www.freescale.com/support USA/Europe or Locations Not Listed: Freescale Semiconductor, Inc. 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 Hong Kong Ltd. Technical Information Center 2 Dai King Street Tai Po Industrial Estate Tai Po, N.T., Hong Kong +800 2666 8080 support.asia@freescale.com For Literature Requests Only: Freescale Semiconductor Literature Distribution Center P.O. Box 5405 Denver, Colorado 80217 1-800-441-2447 or 303-675-2140 Fax: 303-675-2150 LDCForFreescaleSemiconductor@hibbertgroup.com ESTARRM Rev. 0 02/2007 RoHS-compliant and/or Pb-free versions of Freescale products have the functionality and electrical characteristics of their non-RoHS-compliant 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. Information in this document is provided solely to enable system and software implementers to use Freescale Semiconductor 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 and all 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 the 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 and hold 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 claim alleges that Freescale Semiconductor was negligent regarding the design or manufacture of the part. Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2007. All rights reserved.