User's Manual Part 2

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.