AN2757 Freescale Semiconductor / Motorola, AN2757 Datasheet

no-image

AN2757

Manufacturer Part Number
AN2757
Description
MPC5200 Quick Start
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
Freescale Semiconductor
Application Note
1
This application note describes the “MPC5200_Quick_Start” environment for creating non-
operating system applications for the Freescale Semiconductor, Inc. (formerly Motorola)
MPC5200 device. The environment includes also an easy-to-use Graphical Configuration
Tool (GCT) which simplifies definition of the startup configuration of the MPC5200 on-chip
peripherals.
A current version of the Freescale (formerly Motorola) MPC5200_Quick_Start tool is
primarily designed for and is integrated with Metrowerks CodeWarrior development tools.
There are more tools likely to be supported in the future; see the RELEASE_NOTES.txt file
for the up to date list of tools supported by the latest release. In this document, it is assumed
the user is already familiar with the target development environment.
All MPC5200 embedded-side code was tested with the Metrowerks CodeWarrior MGT
Edition Version 8 and the Freescale (formerly Motorola) Lite5200 (IceCube) evaluation
board.
1.1
The MPC5200_Quick_Start is composed of the following components:
© Freescale Semiconductor, Inc., 2004. All rights reserved.
Framework for creating MPC5200 non-operating system applications
— CodeWarrior Project Stationery (project templates)
— Startup code enabling boot-from-flash standalone operation of Lite5200
— Linker command files for various targets (debugging, standalone,...)
— Interrupt Dispatcher with the support of GCT
Graphical Configuration Tool
— Easy-to-use Windows-based application
— All MPC5200 modules supported except USB (to be supported in future)
— A graphical representation of all control bits and bit-fields of supported
— Generates constants to be directly written to the MPC5200 control registers
MPC5200 Peripheral Modules Initialization Code
— Applies GCT-created configuration to the MPC5200 peripheral registers
— Optionally initializes the MPC5200 device before the main() is entered
Introduction
Features
peripheral modules
Topic
Section 1 Introduction .........1
Section 2 Installation...........2
Section 3 Your first “Hello
Section 4 MPC5200 Quick
Section 5 Application
Section 6 Graphical
Section 7 Module Initialization
Section 8 Sample
Section 9 MPC5200 BSP..44
Section 10 Conclusion ......45
World” application..............3
Start Projects.....................5
Framework .........................9
Configuration Tool............15
Code ................................42
Applications .....................43
Table of Contents
Rev. 1, 08/2004
AN2757
Page

Related parts for AN2757

AN2757 Summary of contents

Page 1

... MPC5200 Peripheral Modules Initialization Code — Applies GCT-created configuration to the MPC5200 peripheral registers — Optionally initializes the MPC5200 device before the main() is entered © Freescale Semiconductor, Inc., 2004. All rights reserved. AN2757 Rev. 1, 08/2004 Table of Contents Topic Page Section 1 Introduction .........1 Section 2 Installation...........2 Section 3 Your first “ ...

Page 2

... Click on the “Choose” button and locate the “src” folder in the MPC5200_Quick_Start installation directory. This can be for example the “C:\Program Files\Freescale (formerly Motorola)\MPC5200_Quick_Start r1.0\src” 6. Click the “Add” button, the path specified above should be added to the list. 7. Click “OK” to finish AN2757 MPC5200 Quick Start and Graphical Configuration Tool 2 Figure 1. Freescale Semiconductor ...

Page 3

... When a new project is loaded into the CodeWarrior workspace, double click the “main.c” file item in the project tree to open the file in the editor window. A typical “Hello World” application code is prepared by default AN2757 MPC5200 Quick Start and Graphical Configuration Tool Freescale Semiconductor Figure 2. CodeWarrior Project Stationery Your first “ ...

Page 4

... MPC5200 Peripheral clock would run on frequency the “Hello World” application is not aware of. In that case a serial baud rate of the PSC1 interface would not match the COM port settings side and no output would be displayed on a console window. AN2757 MPC5200 Quick Start and Graphical Configuration Tool 4 Figure 3. Quick Start Project Templates (Figure 5) ...

Page 5

... DMA_ImageRtos2 - same as the one above except that the “RTOS2” image is used. This image contains slightly modified set of DMA tasks. See BestCommAPIUserGuide.pdf document for more details about the RTOS1 and RTOS2 images. AN2757 MPC5200 Quick Start and Graphical Configuration Tool Freescale Semiconductor MPC5200 Quick Start Projects ...

Page 6

