Freescale Semiconductor, Inc... Freescale Semiconductor MC68328 Microprocessor Application: FLEX™Alphanumeric Chip MC68175 Interface for One-Way Pager by Perry Vo For More Information On This Product, Go to: www.freescale.
Freescale Semiconductor, Inc. How to Reach Us: Home Page: www.freescale.com E-mail: support@freescale.com Freescale Semiconductor, Inc... USA/Europe or Locations Not Listed: Freescale Semiconductor Technical Information Center, CH370 1300 N. Alma School Road Chandler, Arizona 85224 +1-800-521-6274 or +1-480-768-2130 support@freescale.
Freescale Semiconductor, Inc. Freescale Semiconductor, Inc... TABLE OF CONTENTS SECTION 1 INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.1 INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.2 SCOPE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.3 MC68328 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.4 FLEX PROTOCOL . . . . . . . . . . . . . . . . . . . . . . . .
Freescale Semiconductor, Inc... Freescale Semiconductor, Inc. iv FLEX Alphanumeric Chip MC68175 Interface For More Information On This Product, Go to: www.freescale.
Freescale Semiconductor, Inc. Freescale Semiconductor, Inc... LIST OF FIGURES Figure 2-1 FLEX System Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-3 Figure 2-2 Motorola FLEX Receiver Connection Diagram . . . . . . . . . . . . . . . . . 2-4 Figure 2-3 FLEX Development Board/Dragonball ADS Board SPI interface . . . 2-5 Figure 3-1 FLEX One-Way Stack Software Interfaces . . . . . . . . . . . . . . . . . . . . 3-3 Figure 3-2 FLEX Alphanumeric Chip Enabling Steps . . . .
Freescale Semiconductor, Inc... Freescale Semiconductor, Inc. vi FLEX Alphanumeric Chip MC68175 Interface For More Information On This Product, Go to: www.freescale.
Freescale Semiconductor, Inc. Freescale Semiconductor, Inc... LIST OF EXAMPLES Example 3-1 Circular Queue Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-9 Example 3-2 Function FLEX IC Handler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-11 Example 3-3 Function storeData . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-14 Example 3-4 Function FlexSPITransfer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Freescale Semiconductor, Inc... Freescale Semiconductor, Inc. viii FLEX Alphanumeric Chip MC68175 Interface For More Information On This Product, Go to: www.freescale.
Freescale Semiconductor, Inc. SECTION 1 Freescale Semiconductor, Inc... INTRODUCTION For More Information On This Product, Go to: www.freescale.
Freescale Semiconductor, Inc. Introduction INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1-3 SCOPE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1-3 MC68328 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1-3 FLEX PROTOCOL. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1-3 MC68175 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Freescale Semiconductor, Inc. Introduction Introduction 1.1 INTRODUCTION Combined with the Dragonball™ MC68328 microprocessor, FLEX™ One-way Stack software and the FLEX Alphanumeric Chip Integrated Circuit (IC) MC68175 provide a powerful solution for today’s and tomorrow’s personal portable communication devices. Freescale Semiconductor, Inc... 1.
Freescale Semiconductor, Inc. Introduction MC68175 1.5 MC68175 The FLEX one-way paging protocol is implemented in the form of the Motorola MC68175 IC. This FLEX Alphanumeric Chip signal decoder enables developers to easily incorporate wireless paging capabilities in a wide range of consumer products. It simplifies FLEX Protocol implementation in end-user products by interfacing with several off-the-shelf paging receivers and many off-the-shelf host microcontrollers/microprocessors.
Freescale Semiconductor, Inc. SECTION 2 Freescale Semiconductor, Inc... HARDWARE DEVELOPMENT For More Information On This Product, Go to: www.freescale.
Freescale Semiconductor, Inc. Hardware Development FLEX DEVELOPMENT KIT . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-3 FLEX Alphanumeric Chip Development Board . . . . . . . . . . . .2-3 FLEX Development/Receiver Board Interface . . . . . . . . . . . .2-4 FLEX Development/Evaluation Board Interface . . . . . . . . . . .2-5 SPI Interface Signals. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-5 Additional Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Freescale Semiconductor, Inc. Hardware Development FLEX Development Kit 2.1 FLEX DEVELOPMENT KIT This section briefly describes the following: the FLEX one-way pager development system; the FLEX Development Kit (FDK), including the FLEX Development Board (FDB); the receiver; and the MC68328 (Dragonball) Applications Development Board (ADB). Freescale Semiconductor, Inc... 2.1.
Freescale Semiconductor, Inc. Hardware Development FLEX Development Kit Freescale Semiconductor, Inc... Motorola Semiconductor Products Sector has a complete FLEX one-way pager solution, as described in Figure 2-1, including the FLEX Alphanumeric Chip MC68175, receivers, the MC68328 microprocessor, and LCD panels.
Freescale Semiconductor, Inc. Hardware Development FLEX Development Kit 2.1.3 FLEX Development/Evaluation Board Interface The FLEX Development Board interfaces with the MC68328 ADS evaluation board via a standard SPI. Figure 2-3 describes the hardware interface between the FLEX Development Board and the MC68328 ADS board.
Freescale Semiconductor, Inc. Hardware Development FLEX Development Kit assert the READY line low until the end of the 32-bit transfer. As an example, this pin is connected to the IRQ6 pin on the Dragonball ADS board. • SCK (JP4 Header, Pin 3) is the clock supplied by the host MPU. This input pin is connected to SPI Clock output pin on the host ADS. Freescale Semiconductor, Inc... • SS (JP4 Header, Pin 6) is used as FLEX chip select.
Freescale Semiconductor, Inc. SECTION 3 Freescale Semiconductor, Inc... SOFTWARE DEVELOPMENT For More Information On This Product, Go to: www.freescale.
Freescale Semiconductor, Inc. Software Development 3.1 3.1.1 3.1.2 3.1.3 3.1.4 Freescale Semiconductor, Inc... 3.1.5 3.2 3.2.1 3.2.2 3.2.3 3.2.4 3.2.5 3-2 FLEX SYSTEM SOFTWARE. . . . . . . . . . . . . . . . . . . . . . . . . . . .3-3 FLEX One-Way Stack Overview . . . . . . . . . . . . . . . . . . . . . . .3-3 SPI Communication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-4 Enabling the FLEX Alphanumeric Chip. . . . . . . . . . . . . . . . . .
Freescale Semiconductor, Inc. Software Development FLEX System Software 3.1 FLEX SYSTEM SOFTWARE FLEX System Software (FSS) from Motorola is a family of interoperable software components used for building products with paging/messaging capabilities. FLEX One-Way Stack, one of the software components, is specifically designed to support the integration of the FLEX Alphanumeric Chip Integrated Circuit (IC) with many off-the-shelf microprocessors. Freescale Semiconductor, Inc... 3.1.
Freescale Semiconductor, Inc. Software Development FLEX System Software 3.1.2 SPI Communication Freescale Semiconductor, Inc... The FLEX Alphanumeric Chip IC communicates with the host MCU via SPI in 32-bit packets. Each packet consists of an 8-bit ID followed by twenty-four bits of data. The FLEX IC uses SPI in Full Duplex mode; that is, for every transfer, both the FLEX IC and host MCU transmit and receive valid information.
Freescale Semiconductor, Inc. Software Development FLEX System Software Freescale Semiconductor, Inc... Upon reset or at power-up, the entire FLEX Alphanumeric Chip IC is “disabled” from sending any information except the part ID. The FLEX Alphanumeric Chip will continue to assert interrupt and broadcast the part ID until the host processor, via the interrupt service routine, recognizes the FLEX IC by sending back to the FLEX Alphanumeric Chip the proper Checksum packet.
Freescale Semiconductor, Inc. Software Development FLEX System Software RESET FLEX Alphanumeric Chip Disables Itself Freescale Semiconductor, Inc...
Freescale Semiconductor, Inc. Software Development FLEX System Software Freescale Semiconductor, Inc... FLEX Alphanumeric Chip is still in Reset or Disable mode. In this case, the product engineer should check the configuration of the SPI communication module on the host. Common faults include the SPI module not being properly enabled or not transmitting properly, the SPI baud-rate being too high, or the reset line connected to the FLEX Alphanumeric Chip being held low.
Freescale Semiconductor, Inc. Software Development FLEX System Software 3.1.5 Receiving and Processing Paging Messages FLEX One-Way Stack consists of interoperable modules that work together through a set of external and intermodule APIs. The following four modules can be found in FLEX One-Way Stack: • FLEX Driver—Directly manages the FLEX Alphanumeric Chip IC and builds raw message data from received data stream. Freescale Semiconductor, Inc...
Freescale Semiconductor, Inc. Software Development FLEX System Software Freescale Semiconductor, Inc... In the second stage, the host software periodically calls the FLEX One-Way Stack function to read data out of the circular queue. FLEX One-Way Stack then analyzes and assembles the original FLEX page and returns it to the host software. Two pointers (index variables) are used to manage the circular queue, gPackWrite and gPackRead.
Freescale Semiconductor, Inc. Software Development Porting FLEX One-Way Stack to the MC68328 MPU Figure 3-6 shows how paging messages are received and handled by FLEX One-Way Stack. Check For Paging Messages (Interrupt Timer or Polling) FLEX One-Way Stack Freescale Semiconductor, Inc...
Freescale Semiconductor, Inc. Software Development Porting FLEX One-Way Stack to the MC68328 MPU 3.2.1 Creating the SPI Driver The SPI interrupt service routines are hardware dependent and require the most porting effort. The recommended implementation code can be obtained from Motorola Semiconductor Products Sector. Product engineers should attempt to understand this code and reconfigure it according to their unique product specifications. Freescale Semiconductor, Inc...
Freescale Semiconductor, Inc. Software Development Porting FLEX One-Way Stack to the MC68328 MPU Example 3-2 Function FLEX IC Handler (Continued) Freescale Semiconductor, Inc... if (!(gFlag1 & INITCHIP)){ /* Normal mode */ if (gFlag1 & CMDOUT){ /* Send 4 bytes from the gCommand */ ptr = (UVAR8*) &data1; *ptr++ = gCmdBuffer.byte3; *ptr = gCmdBuffer.byte2; ptr = (UVAR8*) &data2; *ptr++ = gCmdBuffer.byte1; *ptr = gCmdBuffer.
Freescale Semiconductor, Inc. Software Development Porting FLEX One-Way Stack to the MC68328 MPU Example 3-2 Function FLEX IC Handler (Continued) Freescale Semiconductor, Inc... /* * This is when FLEXstack sends packets to configure FLEXchip IC. * gInitCount keeps track of the number of configuration packets.
Freescale Semiconductor, Inc. Software Development Porting FLEX One-Way Stack to the MC68328 MPU Freescale Semiconductor, Inc... Example 3-3 Function storeData /************************************************************************ * FUNCTION NAME: storeData() * * Date created: 07/26/96 * * * * DESCRIPTIONS: * * This function stores packets of information in the circular * * queue for later processing.
Freescale Semiconductor, Inc. Software Development Porting FLEX One-Way Stack to the MC68328 MPU Freescale Semiconductor, Inc... Example 3-4 Function FlexSPITransfer /************************************************************************ * FUNCTION NAME: FlexSPITransfer() * * Date created: 07/26/96 * * * * DESCRIPTIONS: * * This function performs data communication via the * * Serial Peripheral Interface (SPI).
Freescale Semiconductor, Inc. Software Development Porting FLEX One-Way Stack to the MC68328 MPU Freescale Semiconductor, Inc... Example 3-5 Function waitForTransfer() /************************************************************************ * FUNCTION NAME: waitForTransfer() * * Date created: 07/26/96 * * * * DESCRIPTIONS: * * This function checks the SPIM_IRQ bit (in the SPI status register), * * after data has been moved to the SPI data register to be transmitted * * to the FLEXchip.
Freescale Semiconductor, Inc. Software Development Porting FLEX One-Way Stack to the MC68328 MPU 3.2.2 Configuring PORT.H The PORT.H file contains most of the options and configurable items, depending on the processor type. In PORT.H, product engineers should add the definitions shown in Example 3-6 when porting FLEX One-Way Stack software to the Dragonball processor: Example 3-6 PORT.H Definitions #define DRAGONBALL Freescale Semiconductor, Inc...
Freescale Semiconductor, Inc. Software Development Porting FLEX One-Way Stack to the MC68328 MPU FStkNotifyNewMsg() Freescale Semiconductor, Inc... The FStkNotifyNewMsg() function is called each time FLEX One-Way Stack software receives a new and completed FLEX message from the FLEX Alphanumeric Chip IC. The message ID is passed to this function. Product engineers should implement this function according to the product specifications.
Freescale Semiconductor, Inc. Software Development Porting FLEX One-Way Stack to the MC68328 MPU Send_4_bytes() supervises the interrupt process and will terminate after the transfer is completed. Example 3-8 Function Send_4_bytes() Sample void Send_4_bytes (void) { BCLR(gFlag1, XFERDONE_f1); Freescale Semiconductor, Inc...
Freescale Semiconductor, Inc. Software Development Porting FLEX One-Way Stack to the MC68328 MPU 3.2.4 Setting up Initialization Buffer Freescale Semiconductor, Inc... The host software must provide initialization data to the FLEX One-Way Stack software in a predefined format for the software for configure the IC after enabling it. The initialization buffer is set up by function BuildInitBuffer(), as illustrated in Example 3-10.
Freescale Semiconductor, Inc. Software Development Porting FLEX One-Way Stack to the MC68328 MPU Freescale Semiconductor, Inc... Example 3-10 Function BuildInitBuffer() (Continued) /* Create FLEXstack Driver Initialization module */ ptr1 = (FS_DRIVER_STRUCT *) _malloc((UVAR32)sizeof(FS_DRIVER_STRUCT)); ptr1->fs_driver_hdr.size = sizeof(FS_DRIVER_STRUCT); ptr1->fs_driver_hdr.flag = 0; ptr1->fs_driver_hdr.type = 1; ptr1->fs_driver_data.msgStorSize = STATUS_TABLE_SIZE; ptr1->fs_driver_data.
Freescale Semiconductor, Inc. Software Development Porting FLEX One-Way Stack to the MC68328 MPU Example 3-10 Function BuildInitBuffer() (Continued) Freescale Semiconductor, Inc... /* Create Message Filter Module */ ptr4 = (FILTER_STRUCT *) _malloc((UVAR32)sizeof(FILTER_STRUCT)); ptr3->mmlite_hdr.next = (UVAR8*) ptr4; ptr4->filter_hdr.size = sizeof(FILTER_STRUCT); ptr4->filter_hdr.flag = 0; ptr4->filter_hdr.type = 4; ptr4->filter_data.
Freescale Semiconductor, Inc. Software Development Porting FLEX One-Way Stack to the MC68328 MPU Freescale Semiconductor, Inc...
Freescale Semiconductor, Inc. Software Development Porting FLEX One-Way Stack to the MC68328 MPU 3.2.5 Retrieving Paging Messages from FLEX One-Way Stack This section illustrates sample code acting as the host software running on the MCU. When FLEX One-Way Stack software has a new paging message in the buffer, the main () and GetPage functions retrieve the message and display it to the user. These functions also illustrate the API provided in the software. Function main () code is shown in Example 3-11.
Freescale Semiconductor, Inc. Software Development Porting FLEX One-Way Stack to the MC68328 MPU Example 3-11 Function main() (Continued) Freescale Semiconductor, Inc... /* Prepare the initialization buffer */ BuildInitBuffer(); /* * Initialize FLEXstack - init_buffer is the pointer to the * beginning of the initialization buffer. */ FStkInit(init_buffer); /* * Poll FLEXstack for new messages. Programmer can also uses * timer interrupt to call FLEXstack function periodically * for new message.
Freescale Semiconductor, Inc. Software Development Porting FLEX One-Way Stack to the MC68328 MPU Example 3-12 Function GetPage (Continued) /* Read the first message specified in the table */ handle = (UVAR8*) FStkOpen(msgid, (UVAR8)FILTERED); Freescale Semiconductor, Inc...