User Manual
Table Of Contents
- Revision History
 - Table of Contents
 - Chapter 1 Introduction
 - Chapter 2 Wireless Sensing Triple Axis Reference design introduction
 - Chapter 3 Sensor Board description
- 3.1 Board overview
 - 3.2 A/D conversion of XYZ levels
 - 3.3 Power management
 - 3.4 ZSTAR Sensor Board hardware overview
- 3.4.1 Analog connections
 - 3.4.2 g-select connections
 - 3.4.3 BDM (Background Debug Mode) connections
 - 3.4.4 Sensor Board schematics
 - 3.4.5 Button connections
 - 3.4.6 MC13191 to MC9S08QG8 microcontroller interface
 - 3.4.7 MC13191 RF interface
 - 3.4.8 Clocking options of MC9S08QG8
 - 3.4.9 LED indicators connections
 - 3.4.10 Power supply
 
 - 3.5 Bill of Materials
 
 - Chapter 4 USB stick board description
 - Chapter 5 Software Design
- 5.1 Introduction
 - 5.2 SMAC (Simple Media Access Controller)
 - 5.3 ZSTAR RF protocol
 - 5.4 STAR protocol and ZSTAR extensions (over USB)
 - 5.5 Bootloader
 
 - Chapter 6 Application Setup
 - Appendix A References
 
Software Design
Wireless Sensing Triple Axis Reference design, Rev. 0.9
36 Freescale Semiconductor
5.2.2.1  MC9S08QG8 SMAC modifications (Sensor Board)
Here the modifications of the SMAC are very minimal, since the core, peripherals and naming conventions 
are the same as in the MC9S08GB/GT code (originally in the SMAC 4.1a code).
The main changes are listed below:
drivers.c:
• void MC13192Wake (void) function not implemented, ATTN
 pin not connected to the 
microcontroller.
• void RTXENDeAssert(void) and void RTXENAssert(void) functions not implemented, 
RXTXEN pin not connected to the microcontroller.
mcu_hw_config.c:
• A set of functions 
void SetGPIO(unsigned char gpio); 
void ClearGPIO(unsigned char gpio);
void ToggleGPIO(unsigned char gpio);
added for the purpose of driving LED’s connected to the MC13191 GPIO pins.
• void UseExternalClock(void) and void UseMcuClock(void) functions not implemented, 
no external clock available to the microcontroller.
• RESET
 pin handling in void MC13192Restart(void) and void 
MC13192ContReset(void) functions omitted since the RESET
 pin is not connected to the 
microcontroller.
• RESET
, ATTN and RXTXEN pins handling in void GPIOInit(void) and void 
MCUInit(void) functions omitted since these pins are not connected to the microcontroller.
• LED toggling added into void MCUInit(void) during the waiting for MC13191 to initialize.
device_header.h:
• Several SPI, TPM and SOPT definitions added at the top of the standard <mc9s08qg8.h> header 
file.
created port_config_ZSTARQG8.h file with target specific defines (GPIO assignments, etc.)
5.2.2.2  MCHC908JW32 SMAC modifications (USB stick)
There are several modifications of SMAC required to 
1. compile for the HC08 family member MCHC908JW32
2. reflect that the MC13191 connects to the microcontroller in a slightly different way (as described in 
chapter 4.2.3 MC13191 to MCHC908JW32 microcontroller interface) - namely, MC13191’s IRQ
pin.
The 9S08 to HC908 porting required slight changes in the following files:
mcu_spi_config.c:
• void SPIInit(void) function modified to initialize the HC908 SPI module.
mcu_spi_config.h:
• SPIWaitTransferDone(), SPIClearRecieveStatReg(), 
SPIClearRecieveDataReg(), SPISendChar(u8Char) and SPIRead() macros changed to 
work with the HC908 SPI module.