... Code Execution From SDRAM only ramdebug.elf / Executable Name ramdebug.mot Entry Point __start Prefix File Macro TARGET_RAMDEBUG AN2757 MPC5200 Quick Start and Graphical Configuration Tool 6 NOTE Section 6.4, GCT Options for more details. RAM Debug ROM Image Set up by firmware Not required (can be used ...

Page 7

... The “Target Memory Buffer Address” and “Size” define the RAM memory area used by the Flash Programmer for its operation. Note that addresses loaded from “flash_prog.xml” configuration file specify a post-reset location of the MPC5200 Static RAM memory, which is always valid and there is no need to use SDRAM memory. AN2757 MPC5200 Quick Start and Graphical Configuration Tool Freescale Semiconductor later in this document. ...

Page 8

... The s-record file can be examined with a text editor - the last S3-record gives an information about how long the image is (see the “Hello World” application created in AN2757 MPC5200 Quick Start and Graphical Configuration Tool 8 (Figure 7) shows the type and address of the Flash device to (Section 5 ...

Page 9

... In the CodeWarrior project tree window, a project can be seen logically divided into a tree-like structure of virtual “folders” and project files (Figure 10). The following subsections will describe each project item in detail. AN2757 MPC5200 Quick Start and Graphical Configuration Tool Freescale Semiconductor Application Framework 9 ...

Page 10

... In MPC5200_Quick_Start, there is a separate Linker Command File for each project target. All Linker Command Files are located in the SystemConfig sub-directory of the project folder on the disk. In each target, the file defines the location of the exception AN2757 MPC5200 Quick Start and Graphical Configuration Tool 10 Figure 10 ...

Page 11

... Flash memory space range 0xFF000000...0xFFFFFFFF; initializes SDRAM controller for 64MB RAM memory starting at address 0x00000000 and enables the PowerPC Core time-base counter (TB special purpose register). AN2757 MPC5200 Quick Start and Graphical Configuration Tool Freescale Semiconductor Section 4.3.1, Lite5200 Boot Process Figure 11 ...

Page 12

... In the MPC5200_Quick_Start, the __pre_main() function can be configured by Graphical Configuration Tool to perform automatic initialization of MPC5200 peripheral modules before the main() function is entered. AN2757 MPC5200 Quick Start and Graphical Configuration Tool 12 for more details. ...

Page 13

... In addition to several system files, there is a pair of “.c” and “.h” files for each MPC5200 peripheral module. The following table briefly describes the content of the “QS” source files. AN2757 MPC5200 Quick Start and Graphical Configuration Tool Freescale Semiconductor Section 4.2, Project ...

Page 14

... Serial Peripheral Interface support Placeholder for the future USB support implementation. USB is not supported by the qs_usb.h, qs_usb.c current version of qs_xlarb.h, qs_xlarb.c XLB Arbiter Module support AN2757 MPC5200 Quick Start and Graphical Configuration Tool 14 Table 2. Quick Start Source Files Description MPC5200_Quick_Start environment. MPC5200_Quick_Start ...

Page 15

... Click on button on the right hand side of the “Execute” edit box and browse for the “gct5200.exe” GCT executable. E.g. “C:\Program Files\Freescale (formerlyMotorola)\MPC5200_Quick_Start\config_tool\gct5200.exe”. AN2757 MPC5200 Quick Start and Graphical Configuration Tool Freescale Semiconductor Section 5.3, Startup Code, the GCT can be also used to select MPC5200 Figure 13 ...

Page 16

... Above the tree view on the left hand side, there is a brief summary of the key system clocks as configured in the current project. See Section 6.6.1, Clock Distribution Module (CDM) Figure 14. Graphical Configuration Tool, CDM Control Page AN2757 MPC5200 Quick Start and Graphical Configuration Tool 16 for more details about setting system clocks. Freescale Semiconductor ...

Page 17

... Figure 15. GCT-Saved Configuration (CDM Module) 6.4 GCT Options The “File / Options...” menu in the GCT opens the “Configuration Tool Options” dialog with a few settings controlling the “appconfig.h” file output. AN2757 MPC5200 Quick Start and Graphical Configuration Tool Freescale Semiconductor Graphical Configuration Tool 17 ...

Page 18

... MPC5200 Pinout Page When the GCT is started, the “MPC5200 Pinout” page is displayed, showing the schematic part-like view of the processor. AN2757 MPC5200 Quick Start and Graphical Configuration Tool 18 Figure 16. GCT Options Figure 15 above ...

Page 19

... The control page of the Clock Distribution Module (CDM) is displayed above in physically set only by installing electrical switches (jumpers) on the MPC5200 board. The GCT displays such settings grayed and AN2757 MPC5200 Quick Start and Graphical Configuration Tool Freescale Semiconductor Figure 17. MPC5200 Pinout Page Section 6 ...

Page 20

... MPC5200 Peripheral Base Address register (MBAR), PowerPC Core interrupts in the MSR register, Memory Management Unit operation in the MSR and IBAT/DBAT registers, cache control in the HID0 register and other miscellaneous settings in the HID0 and HID2 registers. AN2757 MPC5200 Quick Start and Graphical Configuration Tool 20 (Figure 18) ...

Page 21

... SDRAM Controller page). GCT strictly follows the structure of MPC5200 peripheral modules - control registers from different peripheral modules are never mixed on a single page. The use of hypertext links is a convenient way how to display a logical connection between separate peripheral modules. AN2757 MPC5200 Quick Start and Graphical Configuration Tool Freescale Semiconductor Figure 19. G2 PowerPC Core Control Page ...

Page 22

... MPC5200 board (“Boot CS” settings in this case). Similarly as on the CDM page, the user must knowingly enable modifying of the hardware-controlled configuration items. AN2757 MPC5200 Quick Start and Graphical Configuration Tool 22 (CDM)), the LPC Chip Selects control page displays the settings controlled by a ...

Page 23

... Slice Timers • Real Time Clock As there are no settings related to the SIM module as a block, the control page does not contain anything but links to the control pages of individual sub-modules. AN2757 MPC5200 Quick Start and Graphical Configuration Tool Freescale Semiconductor Graphical Configuration Tool 23 ...

Page 24

... Using another check-box, a support for Floating Point context saving can be enabled in the Interrupt Dispatcher. A Floating Point context save can then be selectively enabled for individual peripheral interrupt service routines AN2757 MPC5200 Quick Start and Graphical Configuration Tool 24 Section 5.4, Interrupt Dispatcher) ...

Page 25

... As the Peripheral Interrupt decoder operates as a client to both Main Interrupt decoder and Critical Interrupt decoder, the priority selection of each Peripheral source also defines whether the Main interrupt source (LO_int) or Critical Interrupt source (HI_int) will be used by the peripheral source. AN2757 MPC5200 Quick Start and Graphical Configuration Tool Freescale Semiconductor Graphical Configuration Tool ...

Page 26

... This is why the check-boxes at those pages are disabled and the pages can not be selectively excluded or included in the “appconfig.h” output. AN2757 MPC5200 Quick Start and Graphical Configuration Tool 26 “appconfig.h”). The rest of GPIO pages are a “display-only” and their graphical ...

Page 27

... GPT control page. Any changes made in the interrupt controller settings on this page will be automatically displayed also on the Main Interrupt Controller control page and vice versa — see AN2757 MPC5200 Quick Start and Graphical Configuration Tool Freescale Semiconductor Graphical Configuration Tool Section 6 ...

Page 28

... There is one Real Time Clock (RTC) module on the MPC5200. The configuration page enables complete RTC configuration, specifying post-reset initial timer value as well as assigning the RTC interrupt service routines. AN2757 MPC5200 Quick Start and Graphical Configuration Tool 28 Figure 27. Slice Timer Control Page (SLT) ...

Page 29

... GPIO port multiplexer settings. In most cases, the warning message contains also hypertext link or links which activate the GCT page where a change is needed or an attention is required. AN2757 MPC5200 Quick Start and Graphical Configuration Tool Freescale Semiconductor Figure 28 ...

Page 30

... Graphical Configuration Tool Figure 29. Programmable Serial Controller (PSC), UART Mode The next Figure 30 shows the PSC control page in Codec (I2S) and AC97 modes. AN2757 MPC5200 Quick Start and Graphical Configuration Tool 30 Freescale Semiconductor ...

Page 31

... Like many other peripheral modules, each PSC contains a FIFO to enable buffered data operation and BestComm DMA access. There is a sub-page under each PSC module page which contains a graphical controls to set up a FIFO parameters AN2757 MPC5200 Quick Start and Graphical Configuration Tool Freescale Semiconductor ...

Page 32

... There are two I2C Bus Controllers on the MPC5200. Like for many other modules, the GPIO port multiplexer should be set properly for the I2C module. The red message displays hypertext warning when the port multiplexer is not configured well for the I2C operation. Figure 32. I AN2757 MPC5200 Quick Start and Graphical Configuration Tool 32 Section 7, Module Initialization 2 ...

Page 33

... All important time-quanta portions and sampling points are also drawn on a time-graph which is displayed together with the numeric parameter values. AN2757 MPC5200 Quick Start and Graphical Configuration Tool Freescale Semiconductor Graphical Configuration Tool ...

Page 34

... There is also a way how to specify initial values of the custom PHY registers not defined by the IEEE standard, for example the LED control registers of the Intel LXT971 used on the Lite5200 board. AN2757 MPC5200 Quick Start and Graphical Configuration Tool 34 ...

Page 35

... With the support of GCT-generated values, the MPC5200_Quick_Start ATA initialization code is capable to detect the ATA Hard Drives and to initialize automatically the best timing parameters suitable for both drives (or single drive) connected. AN2757 MPC5200 Quick Start and Graphical Configuration Tool Freescale Semiconductor Graphical Configuration Tool ...

Page 36

... There is a PCI Local Bus Interface bridge on the MPC5200. The GCT Control Page can be used to configure both the standard PCI Configuration Space of the MPC5200, accessible by the PCI slave devices, as well as internal parameters and PCI memory windows used by the MPC5200 system code to access the PCI devices. AN2757 MPC5200 Quick Start and Graphical Configuration Tool 36 Freescale Semiconductor ...

Page 37

... BestComm Graphical Configuration Tool for the current project. The second page can be used to define task priorities and to configure a priority control. AN2757 MPC5200 Quick Start and Graphical Configuration Tool Freescale Semiconductor Graphical Configuration Tool Section 9, MPC5200 BSP ...

Page 38

... When modified, the database can be updated with a new values. A database is saved as a standard “INI” file named “sdram.ini” located in the “sdram” sub-directory of the GCT application folder. An advanced user can use a text editor to modify or to add new entries to the database. AN2757 MPC5200 Quick Start and Graphical Configuration Tool 38 Freescale Semiconductor ...

Page 39

... There is no way to rename an existing memory configuration or to add a new clock speed entry to the list of supported speeds once the configuration is created. The only way how to manage the database is editing the database “sdram.ini” file. AN2757 MPC5200 Quick Start and Graphical Configuration Tool Freescale Semiconductor Figure 40 ...

Page 40

... GPIO port multiplexer to be configured already. The rest of MPC5200 modules not initialized by the __pre_main() code can still be initialized “manually” any time in the main() function or other user code. The initialization calls are described in the AN2757 MPC5200 Quick Start and Graphical Configuration Tool 40 Figure 41. SDRAM Memory Configuration ...

Page 41

... MPC5200 as a whole to be completely unusable in the application. The Register View window can be activated or deactivated by a menu “View / Register Summary”. AN2757 MPC5200 Quick Start and Graphical Configuration Tool Freescale Semiconductor Graphical Configuration Tool ...

Page 42

... Quick Start platforms (Freescale (formerly Motorola) 56F800/E). The list of initialization commands to be used with the ioctl() system call can be found in the command accepts the “parameter” value so the NULL value can be used. AN2757 MPC5200 Quick Start and Graphical Configuration Tool 42 Figure 43. Register Summary View Table 3 below ...

Page 43

... USB USB_INIT XLARB XLARB_INIT 8 Sample Applications AN2757 MPC5200 Quick Start and Graphical Configuration Tool Freescale Semiconductor Table 3. Module Initialization Commands Initializes the ATA Controller (GPIO_INIT must be called before this command) Initializes the PowerPC MSR register content, except the MMU and Interrupt-related bits Initializes the exceptions-related bits in the MSR core register Initializes the Memory Management Unit registers (i ...

Page 44

... The following table summarizes the features of the BSP and shows the items reused by the MPC5200_Quick_Start applications. All BSP code is installed in the “support\bsp” sub-directory of the MPC5200_Quick_Start source (“src”) folder. AN2757 MPC5200 Quick Start and Graphical Configuration Tool 44 Table 4. Sample Applications ...

Page 45

... The integration with and the support of the CodeWarrior Development Environment significantly reduces the code-debug-deploy loop as compared with other environments. On the other side subject of future MPC5200_Quick_Start development to widen the set of supported tools and platforms. AN2757 MPC5200 Quick Start and Graphical Configuration Tool Freescale Semiconductor Table 5. BSP Features ...

Page 46

... 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. 2004. All rights reserved. AN2757 Rev. 1 08/2004 ...

Related keywords