Home
CodeWarrior Development Studio Processor Expert User Guide
Contents
1. Chapter 3 Application design 3 3 4 4 Timing model A component timing can be viewed like a chain of elements such as dividers and multipliers between the main clock source and the device configured by the component You can set the desired timing value using the Timing dialog see Dialog for timing settings topic for details or directly by specifying the value in Component Inspector see Syntax for the timing setup in the Component Inspector topic for details Processor Expert tries to configure individual elements in the timing chain to achieve the result and the user is informed if it was successful After leaving the Timing dialog the real value of the timing is shown in the third column of the component inspector 3 3 4 2 Timing setup problems The errors are reported in red in the Timing dialog or in the timing property line in the Component Inspector The error summary is available in the Error window Follow the error message text to find the source of the problem If no error is reported it means that Processor Expert can achieve the desired timing for all components in the project Common problems that make impossible to set a timing value It is impossible to set some item s This problem is reported in the component or the Timing dialog and the user is informed which value has incorrect value The reason is usually the hardware structure and limitations of the processor T
2. Others free Table legend Blocked Device might not be directly used by the component but it cannot be used shared by other components because it would disrupt the components function Used Device is required and used by the component Free Device is not used nor blocked by the component so it can be used by another component 3 4 7 1 4 How to use the table The table allows to find which components in which setup can share the timer peripheral The following rule determines the condition necessary for sharing When you take the rows of table corresponding to the components and their configurations you want to use every column containing Used value must contain Free in all other rows it cannot be used or blocked In case of the individual channels there has to be enough channels for all components Note that if a component allocates some channels it is possible to share the timer among several components of the same type for example TimerInt using the TIMxy device CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 139 Implementation details 3 4 7 1 5 PWM sharing limitation There are some limitations for the PWM component if it shares the timer peripheral with other devices The PWM in this case uses the whole range of the counter i e the modulo register is not used so the period values are limited to the value s determined by the
3. 93 EXAMEN cuu c a EE a R ENA NIATE AREARE AERE RENN RN 94 3 3 3 Design time checking conseguenegs atid benefit iuissscasenss ensi tre HE piriana iinan i oneek iiidaininia 95 EXC MERECE erra ed D S DIL SL 95 sumo E A E N E E E E E N A E Pea biet Eenieds 96 XC Lun eet Rr RE 96 EX MMC CER E E 96 3220 Tub RN oscar geod ee ss p tay tee tae aeu atcp C und i sed cm epp ah cis cant ipd 96 px MEN I TRIE mE 96 Jaha Taine neci dila eme puaiac aniecolaosaplusaiao E A 97 2 54 Ruime nmng segs mataia n a QU Mprdla dapi Gic daus bt donata bib rded 98 pur libi 98 3 3 5 Creatine user component tert plil s ure cere teeth Reuse tt teda DUM Red Re otis sae ase RU pA UR tpU LE EUR raid 98 AJ Creating and savine templ EE uota e cbeR eo EA R PUER Uo Eo ine HEDA OR M ANA FeDH SH Ut UE PEDE 98 Lio SENA AE eT 99 2301 E e E A E E E E E P de qui Miete ni i diae 99 320362 Doumea Om isitniti oa ai Ube eak ESENE ESen Eka ANAKE EENE ii 100 33 1 Component inberitance and component Sharing naniesienia deea aa e a A 101 Sul MEME a a E mane ciaasiuniasiess 101 LES MED P A Processor EPE ann a E A RNE 101 Iara Comnpon ne T a E AN 102 CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 7 Section number Title Page prac MEC DICE Processor EX GOT M A SAS 102 20055 RUBRO resources MOCO erasoan Duke e ia E E iuit prd dev REEE EESE
4. Peripherals Init h the file contains Peripherals Init method declaration e PDD Includes h the file includes all PDD modules supported for selected processor Intended to be included in the application code to access PDD macros For more information on PDD see Physical device drivers pE_Types h the file contains common Processor Expert types constants and macros implementation e be Error h the file contains error code constants Processor Expert static code repository at CodeWarrior Processor Expert lib Processor family pdd2 Processor system Project static code repository at project static_Code system Generated modules vectors Config h configuration header file contains vectors c module parameterization constants tnit_Config h the file includes all components configuration and interface header files Generated modules are placed at project Generated_cod CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 176 Freescale Semiconductor Inc EE Chapter 3 Application design 3 10 10 Processor Expert static code repository and project repository synchronization During project creation In the Standalone project mode the static source modules are copied from Processor Expert common static code repository to the project repository placed in static_code project directory This secures project code independence However Processor Expert detects changes be
5. Freescale Semiconductor Inc 137 eee SSS Implementation details TPM for example TPM Whole timer including all channels and control registers Sometimes the x is omitted if there is only one such timer on the chip This device blocks all other devices defined for this timer TPMXxy for example TPM1 Channel y of the timer x Sometimes the x is omitted if there is only one timer on the chip TPMx_PPG for example TPM_PPG Whole timer in a programmable pulse generation mode Sometimes the x is omitted if there is only one timer on the chip TPMxPP for example TPMPP Modulo register of the timer in a programmable pulse generation mode Sometimes the x is omitted if there is only one timer on the chip TPMXxyPPG for example TPMPPG Channel y of the timer x in the programmable pulse generation mode Sometimes the x is omitted if there is only one timer on the chip TPMXxfree for example TPMfree This device represents the overflow flag and interrupt capabilities of the counter The range is of the counter is not limited and it is determined by the size of the counter register so the timing is controlled only by the prescaler selection Sometimes the x is omitted if there is only one timer on the chip NOTE Even though the multiple devices defined for a timer are configured independently they can be mutually dependent For example they share one common prescaler Processor Expert instantly
6. Processor Expert static code repository CodeWarrior Processor Expert lib Processor family pdd2 Processor system Project static code repository Project Static_Code System Generated modules e cPU Config h configuration header file contains ceu 1nic c module parameterization constants Processor component name c the file contains Common Init and Components Init methods For more details see Reset Scenario topic of Implementation details about these generated methods Processor component name h the file contains declaration of Common Init and Components Init along with clock configuration constants Generated modules are placed in the project Generated_Code 3 10 7 Peripheral initialization component files Static modules Peripheral Init c the file contains peripheral initialization method Peripheral _Init h the file contains peripheral initialization method declaration Processor Expert static code repository CodeWarrior Processor Expert lib Processor family pdd2 Processor peripherals Project static code repository project static_Code Peripherals Generated modules Peripheral Config h configuration header file contains peripheral _tnit c module parameterization constants The constants reflect settings of the Embedded Component Initialization component name h application interface header file Intended to be included in the application code to map user defin
7. Section number Title Page 3224 Chanine UII 74 22 09 Processor component variantes seletuse nn E ea EEEa 74 pes Compiler sel NOn aight city cava fsllus sce E E E blu die cecues ad tebavsans 76 Sot Processar Properes OEV ON MM 76 3 22 8 Jpeed modes SUPPO al seca snsss ance cisurmoceisiannuialbianeildsdaconeoumemndeuaradeabseraddedasaucupitbunddadssabeapibuddelesies TI 12 81 Syitcbing speed modes at Tumime sieaa e pst c c E Da Red Rn Aud 78 3 2 2 8 2 Speed modes support in Components sessirnir niine niii 78 Aum Clopkgonhewranons PPAF esiri ie e lapi ride 19 LAO MERCED ui E 19 3 28 32 Multiple clock configuration 5 54 casei aeidelorajastantansanseabautducaianiotaecapaaiaiases 80 Cows mox Clock Configuration T iaaa 83 3 2 2 8 3 4 Support of clock configurations in embedded components 83 Ex M Conieunng COMP OTER Be TT 86 Sal Taempana E me mU 86 SOLI interrupts usage m components generated COGS 22 jcccssevescascssaexceantesaseecadoanessassesscccasesasiecinscetscasecnsce 87 ee cee MTU SOUR ia is ct 87 SoS nico Grek caldi d EE Ee Ne RUM m 88 ES RECTUS Uu ERE m 88 Als Processor Exp rt pony EORIBEIL i epa sd epos peii donde OM DMpt An cab ttum caduca DR etu Lie edt C ac R nb xt adt 88 LENS EMEMEI I n CUSTO oL OS Emm 89 3 3 1 5 2 Version specific information for HCS08 derivatives with IPC Interrupt Priority oriri em rM T A 89 3 3 1 5 3 Version sp
8. Source File Name Common repository file name including full path Action Action to be performed CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 177 a Static code support in Processor Expert Project File Name Project repository file name including path in the project directory e Status Description of detected modification Static file status can be e Source file changed Changes detected in the common repository file No more needed File has been removed from common repository Modified by the user Project repository file has been modified Project file not found New file in common repository was found or project repository file has been removed Up to date No difference between source and project file detected Showed only during synchronization forced by Synchronize Processor Expert Static Code command Available actions Update Do not update Update common repository file or leave it unchanged Create Do not create Copy file from common to project repository or don t copy it Delete Do not delete Remove file from project repository or keep it No action No action needed Showed only during synchronization forced by Synchronize Processor Expert Static Code command in case that there is no difference between source and project file Up to date status Compare file by content If difference between common and proje
9. src remain intact Help on component Opens help information for the selected component CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 37 Components Library view Sy Components Library i5 IHE Categories Alphabetical Assistant Processors gt Component Component Level H E CPU Internal Peripherals Logical Device Drivers gt Communication Converter i Logical Device Driver 3 IN DAC LDD Logical Device Driver amp Display LCDC LDD Logical Device Driver SegLCD LDD Logical Device Driver DMA E Human Interface Measurement v E No project focused filtering disabled Figure 2 7 Component Library view 2 3 4 Component Assistant The Component Assistant is a mode of Components Library view It guides you during the selection of components that is basic application building blocks You will have to answer a series of questions that finally lead to a selection of a component that suits best for a required function In this mode the Components Library view consists of the following parts e History navigation buttons and the history line showing answers for already answered questions You can walk through the history using the arrow buttons or by clicking the individual items A box with a current question A list of available answers for the current question If the answer already corresponds to a sing
10. A signal name can be assigned to an allocated pin by specifying the signal name into the appropriate property for example pin signa1 in the Component Properties available in Advanced view mode Signal name is an identifier that must start with a letter and rest of the name must contain only letters numbers and underscore characters For the components that allocate a whole port such as ByteIO there are two options CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 99 A Configuring components e Assign a same signal name to all pins of port by writing the name into the Port signal property Processor Expert automatically assigns this name extended with a bit number suffix to each of the individual pins e Assign a different signal names to individual pins by writing pin signal names from the lowest bit to the highest one separated by commas or spaces into the Port signal property Properties Methods Events Component name Byte1 Port PTA PTA Port signal X Y Ledi Led2 Led3 Pull resistor autoselected pull no pull resistor Figure 3 13 Signal names list for a port 3 3 6 2 Documentation Processor Expert automatically generates a document projectname _SIGNALS txt or projectname SIGNALS doc containing a list of relationship between defined signals and corresponding pins There is an additional signal direction information added next to each
11. If a peripheral is shared by several components for example several components may use single pins of the same port the icon is displayed NOTE Some peripherals work in several modes and these peripherals can be represented by a several devices in the processor databases For example the device rinerx prc and vrimerx pwm represents TimerX in the PPG and PWM mode These devices can be displayed on the processor package but they are also represented as a single block in the microcontroller block diagram 2 5 1 4 1 Peripheral or Pin Pop up Menu The following commands are available in the pop up menu Show Peripheral Initialization shows initialization values of all control status and data registers This option is supported for all devices displayed on a processor package See Configuration Registers view topic for details Zoom in Increases the detail level of the view The whole picture might not fit the viewing area Zoom out Decreases the size of the picture and detail level of the view Rotate Rotates the package by 90 degrees Pin Functional Properties This command is supported only if PinSettings component is supported for the selected processor It adds PinSettings component if CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 58 Freescale Semiconductor Inc E7 Chapter 2 User interface it is not added in the project It allows you to configure Pin Functional Properti
12. Power mode Power saving Pass through mode Disabled Hysteresis 0 Figure 3 38 Example of component linking in AnalogComp LDD Figure shows ana1ogcomp rp component that uses pin as positive input and internal signal from 12 bit D A converter DAC output as negative input Selection of internal signal causes that Source component property from the negative input group is active and DAC component is required User may add new DAC component rac rp Or rnit rac in this case or use pac component already present in the project component DAT CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 185 Internal signals CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 186 Freescale Semiconductor Inc Chapter 4 Processor Expert tutorials This tutorial is provided for embedded system designers who wish to learn how to use the features of Processor Expert This tutorial will help you to start using Processor Expert for your own application This chapter explains Tutorial project 1 for Kinetis microcontrollers 4 1 Tutorial project for Kinetis microcontrollers This simple tutorial describes a periodically blinking LED project The LED is connected to one pin of the CPU and it is controlled by a periodical timer interrupt The project is designed to work with PK60N512 CPU and TWR K60N512 tower board However it is not necessary to
13. Table continues on the next page CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 45 Component Inspector view Table 2 2 Inspector item types continued a Cs S o S String list Clicking the browse button opens the simple text editor that allows to enter an array of text lines Time Date Allows to setup the Time Date in a format according to the operating system settings Timing settings Allows a comfortable setting of the component s timing The timing dialog opens on clicking on browse button See Dialog for timing settings topic for details 2 4 6 Items visibility Processor Expert supports selectable visibility of the component items Each item is assigned a predefined level of visibility Higher visibility level means that items with this level are more special and rarely used than the others with the lower visibility level Component Inspector displays only items on and below the selected level It could help especially beginners to set only basic properties at first and do optimization and improvements using advanced and expert properties or events later There are three visibility levels e Basic view The key and most often used items that configure the basic functionality of the components e Advanced view All items from Basic view and the settings that configure some of more advanced and complex features of the compone
14. view mode switching These options have the same meaning as the view mode buttons Ignore Constraints and non Critical Errors this option enables a special mode of Processor Expert In this mode Processor Expert allows you to generate output files even though some settings may break some constraints or limits and errors are reported Expand All if a group is selected expands all items within the selected group Otherwise all groups in the Inspector are expanded If the expanded group contains any groups that are disabled gray the user is asked if the disabled groups should all be expanded Collapse All if a group is selected collapses all items within the selected group Otherwise all groups in the Inspector are collapsed Help on Component shows a help page for the component Save component settings as template creates a template for the current component settings See Creating user component templates topic for details Edit comment when comment is empty icon appears gray If you have entered the comment icon appears yellow on the toolbar The comment is displayed in tooltip for the current component or configuration For example you can enter the note for the CPU component such as Please do not enter value more than 25MHz in Clock settings These comments are added in the generated source file cpu n file Open pinned view opens a copy of the inspector for currently selected component This command allows to have
15. 2 System timing is configured according to new clock configuration including reference clock source selection clock generator modules and system dividers 3 All LDD components which support clock configuration feature are called to configure their underlying peripherals global internal rp setciockconfiguation method is invoked which in return invokes internal setclockconfiguration method of the LDD components CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 82 Freescale Semiconductor Inc E Chapter 3 Application design Note that during the transition period glitches at the peripheral outputs may occur Therefore it is recommended to temporarily disable the peripherals before the clock configuration is switched to prevent any unpredictable behavior 3 2 2 8 3 3 Clock Configuration 0 Unlike other clock configurations Clock Configuration 0 has some specific features Clock Configuration 0 is always in the project Each project has to have at least one clock configuration e Application execution always starts in the Clock Configuration 0 Before main o function execution starts startup code of Processor Expert initializes the system timing according to settings of this clock configuration All Peripheral Initialization Components timing settings relates to Clock Configuration 0 see Levels of abstraction topic Because multiple clock configurations are not supported in initialization co
16. For more details on timing configuration see Timing settings topic 2 4 8 Configuration Inspector Configuration Inspector is a variant of an inspector window It shows the settings that belong to selected component It could be invoked from configurations pop up menu in the Components view click on a configuration with the right button and choose the Configuration Inspector For details on configurations see Configurations topic 2 4 8 1 Properties The Properties tab contains optimization settings related to the configuration These settings should be used when the code is already debugged It could increase speed of the code but the generated code is less protected for the unexpected situations and finding errors could be more difficult Note that some of the options may not be present for all Processor Expert versions CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 53 Processor view Ignore range checking This option can disable generation of the code that provides testing for parameter range If the option is set to yes methods do not return error code err_vazue neither err_rance If the method is called with incorrect parameter it may not work correctly Ignore enable test This option can disable generation of the code that provides testing if the component peripheral is internally enabled or not If the option is set to yes methods do not return e
17. RegName BitName Inverts the bit 3 8 5 5 Access to named groups of bits testReg w BitGroup RegName GroupName Tests a group of the bit for non zero value getReg w BitGroupVal RegName GroupName Reads a value of the bits in group setReg w BitGroupVal RegName GroupName GroupVal Sets the group of the bits to the specified value RegName Register name CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 168 Freescale Semiconductor Inc Chapter 3 Application design BitName Name of the bit GroupName Name of the group BitMask Mask of the bit BitsMask Mask specifying one or more bits BitsVal Value of the bits masked by BitsMask GroupMask Mask of the group of bits GetMask Mask for reading bit s ClrMask Mask for clearing bit s SetMask Mask for setting bit s InvMask Mask for inverting bit s RegValue Value of the whole register e BitValue Value of the bit 0 for 0 anything else 1 w Width of the register 8 16 32 The available width of the registers depends on used platform 3 8 5 5 1 Example Assume that you have a processor which has a PWMA channel and it is required to set three bits 0 1 5 in the PWMA_PMCTL to 1 Use the following line setRegBits PWMA PMCTL 35 Run counter 3 9 Processor Expert files and directories All components in the project with their state and settings and all configurations
18. by calling a appropriate processor component method setting a priority and carefully check possible problems 3 3 1 5 8 Version specific information for HCSO08 derivatives with IPC Interrupt Priority Controller Processor Expert offers the following event priority options interrupts enabled Interrupts are enabled and the priority of the event routine stays at the same level as the interrupt The interrupts with the higher priority than the current interrupt priority can interrupt the event code interrupts disabled All maskable interrupts are disabled e 3 Priorities from lowest 1 to highest 3 The code generated by Processor Expert before the event invocation sets the event code priority to the specified value e 4 Same as interrupts disabled same as interrupt Default behavior of the architecture no interrupts can interrupt the event It is same as interrupts disabled Other values are mapped to the priorities 1 4 CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 91 LEE a a T Configuring components 3 3 1 5 9 Version specific information for HCS08 derivatives without IPC Interrupt Priority Controller Processor Expert offers the following event priority options interrupts disabled All maskable interrupts are disabled interrupts enabled All maskable interrupts are enabled Note that this settings might lead to possible pr
19. initialization of additional registers In such case Processor Expert takes care of initialization of registers not covered by any initialization component and generates appropriate code to the common_tnit method See Reset scenario with PE for 56800EX with static code support topic for more information about content of this method when static code is supported User is informed about this by warning generated by Processor Expert CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 171 SaaS SSS Static code support in Processor Expert For example application uses tnit_apc component to configure A D converter with measurement synchronized with external device connected via pin on chip package Routing of the pin involves initialization of General Purpose I O port A GPIOA peripheral If nic cexo component configuring GPIOA peripheral is in the project then GPIOA registers involved in 1nic arc pin routing are initialized in the Init GPIO static initialization method If 15ic cero for GPIOA is not used GPIOA registers initialization is generated into the common 1nit 0 3 10 2 Standalone and linked project Static code support allows choosing one of two modes for each project e Standalone in which project s static code is independent from currently used development environment or Linked which uses shared static code For selected families of processors Peripheral initializati
20. level init called at the beginning of the main function PE low level init function provides initialization of all components in project and it is necessary for proper functionality of the Processor Expert project CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 119 Implementation details The second level of PE initialization contains 1 Initialization of internal peripherals in the following order based on settings of the Internal peripherals items in Cpu component a Initialization of SIM module except pin muxing GPIOn clock gate is enabled if it s needed for pin muxing initialization It is enabled even if it is disabled in Internal peripherals System Integration Module Clock gating control in processor component it will be disabled later Initialization of MCM module Initialization of PMC module if enabled Initialization of FMC module if enabled Initialization of GPIOn modules pin functional properties drive strength slew rate except pull resistor and open drain 2 Initialization of the two s complement rounding and enabling saturation according to value of the Common settings Saturation mode property in the processor component 3 Initialization of the shadow registers based on Initialize shadow registers settings in the processor component 4 Common initialization Initialization of the pin signal muxing collected from all components
21. shows list of sources available for the cw o in the ana1oscomp 10 component Properties Methods Events Name Value Details Component name ACL Analog comparator CMP0 CMPO Interrupt service event Disabled 4 Positive inputs 1 4 Positive input 0 r A Pin DAC12b0_Output CMPO_INO PTC6 LLWU_P10 Source component CMPO0 INO PTC6 LLWU P10 SPI MOSU EXTRG IN SPI MISO 4 Negative inputs CMPO0 IN1 PTC7 SPIO MISO SPIO MOSI 4 Negative input 0 CMPO0 IN2 PTC8 I2C0 SCL TPMO CH4 A Pin CMP0_IN3 PTC9 12C0_SDA TPM0_CH5 Source component CMP0_INS ADCO_SE4b PTE29 TPM0_CH2 TPM_CLKINO Comparator output DACO_OUT ADCO_SE23 CMPO_IN4 PTE30 TPMO0_CH3 TPM_CLKIN1 Output filter Bandgap Inverted output DACI2b0 Output Analog comp mode Power mode DAC6bO Output Power saving Figure 3 32 Analog comparator input selection in AnalogComp LDD From the list internal signals are sanagap constant voltage reference paci2bo output output of the 12 bit DA converter 0 and pacebo_output output of the 6 bit DA converter 0 Analog to digital converter ADC trigger A D conversion can be triggered from the package pin or from number of internal peripherals Figure below shows some of the triggers offered in the a c component Trigger input property CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 180 Freescale Semiconductor Inc Properties _ Methods Events Name Result type 4 Trigger 4 Trigger sig
22. 24 FreescaleSSI 726 from a list of values 50 from interval 50 FTM 131 G Generated Code 170 Graphical IDE 78 H HCSO08 1 31 HCS08 Derivatives with IPC 89 97 HCS08 Derivatives without IPC 92 HCS12 derivatives 740 Help on component 37 Hertz 53 Hide Views 28 High level component 24 Hot key 35 Ignore enable test 54 Ignore range checking 54 Ignore speed mode test 54 Import 34 Import Component s 28 Inheritance 0 Init 70 Initialization Sequence 34 Inspector 35 Inspector Pinned 35 IntEEPROM 7 30 142 Internal peripherals 24 Interrupt Priority 89 Interrupts and Events 86 Interrupt Service Routine 24 Interrupt Service Routines 87 88 Interrupt Subroutines 66 IntFlash 42 IntFlash Components 26 IO Map c 145 IO Map h 45 IPC 89 91 92 IRQ 129 Items Visibility 46 IVT 140 K KBI 29 kilohertz 53 Kinetis 743 L LDD 17 LDD components 24 Linker Command File 77 Logical Device Drivers 67 LongIO 129 142 Low level component 24 Macros 148 Main module 144 megahertz 53 Method GetHoldValue 742 Method GetValue 742 Method Latch 742 Method Reset 742 Methods 24 Microcontroller 24 microseconds 53 milliseconds 53 Module 24 MONS 127 MSCANI2 126 MTIM 30 N Named Bits 68 Named Group of Bits 68 O On Chip Peripherals 95 OnReset Event 717 OOP 25 Operating systems 67 P PDD 165 PE 25 PE Const h 7146 PE Error h 46 PE Timer 46 PE Types h 46 PEcfg 94 Periphera
23. N i Chapter 3 Application design Enable Processor Expert for Existing C Project Processor Expert Project Select Processor Pin Variants and Configurations Processor Pin Variants MC56F82726YLF 48 pins LOFP Configurations Internal PFlash_LDM Internal_PFlash_SDM Project Mode Linked Standalone Figure 3 4 Processor component variants selection In this dialog you can select processor pin variants and configurations that will be supported for switching later in the project Each selection of variant or configuration represent one processor component pre set For example if you select two pin variants and two configuration there will be four processor components added into the project If you have selected Initialize all peripherals checkbox and CPU contains device pin settings automatically during the project creation the pin settings is added to the project NOTE This option is not supported for all derivatives If supported on given family the project can contain except the CPU component and the PinSettings component for configuring pin routing and electrical properties The project wizard offers support for CPUs that how the static files are used in the Processor Expert project There are two project modes CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 75 Basic principles In Linked mode static file
24. Peripheral Initialization Component configures one peripheral and covers all its features based on the full set of peripheral registers Peripheral registers are initialized in the component static initialization method according to component settings represented in configuration header file which is included in static driver See Typical usage of peripheral initialization components topic for more details about Peripheral Initialization Component initialization method Some additional features associated with the peripheral functionality but controlled by registers belonging to different peripherals might be also included in component settings for example pin routing interrupts configuration or clock gate control Such settings lead to initialization of registers not covered by component itself See Multiple properties accessing common register topic for more information about accessing register from multiple properties Initialization of these additional registers is handled by Processor Expert depending on whether Peripheral Initialization Component covering the registers is present in the project or not e Project contains Peripheral Initialization Component which covers initialization of peripheral to which the additional registers belong In this case the additional registers initialization is included in the static initialization method of this component e Project doesn t contain Peripheral Initialization Component which would be covering
25. Processor Expert Component Developm General Paths Remote Launch Remote Systems Run Debug The three views are Processor Expert General Auto connect component Yes Enable new component in configuration In all configurations Default items view level Basic Show pop up help tooltips Enabled Preferred inspector views Classic View Inspector columns count 2 Restore Defaults Apply Figure 2 9 Preferred inspector views Classic this is the default tree based view as shown in figure Figure 2 8 In default view built in tabs are displayed in the sequence Properties methods events and the tabs that are specific to custom view are added at the end In case Classic view option is selected the sequence of tabs for component XYZ will be Properties Methods Events Device Settings Custom when the Custom view is selected it is marked as replacement of built in tabs and replaces their position with the built in tab In case Custom view option is selected the sequence of tabs for component XYZ will be Device Settings Methods Events Properties Tabs this view displays configuration elements in graphical form better organized easy to understand and use Nested tabs and tables are used to present complex configurations as shown in figure below NOTE After selecting the required view restart or switch the workspace to display the selected view in Component Inspector CodeWarrior Developmen
26. access to only some of the bits of the port On the other side the ByteIO component provides access only to the whole port and thus the resulted code is optimized for such type of access 3 6 2 2 BitslO component versus BitlO components In case of using only a part of the port the multiple BitIO components could be used A better solution is to use the BitsIO component replacing multiple calls of the BitIO component s methods The application code consist only of one method call and is smaller and faster 3 6 3 Timer components optimizations NOTE These optimizations are not usable for the Peripheral Initialization Components CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 161 LTT Embedded component optimizations For better code size performance it s recommended to not to use a bigger counter reload compare register for timer than is necessary Otherwise the code size generated by a component may be increased for example for 8 bit timer choose 8bit timer register In some cases several timing periods are required when using timers for example the TimerInt component The Processor Expert allows changing the timer period during run time using several ways note that this is an advanced option and the Component Inspector Items visibility must be set to at least ADV ANCED These ways of changing the run time period of timer requires various amount of code and
27. allocated pin in the component properties available in ADVANCED view mode This documentation can be found in the Documentation folder of the Components view See Signal names topic for details Code generation log that contains information on changes since last code generation See Tracking changes in generated code for details XML documentation containing the project information and settings of all components in XML format The generated file projectname _settings xm1 can be found in the Documentation folder of the Components view It is updated after each successful code generation Shared modules with shared code the code which is called from several components Complete list of generated shared modules depends on selected processor language compiler and on the current configuration of your project Typical shared modules are IO Map h Control registers and bit structures names and types definitions in C language IO Map c Control registers variable declarations in C language This file is generated only for the HC S 08 HC S 12 versions Vectors c A source code of the interrupt vector table content CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 145 Code generation and usage PE Const h Definition of the constants such as speed modes reset reasons This file is included in every driver of the component PE Types h Definition of
28. board configuration Export Processor Expert Board Configuration Create selected board configuration file Select project Select components SyI2C RGB amp Processors Sytest1 v 49 Cpu MKL25z128Lk4 Sytry z Components PWMTimerB TimerUnit_LDD PWMTimerRG TimerUnit_LDD 12C 12C_LDD MIE cs101 Consolelo Select output file D Profiles b13706 try peb Figure 3 21 Expert Processor Expert board configuration page In the left panel select the project for which you want to export the board settings In the right panel the processor and components are already selected Click the Browse button to select the output file in which the export settings are saved The default location for saving the output file is either recently selected folder or your home directory The extension of the file is peb 3 Click Finish to complete the exporting of board configurations Now you know how to export board configuration 3 3 9 3 Component settings to project You can import one or more component settings from a file Although components with existing name results in conflict but it is still possible to import The imported components are added into the selected project To import component settings CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 108 Freescale Semiconductor Inc Chapter 3 Application design 1 In the IDE select File gt Import The Impo
29. code from processor and also to switch the CPU package To open this view click Window gt Show View gt Other and select Processor Expert gt Processor CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 54 Freescale Semiconductor Inc Chapter 2 User interface TY EN By Generate Code Mf Select CPUPackage QQ GY WO Figure 2 16 Processor view You can change the CPU package when the Components view is not being displayed by selecting the Select New CPU Package option on Processor view CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 55 Processor view Select New CPU Package MK10DN32VLHS 64 pins LOFP64 MK10DN32VLHS 64 pins LOFP64 MK10DN32VMPS 64 pins MAPBGA64 MK10DN32VMPS 64 pins MAPBGA64 MK10DN32VFT5 48 pins LOFN48 MK10DN32VFTS 48 pins LOFN48 MK10DN32VLFS 48 pins LOFP48 MK10DN32VLFS 48 pins LOFP48 MK10DN32VFMS 32 pins LOFN32 MK10DN32VFMS 32 pins LOFN32 Figure 2 17 Processor view Select New CPU Package 2 5 1 Control buttons The following table lists and describes the control buttons Table 2 3 Control buttons NENNEN GENMNMENMENM KEEMEEREOS A S Zoom in Increases the detail level of the view The whole picture might not fit the viewing area Zoom out Decreases the detail level of the view Processor Expert tries to fit the whole picture to the viewing are
30. complex components inheritance is used to separate component settings into several logical parts for example settings of channel is inherited in the component with settings of the main peripheral module 3 3 7 2 Settings in Processor Expert The Descendant component contains a property that allows selecting an ancestor component from a predefined list of templates The component is created after selection of an appropriate template name or component name from the list of the templates fitting the specified interface Any previously used ancestor component is discarded DMATransfer DMATransfer Figure 3 14 Inherited component item in Inspector Processor Expert allows you to select from ancestors that implement the required interface and are registered by the descendant component The ancestor component is displayed under its descendant in the project structure tree in the Components view 1 44 DA1 DAC_LDD Inhr 1 DMATransfer_LDD DAC_LDD DMATransfer Figure 3 15 Example of ancestor and descendant components in the project panel tree CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 101 A SSS Configuring components An ancestor component requires a list of methods and events interface which must be implemented by an ancestor component The error is shown if the ancestor component does not implement any of them For example if the settings of the descendant co
31. components CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 102 Freescale Semiconductor Inc EE Chapter 3 Application design 3 3 8 Sharing pins among peripherals Some processors allows few pins to be used by multiple peripherals This may lead to the need of sharing pin s by multiple components Normally if you select one pin in more than one component a conflict is reported However it is possible to setup a sharing for such pin in the component inspector One of the components sharing a pin has to be chosen as a main component This component will initialize the pin In the properties of other components that use the pin the pin has to be marked as shared see figure below Pin sharing can be set in the Component Inspector The Component Inspector must be in EXPERT view mode Use the pop up menu of the property and select the command Pin Sharing Enabled A Pin PTC17 CAN1_TX UART3_TX ENETO_ PTC17 CAN1 TX UART3 TX ENETO Figure 3 17 Pin property with sharing enabled Pin sharing is advanced usage of the processor peripherals and should be done only by skilled users Pin sharing allows advanced usage of the pins even on small processor packages and allows application specific usage of the pins 3 3 8 1 ConnectPin method It is necessary to invoke the component method connectPin to connect a component to the shared pin It is also necessary to invoke the main component method to connec
32. designs There are few issues that results from the characteristics of the MONS system To achieve a standard communication speed 19200 9600 4800 bauds a specific oscillator frequency must be used usually 9 83 or 4 915MHz Suitable source of processor clock is usually part of the debugging system The user must set the same clock frequency in the processor component of his project to ensure that the timing of components will be correct Care must be taken when using PLL and speed modes Change of the operating frequency of the target processor can result in loss of communication with the target system Some processor models allows to by pass internal divider by 2 which effectively doubles the bus clock of the processor The bypass is selected by logic state of selected input pin for example PTC3 during processor reset The user must set appropriate property in the processor component to reflect actual state of the pin One I O pin for example PTAO is used for communication with the host computer therefore it can t be used as a general I O pin In some configuration of the debugging system the IRQ pin can be also used to control the target board therefore it can t be used in user application CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 134 Freescale Semiconductor Inc eee a een Chapter 3 Application design 3 4 6 2 1 Capturing unused interrupts The debugging system based on MONS all
33. devices represent the whole peripheral or parts of the peripheral set to work in a specific mode Using only a part of the timer allows to share the timer by multiple components The following devices are usually defined for the complex timer peripherals the examples are for the MC68HC908AZ60 processor TIM e g TIMA The whole timer including counter all channels and control registers Name of the device should be same as name listed in datasheet Sometimes the x is omitted if there is only one such timer on the chip This device blocks all other devices defined for this timer TIMxy e g TIMA0 Channel y of the timer TIMx TIMxfree e g TIMAfree This device represents the overflow flag and the interrupt capabilities of the counter The range of the counter is not limited and it is determined by the size of the counter register so the timing is controlled only by the prescaler selection e TIMx PPG e g TIMA PPG The whole timer in a programmable pulse generation mode If the timer is used in this mode it is not possible to use any of the TIMx TIMxy and TIMxfree devices TIMxPP e g TIMAPP modulo register of the timer in a programmable pulse generation mode that controls period of the generated signal e TIMxyPPG e g TIMAOPPG channel y of the timer TIMx in the programmable pulse generation mode NOTE Even though the multiple devices defined for a timer are configured independently they can be m
34. eec ebd qe pde shaw Debe E 153 3 5 3 2 Methods EnableEvent DisableBVent iues rt nbi Pte etd Mincir tona Eja ER bea Ded 154 3 9 3 2 2 Events BetoceNewSpeed After News peed ics iei Hietebescaie na rure cip ca edt avdos de acie cor 154 Zada TRIJE und FALSE values of bool ypes ues ier etie eter etre teer Feri erp lets 155 35 3 3 Typical usage of peripheral initialization components cucurrit os ste ette a dp v PY cake me La 155 Sock Aumate calins of TM Mt 156 4523 17 Mamialcalling OE UR casaicsccssssescascetscnvendcennnaianraeaacivdapuscauisgaicssavensatnavacaasuerumwmarises 156 3 5 9 3 9 Interrupt handling ission trek ete tese bo i ex Ee e e e eR IV cL RU EUREN REISK ERROR 156 SO A TPE LDD pormponebs USDEE iae aini Siue EEEE AEE ire BRA I ANET anes Da tede abre Ray eeu 157 S08 TMEE duoc E 158 Dosen NESTE RUFI RE isset nag pr eo FEDO C or tanec CRM ip needa 158 CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc Section number Title Page CS User changes in gonerated Cd T arkena RER A EREE AREIA NEARE S ENEE INN ASENNA ATERS 158 354 1 Code generation opBibus Tor component motdules uus erii tod coca ataaieewiisraneeanivecassedacsnunssedaesens 158 354 Freezing Merode genera operiert bib aedi MA EAE Ha degit R s saeua End EAD deed 159 an Embedded component Gp EROS deca esiti parc sa a aA is LAB Uhr ed v et de aa Roa Pea pe M Gub ad EEAS 159 3 6 1 General opini Zaio NN
35. folders are available only for Peripheral Initialization components and only if PDD library or PESL library is supported for the selected processor Either PESL or PDD folder is displayed and not both CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 32 Freescale Semiconductor Inc O Chapter 2 User interface Pis Components try 3 ese arss B S Components amp Referenced Components 1l MCM Init MCM a fee cc us Ix f ADC CYCLIC PDD ClearEndOfScanInterruptFlaas s NADC CYCLIC PDD ClearHighLimitInterruptFlaas 3 ADC CYCLIC PDD ClearLowLimitInterruptFlags M ADC_CYCLIC_PDD_ClearZeroCrossingInterruptFlags i ADC_C CLIC_PDD_DisableEndOfScanInterrupt x ADC_C CLIC_PDD_DisableEndOfScaniInterrupt1 i ADC_C CLIC_PDD_DisableInterrupts 3M ADC_C CLIC_PDD_EnableAutoPowerdown x ADC_C YCLIC_PDD_EnableAutoStandby FM ADC CYCLIC PDD EnableDmaRequest FM ADC CYCLIC PDD EnableDmaRequesti Kk Figure 2 4 List of PDD macros All component s items have status icons that signify the enabled or disabled state If this state cannot be changed directly the background of the icon is gray For more details see Embedded components topic This table explains the various states of a component Table 2 1 Description of component states y Signifies that component is enabled It can be configured and code can be generated from this component x Signifies that component is disabled It can
36. have this hardware The project can be created without it This simple Processor Expert demo project uses the following LDD Embedded Components see Component categories topic for details PK60N512 CPU component e GPIO LDD This component will control LED output connected to PTAT10 pin TimerUnit LDD This component will provide periodical timing This tutorial contains the following main steps Creating a new project Adding components Configuring components Code generation CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 187 Tutorial project for Kinetis microcontrollers 4 1 1 Creating a new project To create a new project L 2 In the CodeWarrior click File menu and select New gt Bareboard Project in order to create a new project The Project Wizard appears Enter the name of the project LED and click Next NOTE You can also create a project outside Eclipse workspace In the Create an MCU bareboard project page deselect the User default location checkbox and specify the location This option will allow you to create a project and generate the code that will be compiled by external compiler and is not integrated in Eclipse Select Kinetis K Series gt K6x Family gt K60D PK60N512 Click Next In the Connections page P amp E USB BDM MultilinkUniversal FX USB Multilink is set as the default connection Click Next In t
37. in CodeWarrior Remote Launch Processor Expert Core P amp E Core Plugin Analysispoints Plug in Codan Analysis UI For C C Automatic Updates Scheduler Restore Defaults Apply Figure 2 3 Preferences startup and shutdown gt Components Components view shows the tree with the following items Generator Configurations Configurations of the project Operating System contains special components that provide operating system interface and configuration if there are any used CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc OE EEE Components view Processors contains Processor Components included in the project Components it is included in the project Every component inserted in the project is displayed in the Component Inspector view and may have a sub tree showing items available for the component note that components can offer only some or even none of these items Methods Methods allow runtime control of the component functionality Events routines Events allow handling of the hardware or software events related to the component If the event is disabled the name of the event is shown For enabled events the name of the handling function is shown ISRs Represent component related interrupt routines that is created by you for low level interrupt processing For items whose ISR names have been specified within com
38. in the project enabling disabling of the GPIOn clock gate is ensured automatically Initialization of the interrupt priorities collected from all components except some system interrupts like MCM Core fault PLL Error or PMC Low voltage Initialization of the unused I O pins based on Initialize unused I O pins properties in processor component Other initialization originated from some components for example Init_GPIO BitIO 5 Disabling of the GPIOn clock gates if it is disabled in Internal peripherals System Integration Module Clock gating control in processor component in case it was temporarily enabled see the first step 6 Initialization of components in a project typically calling their Init method for example Init ADC ADC Init SPI SynchroMaster 7 Required priority level setup based on Common settings Initialization priority item in the processor component oan c Now you can do a second level of Processor Expert initialization CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 120 Freescale Semiconductor Inc Chapter 3 Application design 3 4 2 4 OnReset event You can write the code that will be invoked from the PE_low_level_init function after the Processor Expert internal initialization but before the initialization of individual components Thus you should expect that peripherals are not completely initialized yet This event can be enabled disabled in the p
39. integration into existing RTOS 3 2 1 8 5 Shared drivers Logical device drivers support the shared mode that means that more components can be put together to provide one instance of API You can access each component instance through the API of the shared component A driver device data structure is used for resolution which peripheral instance shall be accessed Currently there are three components that support shared mode serial_upp caw rp and Ethernet_Lpp CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 71 Basic principles 3 2 1 8 6 Low power features Logical device drivers in conjunction with processor component implement low power features of a target microcontroller Each LDD component define two methods related to the low power capability setoperationmode and cetpriverstate 0 For more details refer to the documentation of components CPU User e g RTOS SERIAL LDD SERIAL LDD driven component Transmitjob 1 1 SendBlocKDeviceDataPtr TxDataPtr j Start transmission GetDriverState DeviceDs ta Ptr PE LDD DRIVER BUSY flag isset CallbacKCallbackParamP tr Figure 3 3 Usage of low power API in Logical Device Drivers In the example above DPM Dynamic Power Manager task may opt to care for a selected number of peripherals for graceful power mode change for example FEC CAN and rest of the peripheral drivers nee
40. is propagated through the property into the initialization method 3 11 Internal signals Internal signals represent interconnections between processor internal peripherals a peripheral produces signal which is used by different peripherals Examples of internal signals are Trigger signal asserting request example of trigger source is Program Delay Block or any timer Internal voltage sources internal reference or programmable voltage sources produced by D A converter CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 179 Internal signals In Processor Expert each internal signal is represented by name is composed of name of peripheral producing the signal and function of the signal Some examples are cmpo_output TMRO overflow and paceb_output However it is not guaranteed that the same internal signal will have exactly the same representation across all components In embedded components internal signals represented by their name are typically present on the consumer peripheral side as inputs to the embedded components On the signal producer side internal signal generation control is peripheral specific Some examples of internal signals available on KL25 Kinetis MCU Analog comparator input CMP peripheral can compare two types of analog signal sources external connected through package pin or internal connected using internal signal Figure below
41. knowledge system and solution bank The solution bank is created from hand written and tested code optimized for efficiency These solutions are selected and configured in the code generation process Enter your code for the events provide main code add existing source code and build the application using classic tools such as compiler assembler and debug it These are the typical steps while working with Processor Expert Other components may help you to include pictures files sounds and string lists in your application Processor Expert has built in knowledge internal definitions about the entire microcontroller with all integrated peripherals The microcontroller units and peripherals are encapsulated into configurable components called embedded components and the configuration is fast and easy using a graphical Component Inspector Peripheral Initialization components are a subset of embedded components that allow you to setup initialization of the particular on chip device to any possible mode of operation You can easily view all initialization values of the microcontroller produced by Processor Expert with highlighted differences between the last and current properties settings CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 22 Freescale Semiconductor Inc E O MMMMMU amu Chapter 1 Introduction Processor Experts performs a design time checking of the settings of all components and r
42. list of processor properties and their description is available in the help page for the processor To open the processor help page select Help gt Help on Component from the menu bar in the Component Inspector view Following properties define the basic settings of the processor e Processor type External Xtal frequency and sub clock xtal frequency PLL settings nitialization interrupt priority External bus and signals e Speed modes see Speed modes support topic All other functions that are not directly encapsulated by components 3 2 2 8 Speed modes support NOTE Speed Modes are not available for Kinetis and ColdFire family microcontrollers The processor component supports up to three different speed modes The three speed modes are Processor Expert specific concept which among all the other PE features and concepts ensures the portability of the PE projects between different processor models In fact the three speed modes are a generalization of all the possible processor clock speed modes used for power saving that can be found in most of the modern microcontrollers In the area of embedded systems power saving and power management functions are so important that you can not neglect the proper HW independent software implementation of these functions Therefore for keeping the portability HW independence of PE projects it is recommended not to program the processor speed functions manually but use the
43. main internal clock of the processor Most of the processor timing is derived from this value Processor Component Component that encapsulates the processor core initialization and control This component also holds a group of settings related to the compilation and linking such as Stack size Memory mapping linker settings Only one processor component can be set active as the target processor For details see Processor Components topic CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 23 LE Terms and definitions used in Processor Expert Component Driver Component drivers are the core of Processor Expert code generation process Processor Expert uses drivers to generate the source code modules for driving an internal or external peripheral according to the component settings A Component can use one or more drivers Counter Represents the whole timer with its internal counter Events Used for processing events related to the component s function errors interrupts buffer overflow etc by user written code For details see Embedded Components topic External user module External source code attached to the PE project The external user module may consist of two files implementation and interface c and n Free running device Virtual device that represents a source of the overflow interrupt of the timer in the free running mode High level componen
44. prescaler value 3 4 8 Version specific information for HCS12 and HCS12X All components were tested with the CodeWarrior with the following compiler settings Other parameters Onf The ROM and RAM ranges depend on the target microcontroller It is recommended to increase the stack size if some standard libraries are used Components implementation details All the components Interrupt priority and Event priority refer to the version specific information details in the Processor Expert priority system topic MISRA compliance All component have been developed to MISCRA C 2004 standard compliant The exceptions to this compliance are documented in the HTML page accessible in the file CodeWarrior ProcessorExpert DOCs Misra2004Compliance html Processor Speed Mode selection CPU methods SetHighSpeed SetLowSpeed SetSlowSpeed if processor clock dependent components are used then signals generated from such an internal peripheral may be corrupted at the moment of the speed mode selection if function of clocked devices is enabled Handling of such a situation may be done using events setorexewspeea and AfterNewSpeed Interrupt vectors table IVT is by default generated on the default addresses for of the current target processor However Processor Expert offers additional configuration of the IVT On HCS12 derivatives The placement of the IVT can be configured in the Build Options tab of the processor Com
45. signal name and pin number information next to each pin name This document can be found in the Documentation folder of the Component view Listing Sample of generated signals documentation SIGNAL NAME DIR PIN NAME PIN NUMBER LEDI Output gt GPIOA8 A0 138 LED2 Output GPIOA9 A1 10 Sensor Input gt GPIOC5 TA1 PHASEBO 140 TestPin I O GPIOEO TxDO 4 Timer Output gt GPIOC4 GPIOA8 AO 138 gt LED1 Output GPIOA9 A1 10 LED2 Output GPIOCA TAO PHASEAO 139 gt Timer Output GPIOC5 TA1 PHASEBO 140 gt Sensor Input CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 100 Freescale Semiconductor Inc EE y Chapter 3 Application design 3 3 7 Component inheritance and component sharing e Ancestor is a component that is inherited used by another component e Descendant is a new component that inherits uses another component s Shared Ancestor is a component that can be used and shared by multiple components 3 3 7 1 Inheritance Inheritance in Processor Expert means that an ancestor component is used only by the descendant component Inheritance is supported in order to allow components to access peripherals by hardware independent interface of the ancestor components For example a component that emulates a simple I2C transmitter may inherit two BitIO components for generation of an output signal On several
46. the Freescale logo CodeWarrior ColdFire Kinetis and Processor Expert are trademarks of Freescale Semiconductor Inc Reg U S Pat amp Tm Off All other product or service names are the property of their respective owners 2011 2014 Freescale Semiconductor Inc Document Number CWPEXUG Revision 10 6 02 2014 Po efe freescale
47. thus the total application code size is influenced by the method chosen When the period must be changed during run time use fixed values for period instead of an interval if possible to save code There are two possibilities See Dialog for timing settings for details From list of values this allow to specify several but fixed in run time number for given periods This allows only exact values modes listed in the listbox The resulted code for changing the period is less complex than using an interval From time interval this is an alternative to using list of values which requires more code Using an interval allows setting whatever value specified by the component during run time This code re calculates the time period to the processor ticks and this value is used when changing the timer period If the application requires only a few different timing periods even if the functionality is the same for both cases the correct usage of list of periods produces smaller code compared to code using an interval 3 6 4 Code size optimization of communication components NOTE These optimizations are not usable for the Peripheral Initialization Components Communication components should be used with the smallest possible buffer Thus the user should compute or check the maximum size of the buffer during execution of the application For this purpose the method GetCharsInTxBuffer GetCharsInTxBuffer AsynchroSerial component whi
48. used in two ways The Init method is called by Processor Expert The Init method is called by the user in his her module 3 5 3 3 1 Automatic calling of Init You can let Processor Expert call the mnit method automatically by selecting yes for the Call Init method in the Initialization group of the Component s properties When this option is set Processor Expert places the call of the Init method into the PE low level init function of the cev c module 3 5 3 3 2 Manual calling of Init Add the call of the Init method into the user s code for example in main module Enter the following line into the main module file Initl Init Put the Init method right below the pz 1ow 1evei init call void main void Processor Expert internal initialization PE low level init End of Processor Expert internal initialization Initl Init for CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 156 Freescale Semiconductor Inc EE Chapter 3 Application design 3 5 3 3 3 Interrupt handling Some Peripheral Initialization components allow the initialization of an interrupt service routine Interrupt s can be enabled in the initialization code using appropriate properties that can be usually found within the group Interrupts After enabling the specification of an Interrupt Service Routine ISR name using the ISR name property is required This name is generated to In
49. 014 172 Freescale Semiconductor Inc SSS Ee Chapter 3 Application design 3 10 2 2 Linked mode Static drivers are not physically placed in the project directory Instead project static code repository is virtually linked with shared static drivers repository stored in Processor Expert installation directory All projects created in this mode shares the same version of static drivers and any changes made in the shared repository are automatically distributed across all of the linked projects 3 10 3 Processor Expert static code repository Processor Expert installation directory contains static code repository with static driver modules for all supported processors Projects in linked mode shares the repository and repository content is used when new standalone project is created See Standalone and linked project topic for more information about standalone and linked mode Processor Expert static code repository is divided into sub folders with one processor family support in each of them It is placed at CodeWarrior Processor Expert lib Processor family and has the following sub directories iofiles the directory containing peripheral memory map files e pdd inc the directory containing Physical Device Drivers PDD header files For more information on PDD see Physical device drivers topic pdd2MProcessor peripherals the directory containing all peripheral initialization modules pdd2MProcessor Nsystem the d
50. 73 ee Basic principles This setting doesn t affect the setting of the target in the Targets tab in the CodeWarrior project panel If user changes the target processor in the Processor Expert project panel and the processor doesn t match with the current CodeWarrior target settings the Linker dialog is invoked during the code generation allowing the user to update the linker setup 3 2 2 4 Changing settings To modify the processor component settings its properties methods events external bus timing user reserved peripherals compiler and debugger settings is to invoke the Inspector for the selected processor component If you have added processor to your project you can invoke Component Inspector by performing either of the following Right click the processor icon in the Components view to display pop up menu and select the Component Inspector view Double click the processor icon in the Components view For a detailed description of the current processor properties methods and events select Help on Component command in the View menu drop down arrow in the Component Inspector view 3 2 2 5 Processor component variants selection This dialog is shown during the creation of a new project using Project Wizard or when you add a new processor component into project using Components Library view CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 74 Freescale Semiconductor Inc
51. A aai 168 Ew E o E Her 168 CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 11 Section number Title Page FIRES S quar cibus OL DIS MR 168 L5 50x 09 MEN US cos o T CS 169 30 Processor baper Eies and DUEGOROUIGR eoa cui e Ede b ena Cd Ob nat Luo Bu cibi IE E a parse ERE EO 169 ENSEM IS cun cup ti e Meme 169 392 User templates and COUIDORODIS 1 roro rho oera Ced ese eai du ale di aU us bea ta leuc do dne Erare Aei 170 ENLMR UDEseE lreesmolgrtn ndi qe c ARREA 170 JIGI Siae TET aaa a scopes gh urrade bean Tp N 170 aIo Siandalone and haked proper esiri e e 172 LPS NEP uc d carri ET T72 SEA nka moon a a ean becans 173 3 10 3 Processor Expert static code repOSitOly sisi ccsccisntecaiassacciavicnvansatiaiassidiaavensveenvwnsmvaaneserrananabateavieeannereaineaees 173 3104 Processor Expert static code directory SUUE soena a A E Sr a E AS 173 310 3 ig erue T 174 SOM TERMS eet CAMINO DURS ciun ie bebe bets aepo iate Rib abode EHE ET al eb RUE GE bea E DE aids 174 XJMET Peripheral goteltaton component ieS Li erssiea ede cope E pk Pr BUDE e peike PARI aiia s tai Cu ES pU Naaien 175 3 HEN Peunhersl menor map TON ouod teet i edle put bises p IM pe CURIE Hiec deeds 175 MI MEL CIN se NT EET o oet 176 3 10 10 Processor Expert static code repository and project repository synchronization seseeenen 177 S I0 I1 Stale t
52. CodeWarrior Development Studio Processor Expert User Guide Document Number CWPEXUG Rev 10 6 02 2014 V N 4 MN freescale CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc Contents Section number Title Page Chapter 1 Introduction De NGI VW 15 12 Features Gf Processor Bx Peenise aniar N E ER REAS EAI EER RESA R AEA EEEE 16 LY Ke pope E pied ule Pace de A AATE O ad o Et bes dtu oi cuis LA ES Aet AP IE ca E SURE Ud 18 LoS Ad D nr 18 122 1 Integrated Development Environment increas s productivity s ssicisicsrisissssirisrissuriersrossessnridnisinass 18 1222 Minimize time to kam microcomrollei arenan eaa 19 12 53 Rapid development ot entire applic aBoglg escroa rereana A E dian RR Gd 19 12 231 Modulkw end reusable DUBCUOIS erect tit de tbe Hell bela be tula ede tbe Hu ones io alude dup aui au dd bt Duel 20 L225 Easy to modify and port implementations cieracea idoira HR cA bua dada 20 Lo Eoo O A A N 21 L3 Ernbsdodad CaaS ITE aio bi eia eA EIU eap MER MEM Ip E curd aedi de ben d Mad MM tdh did treu I RN RUDI 21 13 2 Creating AD PING AON ss senarran 22 133 RTOS SUPP secina er ie ean RE NA OARE RAN EVAR EA AR ARAE AN AEREE 223 A Tenues and definitions used dn Processor BXDOEI scinseciascaccassiaieussaiassaucssavaxsuvsatassavencnvaseubentaseatessavessevanialenins e FUE FED M SUA 22 Chap
53. Create code generation log value changed from false to true HEHE HEHE HE HEHE HE HE HE HE HE HE HE HE HE HE HE HE HE HE HE HE HE HE HE HE HE HE HE HE HE HE HE HE HE HE HE HE HE HE HE HE HE HE HEHE HE H HE H H H HHH HHH HHHH Code generation 2010 10 22 16 01 CodeGen 2 by user Userl by Processor Expert 5 00 Beta for Freescale Microcontrollers PE core 04 46 Configuration Debug_S08GW64CLH Target CPU MC9S08GW64_64 CPUDB ver 3 00 000 Component Cpu MC9S08GW64_64 the following files modified due to internal interdependency Generated_Code Vectors c changed Generated _Code Cpu h changed Generated _Code Cpu c changed New component PWM1 PWM ver 02 231 driver ver 01 28 added to the project the following 78 Processor Expert User Manual Application Design Generated _Code PWM1 h added Generated CodeMPWM1 c added Documentation Documentation ProcessorExpert txt regenerated Documentation ProcessorExpert Settings xml regenerated Other files have been modified due to internal interdependency Generated _Code PE Timer h added Generated _Code PE Timer c added User modules Sources ProcessorExpert c changed gt updated list of included header files Sources Events h changed gt updated list of included header files Totally 11 file s changed during code generation To view changes within the individual files you can use a file pop up menu command Compare with gt Local h
54. E E 159 OLE Disaline ynused CU ert cm 159 501 2 Iueabhnswun sed COMPOSI siis cepiiepcqi fab Re app ei pcO Tap E Fa IMPR RENA 160 ee RC WIS Pe PRU 160 3 6 2 Cremer al porn 170 opi ZAOTIG 4 0 cciocssaureoianse AOO O O O A 161 30 21 BytelO component versus BitsIO components emnin reari 161 562 2 BisiO component versus BitlO components i eese eek tenete r e c Reine manna 161 363 Tuuercompotnchtr Op ZAGODS eite cons seien tipi rea tease vole tee FIXES EU UTE NERA HU RR O Risk e RUE eu nd URREA 161 364 Code size optimization of communication COMPOTETIS 4 ccscccceccccsntesssaccusoncesbessnseaveresseatentescavexeusertestesnenes 162 Pe TER I oM 163 2 Conemae projections Procesor pror m 163 Ss Luw develdecoscto UT AMIS ao cdcipcitebelebetie sies iota popa Md teure e Sebzta sessili lesse ce AAE Dpto pi uen ds 164 t2 2 MEE ceri cil pnt E LET II TERR o ESL eT 165 382 Peripheral driver implemenatie TP M 163 eee My De AG Uye acaba Lice Sasa dacs A A E AEN 165 SOM Prones Exper ye em Bir PT 166 AI Convention Tor PESL MATO cieie eaii 166 384 2 Using PESL and peripheral initialization eombpdanents c oeciecoi soeurs anean na 166 3643 PES commands tetera Ecouri aa A etre S 167 3 8 5 Direct access to peripheral TEC U TG ccs sinc sisi A EO A R E 167 38 91 Resister access Brie n 168 45 95 Wiolereeister HOCOSS MACON ean aaas ON REN AEEA ENEE ENE Exp Fe ep cdd pin OM o AS 168 LS Regeer PAN oso enc wem lc A bees E
55. ERR 102 3 3 8 Rang eee omone Clo 21 Ga Jt gs on ds redii Rb M E pr Gef ee dde n d Sia db Y 102 Sch a ivo ciis TT 103 39 Eportand MERIT CENE EL TP 103 EXE SEM Sco et LU NR Ut P AE 104 S292 Espat DOSE CON EURO e epo IR debi as pied pubs depu Dpuscuu i tn ts c pin d ta tu pm Ed dutta 106 209 3 Component RCC OPOE ge pocdiebne dubii nio a udeR o mein T oil aa Laien i d E NELEAR 108 23 4 94 Apply board cornBiguratiOrsi eec eie RE red RP UE A Vp Riv I E pM IPM ipag tu Diis 1G 29 2 Componenti si to component Nra yerme 113 EX Tmpiememston STAG P IES 115 3 4 1 Reset scenario with PE for HC 5 08 RS08 and S6800 E ic cccvssncrsaecsarsonviinerrnsnemerrniesewuveaneucion 116 ALLI Jay Pon NN UB as ER pe RR saunter aR NOR M DUI ERE 116 Lr XE SE ED Cu RR OD LE LL 116 LIONE 3 0 2 ed AAT mem 116 PU i CAR E TT 117 ST MEET ug Scr DR wi PE for G0 li io dem pr cuba AA 117 De Enn PON TUR ie ules E S S EO DEEST 118 EX SUV ABU n Ne E T tM 119 Cr EM FE cc MI Mon got c 119 ras Mc r ai sta acanestab lan sonani apie saii a eiecanaiantunaeianiaeiesonlompeann a aniiaaNs 120 34 3 Reset scenario with PE for S6800EX with static code support cassecnse neret tr torte catenae Ra anieri 121 SALSA Enny Pont Hur ER T E 121 J432 C starup R p denis M 122 343 39 PB low level imit hercian o D Rei aUe m bsc Ue ubl Mon d i spp EET RE REA POUR 122 3 4 Reset scenario with PE f
56. IMB PPG TIMBPP TIMBOPPG TIMBIPPG It follows from the table in this chapter that For the PWM component in non buffered mode you use only one channel for example TIMBO According to the columns the component will use one channel and TIMBfree device other channels will stay free all other devices will be blocked CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 133 El Implementation details The Capture component according to the columns uses only one channel Such channel is available TIMB1 e Sharing of the TIMB peripheral by the PWM and Capture component is possible There is no remaining free device on the timer peripheral Because the channels of this timer are sharing one prescaler it is necessary to configure the same prescaler value for both the PWM component and the Capture component 3 4 6 2 Debugging on HC08 using MON8 Every member of the HC08 microcontroller family is equipped with a basic support for in system programming and debugging MONS for details see datasheet of a HC08 processor The microcontroller can work in two modes normal and monitor In the monitor mode the microcontroller can accept couple of commands over the single wire interface The commands allow to read write the memory and run a code In combination with Break module a simple debugging system can be built for example ICS boards P amp E Multilink or various custom
57. PIDLimit Wordl6 NegativePIDLimit Wordl16 IntegralPortionK 1 Wordl6 InputErrorK 1 mc sPIDparams typedef struct Wordli6 ProportionalGain Wordl6 ProportionalGainScale Wordl6 IntegralGain Wordl6 IntegralGainScale Wordl16 PositivePILimit Wordl6 NegativePILimit Wordl16 IntegralPortionK 1 mc sPIparams endif _ PE Types H define MC PWM SIGNAL 0 0x0001 define MC PWM SIGNAL 1 0x0002 define MC PWM SIGNAL 2 0x0004 define MC PWM SIGNAL 3 0x0008 define MC PWM SIGNAL 4 0x0010 define MC PWM SIGNAL 5 0x0020 define MC PWM NO SIGNALS 0x0000 No none PWM signals define MC PWM ALL SIGNALS MC PWM SIGNAL 0 MC PWM SIGNAL 1 CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 152 Freescale Semiconductor Inc M f Chapter 3 Application design MC PWM SIGNAL 2 MC PWM SIGNAL 3 MC PWM SIGNAL 4 MC PWM SIGNAL 5 Uds 3 5 3 Typical usage of component in user code This chapter describes usage of methods and events that are defined in most hardware oriented components Usage of other component specific methods is described in the component documentation in the section Typical Usage if available 3 5 3 1 Peripheral initialization components Peripheral Initialization Components are the components at the lowest level of peripheral abstraction These components contain only one method Init providing the initialization of the us
58. a Rotate Rotates the package clockwise gH o pl B Resources available for BGA type packages only Selects Resources view mode that shows a top side of the package without pins but including list of peripherals and showing their allocation by components B Pins Bottom available for BGA type packages only Selects Pins view mode that shows a bottom side of the package with pins The peripherals are not shown in this mode because the surface is covered with pins E Pins Top Selects Pins view mode that shows a top side of the package with pins 2 5 1 1 Pins The following information about each pin is displayed on the processor picture in case of BGA type package the pins are displayed only in the Pins view mode CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 56 Freescale Semiconductor Inc E7 Chapter 2 User interface e pin name default or user defined e icon of a component that uses allocates the pin e direction of the pin input output or input output symbolized by blue arrows if a component is connected e With new pin model supported for few derivatives only the background color of the pin reflects routing of the pin to the peripheral Pin names are shortened and written either from left to right or from top to bottom and are visible only if there is enough space in the diagram Some signals and peripherals cannot be used by the user because the
59. allows configuration of peripheral timing settings Generally user can specify required timing value directly or pick up the suitable value from list of values computed according to current settings For detailed documentation see Dialog for Timing Settings topic and Timing Settings topic In following topics the relation between timing settings and clock configurations are discussed e Fixed timing value e Input clock source selection 3 2 2 8 3 4 2 1 Fixed timing value Timing value is same for all clock configurations The default behavior of embedded components is to keep the value set in the timing settings same for all clock configurations Component will ensure that peripheral will be configured to achieve required timing value regardless of the timing scheme used in particular clock configuration For example timer component set to produce interrupt with specific period will configure underlying peripheral in such a manner that for each clock configuration in which the component is enabled it will produce the interrupt with the same period Similarly communication component will transfer data with the same baud rate in all enabled clock configurations Processor Expert contains timing model of each peripheral and check values entered by the user If required value is not achievable for some particular clock configuration user is already informed about that during the design time This approach is common for all embedded components H
60. and enabling saturation according to value of the Common settings Saturation mode property in the processor component 3 Initialization of the shadow registers based on Initialize shadow registers settings in the processor component 4 Initialization of the reset pin based on Common settings reset pin property in the processor component OnReset event call if enabled 6 Common initialization via common 1nic 0 function placed in generated CPU module Common initialization of registers which initialization is required for proper functionality of components in the project for example synchronization between components functionality common for different peripherals of the same type etc Common initialization of registers which would be initialized by Peripheral Initialization Component if component was in the project 7 Peripheral Initialization Components initialization via peripherals_tnit function placed in static Peripherals Init c module 8 Initialization of the rest of components via components 1nic function placed in generated CPU module 9 Required priority level setup based on Common settings Initialization priority item in the processor component CA CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 122 Freescale Semiconductor Inc Chapter 3 Application design 3 4 4 Reset scenario with PE for ColdFire and Kinetis microcontrollers C startup module CPU modul
61. and receives characters from the device Thus the interrupt mode of the SCI the AsynchroSerial component should be used in this case because when a character is received the interrupt is invoked and the underlying process of the application need not check if a character is received When a buffer for sending is used the characters are saved into the buffer and AsynchroSerial s service routine of the interrupt sends these characters without additional code of the application NOTE The polling mode of the component is switched on by disabling of the Interrupt service of the component asynchroserial AsynchroMaster and Asynchros lave 3 7 Converting project to use Processor Expert The C project that doesn t use Processor Expert can be converted to Processor Expert This is useful when the user finds out additional features of Processor Expert Warning Note that in most cases this conversion involves necessary manual changes in the application code because for example the register interrupt vectors table definitions created by the user often conflicts with Processor Expert definitions Don t forget to backup the whole project before the conversion Some files will have to be removed from the project The conversion to Processor Expert is recommended to experienced users only CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 163 Low level access to peripherals The conve
62. are stored in one file ProcessorExpert pe in the root of project directory If the whole content of the project including subdirectories is copied or moved to another directory it is still possible to open and use it in the new location CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 169 Static code support in Processor Expert 3 9 1 Project directory structure Processor Expert uses the following sub directory structure within the project directory Generated_Code the directory containing all generated source code modules for components Documentation the directory with the project documentation files generated by Processor Expert e V Sources the directory for main module event module other user modules e V Static Code the directory containing all static source code modules For details see Static code support in Processor Expert topic For details on files generated by Processor Expert see Code generation topic 3 9 2 User templates and components User created templates see Creating user component templates topic and components are shared by all users and they are stored in the directory ALLUSERSPROFILE ApplicationData Processor Expert version For example on Windows XP the path iS C Documents and Settings All Users ApplicationData Processor Expert CW08 PE3 02 For example on Windows 7 the path iS C Users All Users Processor Ex
63. as interrupt default value which means that Processor Expert does not generate any code affecting the priority of the event the priority is in the state determined by the default hardware behavior minimum priority low priority medium priority CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 90 Freescale Semiconductor Inc EES ee Chapter 3 Application design high priority maximum priority interrupts disabled For example the highest priority supported by the microcontroller which may be interrupted only by non maskable interrupts The selected value is automatically mapped to the priority supported by the target microcontroller and the selected value is displayed in the third column of the Component Inspector Refer to the version specific information below You may also select a target specific value if portability of the application to another architecture is not required NOTE Some events do not support priorities because their invocation is not caused by the interrupt processing Warnings Processor Expert does not allow you to decrease an event code priority with the exception of Interrupts enabled value on some platforms This is because Processor Expert event routines are not generally reentrant so there is a risk that the interrupt would be able to interrupt itself during the processing If there is such functionality requested you have to do it manually for example
64. ase of implementation of system hardware and software firmware modifications 1 2 2 4 Modular and reusable functions Processor Expert decreases the start up time and minimizes the problems of device t uses the concept of a function encapsulating entity called embedded component with supporting methods and events Uses a library of predefined components Uses the concept of device drivers and interrupt handlers that are easy to reapply Uses the concept of well documented programming modules to keep the code well organized and easy to understand NOTE Processor Expert embedded component were formerly called Processor Expert Embedded Beans 1 2 2 5 Easy to modify and port implementations Processor Expert allows optimal porting to an unused processor e Supports multiple devices within a project and makes it extremely easy to switch them e Supports desired changes in the behavior of the application with an instant rebuild e Supports interfacing of the CodeWarrior IDE CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 20 Freescale Semiconductor Inc Chapter 1 Introduction 1 3 Concepts The main task of Processor Expert is to manage processor and other hardware resources and to allow virtual prototyping and design Code generation from components the ability to maintain user and generated code and an event based structure significantly reduce the programming effort in comparison with classic
65. ated and edited manually or with the help of Component Development Environment Processor components are a special category of components 3 2 1 7 Component categories Complete list of the component categories and corresponding components can be found in the Component Categories page of the Components Library view CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 66 Freescale Semiconductor Inc ETE Chapter 3 Application design The components are categorized based on their functionality so you can find an appropriate component for a desired function in the appropriate category There are the following main categories which further contain various sub categories Processor External Devices Components for devices externally controlled to the processor For example sensors memories displays or EVM equipment Processor Internal Peripherals Components using any of on chip peripherals offered by the processor The Components Library folder with the same name contains sub folders for the specific groups of functionality For example Converters Timers PortIO NOTE It seems that components especially in this category correspond to on chip peripherals Even this declaration is close to true the main purpose of the component is providing the same interface and functionality for all supported microcontrollers This portability is the reason why the component interface often doesn t copy all fea
66. ault address in the ROM or in the Flash CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 127 Se LLLLLLLLLLLLLLLLLLLLLLIOL LEIALO LLL LLL UO LUS S SZAM Implementation details If the interrupt vector table in RAM is selected the vectors table is generated into RAM and special redirection code is generated to ROM This code transfers program control to the selected address according to the table in RAM You can use processor methods SetIntVect to set the address of interrupt service routine NOTE You cannot change the interrupt vector that is allocated by any component in your project It is recommended to select the event OnSWI together with this option to minimize size of the generated code PPG The PPG component always allocates the whole timer Although it is technically possible to share the selected timer between 2 PPG components it would be impossible to set the PPG period for two components separately PWM In contrast to the PPG components it is possible for the PWM components to share the selected timer since they do not have the SetPeriod method EventCntr16 Since the timer overflow flag is set when the timer reaches a value of 65535 the maximum number of events that can be counted by this component is limited to 65534 value of 65535 is marked as invalid as the method GetNumEvents returns the err overriow value as its result TimeDate It is recom
67. ay thus generate only the methods and events used by your application Enumeration Selection from a list of values If you click the arrow icon a list of the possible values for the property is offered For some derivatives pin and package details are displayed for processor variant Enumeration Group A list of items Number of visible and valid items in the group depends on chosen value Clicking the arrow icon will show a list of the possible values of the property Clicking the sign shows hides the items in the group but does not influence value or validity of the items File Directory Selection Allows to specify a file or directory Clicking the icon opens a system dialog window allowing to select a file directory Group A list of items that can be expanded collapsed by clicking on the plus minus icon or by double clicking at the row Values of the items in the group are untouched Integer Number You can insert a number of a selected radix Radix of the number could be switched using the icons D Decimal H Hexadecimal B Binary Only reasonable radixes are offered for the property If the radix switching icon is not present Processor Expert expects the decimal radix Link to Inherited component The down arrow button allows to change the ancestor from the list of possible ancestor See Component inheritance and component sharing topic for details Link to shared component The down arrow butt
68. ayed may be dependent on Runtime setting type If it is fixed value or from list of values the values present in rows overlapping intervals are shown only once If from time interval runtime setting type is used all intervals that can be set by various prescalers combinations are shown even if they overlap It is because intervals can differ in resolution that is number of individual timing steps that can be achieved within them Timing unit If a frequency unit is used for example Hz kHz the step column is not visible By clicking on the table header there is possible to order the rows as per selected column By clicking the same column again you can arrange the rows in ascending or descending order Double clicking on a value will place the value into the currently edited row within the Timing values table The values listed in the possible settings table depend on the following timing settings prescalers minimal timer ticks and it also depends on selected processor selected peripheral speed modes enabled for the component The table contains a speed mode tabs speed modes and related settings are supported only in the Expert view mode that allow to filter the displayed intervals for a specific speed mode or show intersection of all Note that the intersection contains only values that can be set in all speed modes with absolute precision without any error so some values that are still valid but due
69. ays the Processor view for the processor derivative used in a given project Processor Memory Map displays the Memory Map view for the processor address space and internal and external memory mapping Rename Component changes the name of the component Select Distinct Shared mode switches between shared and distinct mode of the component This setting is available for LDD components only For more details see Logical Device Drivers topic Open File opens the generated code from the selected component for the source code editor Note that the code is available only after successful code generation Component Enabled enables disables component in the project Copy Paste components can be copied and pasted inside the same project between two projects in the same workspace and between two projects having each project in separate workspace Remove component from project deletes the component from the project Help on component shows a help page for the component e Save Component Settings As Template creates a template of the selected component For more details see Creating user component templates topic Hot key Delete is used for deleting components from the project View Code Opens code editor at the code of the selected method or event Toggle Enable Disable Enables Disables the Method or Event CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semi
70. be configured but the configuration validation generation is disabled No code is generated from this component Signifies error in the component For example Components folder contains component with error Signifies that component is frozen and will not be re generated When the user generates the code again files of this component are not modified and the generated code is frozen Shared components are automatically placed into a dedicated subfolder Referenced_Components You can move the component from this folder to anywhere CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 33 Components view lt 5 Components delete k70 amp 3 zz 2288 8 V amp Generator Configurations g OSs 4 amp Processors 4g Cpu MK70FNIMOVMULS 4 amp Components Tli Timerlnt ey Inhri Timerint_LDD Bj Enable Fi Disable Wi Tii Oninterrupt Figure 2 5 Referenced components When you have more than one Processor Expert project in your workspace and you are working with those projects the last project shown in Components view is recorded in the workspace history When you restart the Eclipse IDE the last session project is opened automatically 2 2 1 View menu Generate Processor Expert Code invokes code generation for the current project e Synchronize Processor Expert Static Code forces static code synchronization For details s
71. be configured in the processor Properties if supported External memories must be defined in processor Properties Any component can allocate a specific type of memory Processor Expert provides checking of memory and protects you from making a wrong choice For example if a component requires external Flash it is not possible to enter an address in internal RAM The bits can also allocate memory Therefore you can be sure that only one component uses an allocated bit of a register in external address space 3 3 3 4 Timing The settings of all timed high level components are checked using the internal timing model See Timing settings topic for details If there is no error reported it means that Processor Expert was successful in calculating the initialization and runtime control values for all components and hence the settings should work according to the configuration 3 3 4 Timing settings Many high level components contain a timing configuration for example speed of the serial communication period of the interrupt conversion time of the ADC Processor Expert allows to configure such timing using user friendly units and it also contains a model of the complete microcontroller timing This model allows calculation of the required values of control registers and continuous validation of the timing settings CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 96 Freescale Semiconductor Inc p
72. bedded components each of which provides a set of useful properties methods and events The following are the main features of Processor Expert e The application is created from components called embedded components CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 16 Freescale Semiconductor Inc SS ee ey Chapter 1 Introduction Embedded components encapsulate functionality of basic elements of embedded systems like processor core processor on chip peripherals FPGA standalone peripherals virtual devices and pure software algorithms and change these facilities to properties methods and events like objects in OOP Processor Expert connects and generates the drivers for embedded system hardware peripherals or used algorithms This allows you to concentrate on the creative part of the whole design process Processor Expert allows true top down style of application design You can start the design directly by defining the application behavior Processor Expert works with an extensible components library of supported microprocessors peripherals and virtual devices Processor Expert peripheral initialization components generate effective initialization code for all on chip devices and support all their features Logical Device Drivers LDD components are efficient set of embedded components that are used together with RTOS They provide a unified hardware access across microcontro
73. bled This componert is daabled Clock configuration 2 This component enabled This component is enabled Clock confsguration 3 mponent daabled This component i daabled Clock configuration 4 This component daabled This component s daabled Clock configuration 5 This component disabled This component is disabled Clock configuration 6 This component disabled This component is disabled Clock configuration 7 This component dabled This component is dabled Figure 3 9 Clock configuration selection in LDD component This feature is not supported by components that don t control the whole peripheral Typical example are pin manipulation components such as Bicro ppp OF Extint_tpp Which are related just to single pin from a port peripheral and multiple instances of these components can be used on the same port Components that support this feature must have at least one enabled clock configuration 3 2 2 8 3 4 2 Timing settings Timing settings are vital part of functionality of some peripherals For example in case of timer peripheral it would be period of counter overflow conversion time of analog to digital converter or baud rate of communication interface Configuration of these features CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 84 Freescale Semiconductor Inc ET Chapter 3 Application design in the high level and LDD components is done in the Timing Settings dialog This user friendly interface
74. button is pressed on some graphical object PLL Phase Locked Loop This circuit is often built in inside the processor and can be used a main source of the clock within the processor Prescaler A fixed or configurable device that allows to divide or multiply a clock signal for a peripheral processor peripheral or its part Properties Parameters of the component Property settings define which internal peripherals will be used by the component and also initialization and behavior of the component at runtime RTOS Real Time Operating System is an operating system OS intended for real time applications Processor The processor derivative used in a given project Template It is a component template with preset parameters User defined Component Template User defined component template is a component with preset parameters saved under a selected name Also the name of the author and short description can be added to the template User module Source code module created or modified by the user Main module event module or external user module Xtal A crystal a passive component used as a part of an oscillator circuit CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 25 Terms and definitions used in Processor Expert CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 26 Freescale Semiconductor Inc Chapter 2 User i
75. cenario with PE for 56800EX C startup module CPU module CPU reset EntryPoint ry 0 User code before E init First level of PE I initialization l PLL ext bus I I I l User code after C startup function E init Initialization of the stack pointer runtime libraries memories main PE low level init Second level of PE initialization I Cpu OnReset a p User event if enabled H User s code E Initialization code generated by Processor Expert User application code in event module 1 Call of a method or occurence of an event gt Return from method event or interrupt Interrupt Figure 3 29 Reset sequence diagram with Processor Expert CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 118 Freescale Semiconductor Inc eee ea Chapter 3 Application design 3 4 2 1 _EntryPoint function The _EntryPoint function is called as the first function after the reset This function is defined in the cpu module usually Cpu c and provides necessary system initialization such as PLL and external bus Sometimes it is necessary to do some special user initialization immediately after the cpu reset Processor Expert provides a possibility to insert user code into the _EntryPoint function There is a User Initialization property in the build options tab of a processor component inspe
76. ch as PLL and external bus Sometimes it is necessary to do some special user initialization immediately after the cpu reset Processor Expert provides a possibility to insert user code into the initialize hardware function There is a User Initialization property in the build options tab of a processor component inspector defined for this purpose See Component Inspector topic for details CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 123 Implementation details 3 4 4 3 PE low level init There is a second level of Processor Expert initialization ez 1ow 1evei init called at the beginning of the main function pz 1ow 1eve1 inic function provides initialization of all components in project and it is necessary for proper functionality of the Processor Expert project 3 4 4 4 OnReset event You can write the code that will be invoked from the pz 1ow 1evei inic function after Processor Expert internal initialization but before the initialization of individual components Thus you should expect that peripherals are not completely initialized yet This event can be enabled disabled in the processor component inspector s events page 3 4 5 Version specific information for 56800 E EX For more details on version specific information and Priority of Interrupts and Events see Processor Expert priority system topic 3 4 5 1 Chaining of timer channels The ti
77. ch cases there is an option in Processor Expert Project Options that completely disables the code generation See Processor Expert options for details 3 6 Embedded component optimizations This topic describes how the size and speed of the code could be optimized by choosing right component for the specific task It also describes how to setup components to produce optimized code The optimizations that are described are only for the High or Low level components not for the Peripheral Initialization components For more details refer to the following topics General optimizations General port I O optimizations Timer components optimizations Code size optimization of communication components 3 6 1 General optimizations This chapter describes how to setup Processor Expert and components to generate optimized code The following optimization are only for the High or Low level components and not for the Peripheral Initialization components CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 159 Embedded component optimizations 3 6 1 1 Disabling unused methods NOTE These optimization are not usable for the Peripheral Initialization Components When Processor Expert generates the code certain methods and events are enabled by default setting even when the methods or events are not needed in the application and thus while they are unused the code may still
78. ch gets current size of a used buffer can be used after each time the SendBlock RecvBlock method is called Use interrupts if you require faster application response The interrupt routine is performed only at the event time that is the code does not check if a character is sent or received Thus the saved processor time can be used by another process and application is faster CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 162 Freescale Semiconductor Inc N Chapter 3 Application design Use polling mode instead of interrupts if you require less code because usually overhead of interrupts is bigger than overhead of methods in polling mode But the polling mode is not suitable for all cases For example when you use the SCI communication for sending only the data and a character is sent once in a while then it is better to use the polling mode instead of using interrupt because it saves the code size that is when the interrupt is used an interrupt subroutine is needed and code size is increased 3 6 4 1 Examples A module of an application sends once in a while one character to another device through the SCI channel If the delay between two characters is sufficient to sent one character at a time then the polling mode of the SCI the AsynchroSerial component should be used in this case A module of an application communicates with another device that is it sends several characters at one time
79. checks components configuration and only valid combinations are allowed For details see Timing settings topic 3 4 7 1 3 Using complex timers in high level components The options of usage of the complex timers in the high level components allows you to benefit from the advanced features of these components All peripherals from this group are also supported by the Peripheral Initialization Components for details see Component categories topic CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 138 Freescale Semiconductor Inc Chapter 3 Application design The following table shows a list of the timer components and PE devices that can be used in the components as rows The columns show the state of all devices defined for the timer for conditions determined by rows Table 3 3 Timer components and PE devices Component Selected PE devices defined for the timer Selected device s TIMx TIMxy TIMxfree TIMx PPG TIMxPP TIMxyPPG PWM TIMxy Blocked Used 1 Blocked Blocked Blocked Blocked channel 2 in buffered mode Others free PPG TIMxPP Blocked All channels Blocked Used Used Used TIMxyPPG blocked TimerOut TIMxy Blocked Used 1 Free Blocked Blocked Blocked channel 2 in buffered mode Others free EventCntr8 TIMx Used All channels Blocked Blocked Blocked Blocked EventCntr16 blocked EventCntr32 Capture TIMxy Blocked Used 1 Free Blocked Blocked Blocked channel
80. conductor Inc 35 Components Library view SSy Components Library 25 Components proj 3 E 5 D Generator Configurations E OSs amp Processors Components H S api apc A pa1 Dac DMA1 DMAChannel H EE Wi SetDestinax e Code WW SetSourcePo Toggle Enable Disable A SetDestinationPointerMode M SetDatasize Iri GetDataSize Ini Start Ti Stop M GetStatus WE pMA1 OnComplete HED FIntt Fxttnt lt Figure 2 6 Components view 2 3 Components Library view To open this view click Window gt Show View gt Other and select Processor Expert gt Components Library The Components Library view shows supported embedded components including processor components and component templates It lets you select a desired component or template and add it to the project 2 3 1 Modes The Components Library has the following four tabs allowing you to select components in different modes e Categories Contains all available components The components are sorted in a tree based on the categories defined in the components For more details see Component categories topic e Alphabetical Shows alphabetical list of the available components e Assistant Guides you during the component selection process The user answers a series of questions that finally lead to a selection of a component that suits best for a required function For more details see Component Assistant topic e Processors Contai
81. ct repository file is detected then changes in the file can be showed using Compare file by content button This will open Eclipse base C Compare Viewer panel inside the Track Changes window and highlighting each change This way detailed review of changes can be done 3 10 12 Multiple properties accessing common register Embedded Components are functional oriented therefore allows settings that do not affect only one peripheral but several of them However it is also possible to access each peripheral individually one by one using the Peripheral Initialization Components This means that some specific hardware functionalities can be accessed from multiple components During application design Processor Expert verifies that component properties accessing the same functionality are not in conflict with other properties and if conflict is detected then informs user CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 178 Freescale Semiconductor Inc EES y Chapter 3 Application design For example pin routing involves configuration of multiple registers across different peripherals and it is possible to set it manually for each involved peripheral or just set required pin in pin property of Embedded Component that needs the pin for its function it consumes the pin Processor Expert searches its knowledge base for initialization value of all registers involved in pin routing and searches the project for an
82. ctor defined for this purpose Refer to the Component Inspector for details The first level of PE initialization in _EntryPoint contains 1 Disabling of the watchdog if required in Common settings Watchdog item in Cpu component 2 Initialization of the fast interrupt 0 and fast interrupt if they are used Initialization of the PLL interrupt priority 4 MCM Core fault settings including interrupt priority based on OnCoreFault event enabling and processor interrupts Interrupt Core Fault items in processor component 5 Initialization of the oscillators related pins based on settings of Clock properties in processor component 6 Initialization of the oscillators based on settings of Clock properties in processor component 7 If PLL is enabled initialization and enabling of the PLL and PLL interrupt based on Enabled speed modes High speed mode properties in processor component and PLL event setting 8 Initialization of the processor clock sources based on Enabled speed modes High speed mode Input clock source property o2 Now you are ready to do it yourself 3 4 2 2 C startup function The C startup function in the C startup module is called at the end of the EntryPoint function It provides a necessary initialization of the stack pointer runtime libraries At the end of the C startup function the main function is called 3 4 2 3 PE low level init There is a second level of Processor Expert initialization PE low
83. d not know the power mode change When opted for informing a peripheral device driver the DPM can build a semaphore object for low power acknowledgement from the device drivers When all such acknowledgements arrive ie Semaphore count equals zero the processor can be placed into a wait sleep power mode In the future with silicon design modifications these semaphores can be implemented in the hardware and as a result a much faster power mode change can be expected There is no DPM in typical bare metal applications the DPM task is implemented In this case DPM is substituted by a user application code CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 72 Freescale Semiconductor Inc eee SSS ee ee Chapter 3 Application design 3 2 2 Processor components A processor component is an Embedded Component encapsulating one processor type A Processor Expert project may contain one or more processor components The project generated for one processor is called an application Processors included in a project are displayed in the upper part of the Components view It is possible to switch among the processor component but only one of the processor can be active at one time The Build options accessible in the Component Inspector of the processor component allow you to set properties of the Compiler and Debugger if it is supported 3 2 2 1 Portability It is possible to change the target microcontroller dur
84. destination General amp cic amp Component Development Environment amp Install Processor Expert ra Export Board Configuration ES amp Remote Systems amp Run Debug Team Other ca Ce E E E Cancel Figure 3 18 Export wizard 2 Click Next The Export Processor Expert Component Settings page appears CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 105 a Configuring components Export Processor Expert Project Component Settings Export Processor Expert Component Settings Export selected component settings to the file Select project Select components OWE B C Generator Configurations Stesti1 489 FLASH try Processors 7 Cpu MkL25z1281k4 amp Components PWMTimerB TimerUnit_LDD PWMTimerRG TimerUnit_LDD I2C I2C LDD MIE csi01 Consolelo Select output file D Profiles b13706 workspace try try pef Figure 3 19 Export Processor Expert component settings page In the left panel select the project for which you want to export the component settings In the right panel select the components to export Click the Browse button to select the output file in which the export settings are saved The default location for saving the output file is recently selected folder your home directory The extension of the file is per 3 Click Fini
85. e Method Reset If the counter can t be reset is not allowed by HW or the counter is shared by more components this method stores the current value of the counter into a variable instead of a reset Method GetValue If the counter can t be reset is not allowed by HW or the counter is shared by more components this method doesn t return the value of register directly but returns the value as a difference between the register value and the previously stored register value This causes values that are proportional to time elapsed from the last invocation of the method Reset Method Latch This method causes capture of the counter in the hold registers of all capture and pulse accumulator components in PE project because this method is invoked for all ECT modules Method GetHoldValue This method transfers the contents of the associated pulse accumulator to its hold register NOTE See the Internal peripheral property group of the processor component for special settings BitIO BitsIO ByteIO Byte2IO Byte3IO Byte4IO The GetVal and GetDir methods are always implemented as macros LongIO This component could not be implemented on Freescale HCS12 this processor has no instructions for 32 bit access into the I O space IntEEPROM The EEPROM array is organized as rows of word 2 bytes the EEPROM block s erase sector size is 2 rows 2 words Therefore it is preferable to use word aligned data for writing methods S
86. e core module and all internal peripherals can be clocked from divided clock generator output or from divided internal or external reference clock Additionally internal peripheral 3 can be fed directly from internal reference clock and internal peripheral 2 also directly from external reference CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 79 Basic principles MCU Pin Clock generation and distribution Ej Clock consumers B m IRC Internal reference clock EXTAL External reference clock OSC Internal oscillator logic CG Clock generator e g PLL FLL etc Div Clock divider Core MCU core IPX Internal peripheral e g TMR UART ADC etc Figure 3 6 System timing scheme example In Processor Expert the orange blocks represents clock configuration and the green blocks represents embedded components As mentioned clock configurations are configured in the CPU processor component There user can make selection of used reference clock and specify configuration of clock generator modules and dividers Finally in CPU component user always select frequency of all major processor clocks such as core system or flash memory frequencies that is clock which define speed of the whole system or peripheral bus clocks which influence timing characteristics of chip internal peripherals embedded components relies on these values and use them as the input value
87. e Event module Main module cPureset j T _startup initialize hardware initialization PLL ext bus User code after PE init Initialization of the stack pointer runtime libraries memories 1 mang 1 I 1 1 1 1 First level of PE 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 L PE low level init l Second level of PE initialization Cpu_OnReset 1 I 1 l I 1 User event i l ggee 2 I to WM 4 1 1 1 if enabled l Legend User s code E Initialization code generated by Processor Expert fll User application code in event module 74 Call of a method or occurence of an event Return from method event or interrupt Interrupt Figure 3 30 Reset sequence diagram with Processor Expert 3 4 4 1 startup The startup function is called as the first function after the reset The _startup function initializes the stack pointer calls the initialize hardware function and continues with initialization of the enviroment such as memory initialization At the end ofthe startup function the maino function is called 3 4 4 2 initialize hardware The initialize hardware function is called from the _ startup function after an initialization of the stack pointer This function is defined in the cpu module usually Cpu c and provides necessary system initialization su
88. e addressing mode An address of the byte location is an address according to a 16 bit word location multiplied by 2 and then the even odd bytes are discriminated by LSB 0 for even byte 1 for odd byte PE does not check if the memory mode selected in the processor component corresponds to the current CodeWarrior target Thus it is needed to take care to the memory mode selection especially if the program and boot flash memory is served by the IntFLASH component if the program and boot flash memory has to be served by the component then one of the internal memory targets has to be selected e 56F83xx 56F81xx 56F80xx derivatives If the project contain both IntFLASH components one for each memory space then none of the components could be disabled in High speed mode CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 126 Freescale Semiconductor Inc Chapter 3 Application design If a programming erasing operation is started by component and it is configured not to wait until the end of the operation property Wait enabled in init method SetWait then calling of a programming erasing method of the other component is not allowed before the end of the programming erasing operation of the first component ERR_BUSY is returned 56F80x 56F82x derivatives Internal flash has no protection feature so the SetProtection and SetGlobalProtection methods are not implemented If the component is configu
89. e of the components settings see Components view and Component Inspector The following topics provide hints and information about how to configure the Embedded Components used in the project correctly and effectively Interrupts and events Configurations Design time checking consequences and benefits Timing settings Creating user component templates e Signal names Component inheritance and component sharing Sharing pins among peripherals Export and import 3 3 Interrupts and events It describes the details of interrupt and events processing in the code generated by Processor Expert An interrupt is a signal that causes the processor stop the execution of the code and execute the Interrupt service routine When the execution of the code is suspended the current state of the processor core is saved on the stack After the execution finishes the previous state of the processor core is restored from the stack and the suspended program continues from the point where it was interrupted The signals causing interrupts can be hardware events or software commands Each interrupt can have an assigned Interrupt Service Routine ISR that is called when the interrupt occurs The table assigning the subroutines to interrupts is called Interrupt Vector Table and it is completely generated by Processor Expert Most of the interrupts have corresponding Processor Expert Events that allow handling of these interrupts Processor Exp
90. e property Field name in the first Bit field group to LedPin From the drop down menu select the value for Pin as PTA10 it corresponds to LED17 on the tower board Set the Initial pin direction property to Output Set Auto initialization to yes Basic Advanced Expert ln C Properties Methods Events Name Value Details Port PTA PTA Port width 32 bits Mask of allocated pins 400 H Interrupt service event Disabled Bit fields 1 Bit field Field name Pins amp Pin Pin PTALO FTM2_CHO MIIO_R PTA1O FTM2 CHO MIIO RXD2 FB AD15 Pin signal Initial pin direction rr Initial output state 0 Figure 4 2 Component Inspector 3 In the Components view click TU1 TimerUnit_LDD component to open it in the Component Inspector CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 189 LEE Tutorial project for Kinetis microcontrollers 4 Set the following properties Counter PIT CVALO Counter direction Down Counter restart On match allows to set desired period of interrupt otherwise interrupt invocation period is fixed to counter overflow Period 500 ms Interrupt Enabled Auto initialization yes S Component Inspector TU1 Basic Advanced Expert I POLI E3 Properties _ Methods Events Mame Value Details Module name PIT PIT Counter PIT_CVALO PIT_CV ALO Counter direction Down Counter width 32 bits Value type Op
91. ean that you can implement more ideas into a CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 18 Freescale Semiconductor Inc E y Chapter 1 Introduction prototype application having a positive effect on the specification analysis and design phase PE justifies its existence even when used for this purpose alone e This system frees you up from the hardware considerations and allows you to concentrate on software issues and resolve them tis good for processors with embedded peripherals It significantly reduces project development time The primary reasons why you should use Processor Expert are Processor Expert has built in knowledge internal definition of the entire microcontroller with all its integrated peripherals Processor Expert encapsulates functional capabilities of microcontroller elements into concepts of configurable components Processor Expert provides an intuitive graphical user interface displays the microcontroller structure and allows you to take the advantage of predefined and already verified components supporting all typically used functions of the microcontroller Applications are designed by defining the desired behavior using the component settings drag and drop selections utilizing the generated methods and events subroutines and combining the generated code with user code Processor Expert verifies the design based on actual microcontroller resource and ti
92. ecific information for RSO8 without interrupt support and HCSO8 derivatives without IPC Interrupt Priority Controller eene 89 3 3 1 5 4 Version specific information for RSO8 with interrupt support esses 89 3 3 1 5 5 Version specific information for ColdFire V1 derivatives sess 90 PN MM e eid T 90 3 3 1 5 7 Version specific information for Kinetis and ColdFire derivatives 90 3 3 1 5 8 Version specific information for HCS08 derivatives with IPC Interrupt Priority C ONET e E 91 CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc EN Section number Title Page 3 3 1 5 9 Version specific information for HCS08 derivatives without IPC Interrupt Priority COMCO de Do UE 91 3 3 1 5 10 Version specific information for RSO8 with interrupt support eese 92 3 3 1 5 11 Version specific information for ColdFire V1 derivatives sss 92 3 3 1 5 12 Version specific information for HCS12X derivatives iere certior etn 92 3 3 1 5 13 Version specific information for HCS12 derivatives scies eeten o decretae petens 93 3 3 1 5 14 Version specific information far 56800 derivatives cec cna rtp rnt ran citas 93 3 3 1 5 15 Version specific information for 56800E derivatives sesia anuresia 93 Jaa Comeu T
93. ed initialization method name with its static implementation Also contains selected device independent component specific peripheral base address constant used as first parameter of PDD macros If interrupts are enabled header also contains component interrupt subroutine ISR declaration Generated modules are placed at project Generated_cod CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 175 SS SS SS _ Static code support in Processor Expert 3 10 8 Peripheral memory map files Static modules Processor variant h the file contains processor peripheral memory map implementation Processor Expert static code repository CodeWarrior Processor Expert lib Processor family iofiles Project static code repository at project static_Code I0_Map Generated modules IO Map h application interface header file Intended to be included in the application code to access processor specific peripheral memory map Generated modules are placed at Project Generated_Code 3 10 9 Common project files Static modules vectors c the file contains interrupt vector table and unused interrupts subroutines implementation Peripherals Init c the file contains Peripherals Init method which calls all peripheral initialization methods supported for selected processor See Reset Scenario topic of Implementation details for details on peripherals_tnit method
94. ed peripheral Refer to the Typical usage of peripheral initialization components topic for details For typical usage and hints on Logical Device Drivers LDD components refer to the Typical LDD components usage topic 3 5 3 2 Methods Enable Disable Most of the hardware components support the methods Enable and Disable These methods enable or disable peripheral functionality which causes disabling of functionality of the component as well Tip Disabling of the peripheral functionality may save processor resources Overview of the method behavior according to the component type Timer components timer counter is stopped if it is not shared with another component If the timer is shared the interrupt may be disabled if it is not also shared Communication components such as serial or CAN communication peripheral is disabled Conversion components such as A D and D A converter is disabled The conversion is restarted by Enable If the component is disabled some methods may not be used Refer to components documentation for details CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 153 a Code generation and usage MAIN C void main void B1 Enable enable the component functionality handle the component data or settings B1 Disable disable the component functionality 3 5 3 2 1 Methods EnableEvent DisableEvent Th
95. ee Static Code Support in Processor Expert topic Close Open Processor Expert Project closes the project if it is open or opens the project if it is closed Properties displays the Processor Expert properties for a specific project Edit Initialization Sequence modify the initialization sequence of components Export allows to export component settings or configuration of selected Processor Expert components Import allows to import component settings or configuration of selected Processor Expert components CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 34 Freescale Semiconductor Inc Chapter 2 User interface 2 2 2 Popup menu The menu content is specific for selected item This is the popup menu for Processors Inspector opens Component Inspector view for the component For more details see Component Inspector view topic e Inspector Pinned opens Component Inspector view for the component in pinned mode This command allows to have several inspector views for different components opened at once For more details see Component Inspector view topic Code Generation allows to disable enable the generated module for the component and CPU component Configuration Registers displays the Configuration Registers view for the peripheral initialized by the selected component For more details see Configuration Registers view topic Target Processor Package displ
96. ent 9 If PLL is enabled initialization and enabling of the PLL and PLL interrupt based on Clock settings OCCS Clock configurations Clock configuration 0 properties in processor component and PLL event setting 10 Initialization of peripheral clock rates and clock registers protection based on Clock settings OCCS Clock configurations Clock configuration O Peripheral clock rates and Clock settings OCCS Clock protection properties in processor component Un RU CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 121 Implementation details 3 4 3 2 C startup function The C startup function in the C startup module is called at the end of the _EntryPoint function It provides a necessary initialization of the stack pointer runtime libraries At the end of the C startup function the main function is called 3 4 3 3 PE low level init There is a second level of Processor Expert initialization rg 1ew 1eve1_init called at the beginning of the maino function pz_1ow_level_init 0 function provides initialization of all components in project and it is necessary for proper functionality of the Processor Expert project The second level of PE initialization contains 1 Initialization of all I O pins which are not used by any component based on Common settings Initialize unused I O pins properties in processor component 2 Initialization of the two s complement rounding
97. ent the component functionality is disabled as if the method Disable is used If the supported speed mode is selected again the component status is restored 3 5 3 2 3 TRUE and FALSE values of bool type Processor Expert defines the TRUE symbol as 1 however true and false logical values in C language are defined according to ANSI C e False is defined as 0 zero True is any non zero value It follows from this definition that the bool value cannot be tested using the expressions such as if value TRUE Processor Expert methods returning bool value often benefit from this definition and they return non zero value as TRUE value instead of 1 The correct C expression for such test is if value In our documentation the true or false are considered as logical states not any particular numeric values The capitalized TRUE and FALSE are constants defined as FALSE 0 and TRUE 1 CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 155 Code generation and usage 3 5 3 3 Typical usage of peripheral initialization components Init method is defined in all Peripheral Initialization Components Init method contains a complete initialization of the peripheral according to the component s settings In the following examples let s assume a component named Init1 has been added to the project The Init method of the Peripheral Initialization component can be
98. ents is based on the set of peripheral control registers These components cover all features of the peripherals and are designed for initialization of these peripherals Usually contain only Init method see Typical usage of peripheral initialization components topic for details The rest of the function has to be implemented using a low level access to the peripheral This kind of components are located at processor Internal Peripherals Peripheral Initialization Components of the components library and they are available only for some processor families The interface of these components might be different for a different processor The name of these components starts with the prefix Init_ Table 3 1 Features of components at different level of abstraction Feature LDD components High level Peripheral Init High level partially yes partially settings portable between Table continues on the next page CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 68 Freescale Semiconductor Inc y Chapter 3 Application design Table 3 1 Features of components at different level of abstraction continued Feature LDD components High level Peripheral Init different microcontroller families Portable method yes yes partially usually Init method only interface for all direct access to processor control registers families Processor mostly yes partially mostly yes full specif
99. eport errors and warnings notifying you about wrong property values or conflicts in the settings with other components in the project For more information see Design time checking consequences and benefits topic Processor Expert contains many useful tools for exploring a structure of the target microcontroller showing the details about the allocated on chip peripherals and pins Processor Expert generates a ready to use source code initializing all on chip peripherals used by the component according to the component setup 1 3 3 RTOS Support Processor Expert provides a set of LDD components Logical Device Drivers that support generation of driver code that can be integrated with RTOSes Real Time Operating Systems For more details see Logical Device Drivers topic 1 4 Terms and definitions used in Processor Expert Component An Embedded Component is a component that can be used in Processor Expert Embedded Components encapsulate the functionality of basic elements of embedded systems like processor core processor on chip peripherals standalone peripherals virtual devices and pure software algorithms and wrap these facilities to properties methods and events like objects in OOP Components can support several languages ANSI C Assembly language or other and the code is generated for the selected language Component Inspector Window with all parameters of a selected component properties methods events Bus clock A
100. er is a subroutine that is assigned to a specific event After the event is enabled Processor Expert generates the function with the specific name to the Event module Refer to the Code generation for details You can open the Event handler code if it already exists using a component pop up menu View Edit event module or double click on the event The event handler is an ordinary function and you need not to provide the interrupt handling specific code in the event code 3 3 1 4 Interrupt service routines When High or Low level components are used the interrupts functionality is covered by the events of the components The interrupt subroutines calling user s event handlers are generated to the component modules and PE provides parts of the background code necessary to handle the interrupt requests correctly The Peripheral Initialization components can only provide the initialization of the interrupt and generate a record to the Interrupt Vector Table You have to provide a full implementation of the interrupt subroutine Refer to the Typical usage of peripheral initialization components for details 3 3 1 5 Processor Expert priority system Some processors support selectable interrupts priorities You may select a priority for each interrupt vector The interrupt with a higher priority number can interrupt a service routine with the lower one Processor Expert supports the following settings in design time Interrupt priority and priori
101. erations are encapsulated by the PESL library commands which is effectively implemented using the simple control register writes See Processor Expert system library topic for details CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 167 Low level access to peripherals 3 8 5 1 Register access macros Processor Expert defines a set of C macros providing an effective access to a specified register or its part The definitions of all these macros are in the file PE_Types h The declaration of the registers which could be read written by the macros is present in the file IO Map h 3 8 5 2 Whole register access macros getReg w RegName Reads the register content setReg w RegName RegValue Sets the register content 3 8 5 3 Register part access macros testReg w Bits RegName GetMask Tests the masked bits for non zero value clrReg w Bits RegName ClrMask Sets a specified bits to 0 setReg w Bits RegName SetMask Sets a specified bits to 1 invertReg w Bits RegName InvMask Inverts a specified bits clrSetReg w Bits RegName ClrMask SetMask Clears bits specified by ClrMask and sets bits specified by SetMask 3 8 5 4 Access to named bits testReg w Bit RegName BitName Tests whether the bit is set setReg w Bit RegName BitName Sets the bit to 1 clrReg w Bit RegName BitName Sets the bit to 0 invertReg w Bit
102. ernal peripherals may be corrupted at the moment of the speed mode selection if function of clocked devices is enabled Handling of such a situation may be done using events BeforeNewSpeed and AfterNewSpeed PPG The PPG components always allocate whole timer Although it is possible to share the selected timer between 2 PPG components it would be impossible to set the PPG period for these two components separately PWM In contrast to the PPG components it is possible for PWM components to share the selected timer since they do not have the setrerioa method WatchDog When the Watchdog component is added to the project it is automatically enabled The enabling code is placed in the processor initialization code NOTE Watchdog is enabled by a write to the configuration register This register can be written only once after processor reset Since the register also contains other bits which are written during the processor initialization the watchdog must be enabled when processor is initialized The property CPU clock speed selection has no effect because the COP timer clock source is CGMXCLK AsynchroSerial Timing setting values from list enables to select various values denoted by changes of the prescaler most tightly coupled with UART SynchroMaster If a mode fault occurs the component is disabled at the beginning of the RecvChar method SynchroSlave When Clock edge property falling edge Shift clock idle polarity propert
103. ers usage and sharing uu esee seeeectrdeedeeservnd sn aneedenemeies 130 34 61 1 Single channel nier peripherals rrna aAa R E ana 130 SOA Multi channel tuner penpheralS ssrin eiai 130 3 4 6 1 3 Timing model restrictions for high level components 131 3 4 6 1 4 Using complex timers in high level components eene 132 DPR AMOR wee TS TAG Nee PI ecmTc e 133 Adols PCIE SE imitatio enano ea aa a AEA Ea Dub E DRE CM RE 133 3AGLF Eam ec 133 245 Denwsme on IOS using MONG onson tende dido oit tas b cdpeaidotopiariU aluo due epLG e LU edita tU dE 134 SSRDUAI Cupturmis unused wPEEUINS uu oder edet HEP UM AE TEEMEFENPL IP DIVA roe ERU MET IMP d e daro 134 34 Version specio information tor BONUS asideu ee sec ide oaa EE QM PC MER cq MU RAGIRR ELE 135 A451 R508 timers UBARO and SIREDUS siete tenen tone ien ate Erie EA A hata RE ERR OR MER 137 31 1 Simpie tuner penpleral siue enne RH REREIR A AR 137 SAM 2 Complex nec pertplietaliu uenerit ries rh tim Mox HPuleteoke TRR 137 S34 71 3 Using complex timers in high level GOmpORGBIS ease eser eter rd xi eet E xba nare dae 138 INF MU rog qu AAS cet E 139 SSRIAGS RCE siine DOR keee nA NENESE bed e RP a t ped kis bla eg 140 SAS Ve rsion specific information for HCS12 and BCS EZX ue uet au pe ERE ina raia BERE CAR tme RU PAS d bed 140 CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc Section
104. ert allows to configure interrupt priorities if they are supported by the processor see Processor Expert priority system for details CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 86 Freescale Semiconductor Inc E7 Chapter 3 Application design Processor Expert Events are part of the Embedded component interface and encapsulate the hardware or software events within the system Events are offered by the High and Low Level components to help you to service the events without any knowledge of the platform specific code required for such service Processor Expert Events can be enabled and disabled and have a user written program subroutines that are invoked when the event occurs Events often correspond to interrupts and for that case are invoked from the generated ISR Moreover the event can also be a software event caused by a buffer overflow or improper method parameter 3 3 1 1 Interrupts usage in component s generated code Some high level components use interrupt service routines to provide their functionality Usage of interrupts can usually be enabled disabled through property Interrupt service event If the interrupt service is used complete interrupt service routine is generated into component s driver and the generated code contains configuration of the corresponding peripheral to invoke the interrupts You should be careful while disabling an interrupt If a component should operate properly
105. es for the pin The selected values are written directly to PinSettings component for the pin Add Component Template adds a component or template for the appropriate peripheral all available components and templates suitable for the selected peripheral are listed The components and templates in the list are divided by a horizontal line It is possible to add only components or templates which are applicable for the peripheral It means that is possible to add the component or template only if the peripheral is not already allocated to another component or components The components templates that cannot be added to the peripheral are grayed in the pop up menu as unavailable This option is supported for all devices displayed on processor package e Remove Component allows to remove all components allocating peripheral in Processor view Processor component cannot be removed 2 6 Memory Map view To open this view click Window gt Show View gt Other and select Processor Expert gt Memory Map Figure below shows the processor address space and internal and external memory mapping Detailed information for an individual memory area is provided as a hint when you move the cursor over it Table 2 4 Legend white non usable space dark blue I O space blue RAM light blue ROM OTP or Firmware cyan FLASH memory or EEPROM This area can also contain a flash configuration registers area black external mem
106. ese methods enable or disable invocation of all component events These methods are usually supported only if the component services any interrupt vector The method DisableEvent may cause disabling of the interrupt if it is not required by the component functionality or shared with another component The method usually does not disable either peripheral or the component functionality MAIN C void main void B1 EnableEvent enable the component events component events may be invoked B1 DisableEvent disable the component events component events are disabled 3 5 3 2 2 Events BeforeNewSpeed AfterNewSpeed Timed components that depend on the microcontroller clock such as timers communication and conversion components may support speed modes defined in the processor component in EXPERT view level The event BeforeNewSpeed is invoked CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 154 Freescale Semiconductor Inc Ey y Chapter 3 Application design before the speed mode changes and AfterNewSpeed is invoked after the speed mode changes Speed mode may be changed using the processor component methods SetHigh SetLow or SetSlow EVENT C int changing speed mode 0 void B1 BeforeNewSpeed void void B1_AfterNewSpeed void changing speed mode changing speed mode NOTE If the speed mode is not supported by the compon
107. etWord and SetLong with word aligned address or to use virtual page property Page The size has to be a multiple of 4 bytes SynchroMaster The mode fault causes disability of the component and SPI device automatically inside interrupt service if interrupt service is enabled If the interrupt service isdisabled and a mode fault occurs the component will be disabled at the beginning of RecvChar method IntFlash CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 142 Freescale Semiconductor Inc ss Chapter 3 Application design The Virtual page Allocated by the user feature and corresponding methods and events are not implemented ExtInt If XIRQ is selected the method Disable can t be generated because it isn t supported by hardware For pins of H J and P ports it is not possible to switch pull resistor pull up pull down and sensitive edge rising edge falling edge arbitrarily Because of hardware limitations pull down with falling edge and pull up with rising edge settings aren t allowed 3 4 9 Version specific information for Kinetis and ColdFire Only the Peripheral Initialization and Logical Device Drivers LDD components are available for the Kinetis and ColdFire derivatives For details see Logical Device Drivers and Component categories topics Kinetis and ColdFire processor components support Clock configurations that are similar to Speed Modes available with H
108. f the example project that you would like to use Click Finish 2 Code generation CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 63 Le Basic principles After opening an example invoke the code generation of the project to obtain all sources In the project tree right click the ProcessorExpert pe file and select the Generate Processor Expert Code command The generated code is placed in the Generated_Code sub folder of the project NOTE See Processor Expert tutorials topic for step by step tutorials on creating Processor Expert projects from the beginning 3 2 Basic principles The application created in Processor Expert is built from the building blocks called Embedded Components The following topics describe the features of the Embedded components and the processor components that are special type of Embedded Components and what they offer to the user Embedded components Processor components 3 2 1 Embedded components Embedded components encapsulate the initialization and functionality of embedded systems basic elements such as microcontroller core on chip peripherals for details on categories of components delivered with Processor Expert see Component categories topic FPGAs standalone peripherals virtual devices and pure software algorithms These facilities are interfaced to the user through properties methods and events It is very similar t
109. for timing features they encapsulate The relationship between clock configurations set in the CPU processor component and embedded components is explained in Support of clock configurations in embedded components topic There is always at least one clock configuration in the project Clock configuration 0 However it is possible to use more clock configurations in the same project For example use case of multiple clock configuration is in Multiple clock configurations topic 3 2 2 8 3 2 Multiple clock configuration Every Processor Expert project uses at least one clock configuration to set main system clock s configuration and distribution However it is possible to predefine up to eight in case of Speed modes it was up to three ones different timing schemes and switch between them during runtime by setclockconfiguration CPU processor method call CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 80 Freescale Semiconductor Inc ET Chapter 3 Application design This is useful in case of low power oriented applications as there can be separate high speed when fast computation is needed and low power timing schemes when chip goes idle and application can easily switch between them The following example is a use case of simple battery powered application which will use two clock configurations In this scenario the application will put the microcontroller in low power state waiting for exte
110. functionality while ensuring project portability This topic explains the concept and its application in LDD components e Clock configuration e Multiple clock configurations e Clock Configuration 0 e Support of clock configurations in components 3 2 2 8 3 1 Clock configuration Typical processor or microcontroller allows multiple reference clock sources usage contains clock synthesis modules to process these reference clocks and distribute them across the system This system timing scheme provides a set of clocks produced by the system modules and is described as a clock path which starts at selected reference clock source such as internal oscillator or external crystal and ends at variety of processor internal clocks such as core instruction clock or other clocks consumed by internal peripherals Clock configuration is feature allowing design time creation and management of multiple system timing schemes and is handled by a CPU processor component This feature is derived from the Speed modes used by the high level components For more details see Speed modes support topic The following schematic illustrates a simple system timing scheme It consists of internal and external reference clock general clock generator module and several internal modules that can consume variety of clocks The orange block represents modules involved in clock generation and distribution whereas blue and green blocks denote clock consumers For exampl
111. gs m CsIO1 Cor lt i n Figure 3 23 Import component settings page To import component settings from the file to selected project click the Browse button Select the input file with the pefor peb or pe extension The default option Replace settings is selected if imported component settings are having same name or ID and type You can select the mode for importing components settings the options are Ignore do not import this component settings Add new add new component with imported settings Add new keep existing if component with same name or type exists it will add a new component with imported settings and keep the existing one may cause conflicts Add new disable existing if component with same name or type exists it will add a new component with imported settings and disable the existing one Replace settings replace existing component with new settings from imported file CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 110 Freescale Semiconductor Inc eee a 7 Chapter 3 Application design 3 Click Finish The settings from the pe file is imported to the selected project You are ready to import component settings 3 3 9 4 Apply board configuration You can import board configuration from a file The imported configurations are added into the selected project To import board configuration 1 In the IDE select File gt Import T
112. he Import wizard appears Expand Processor Expert tree Select Apply Board Configuration option as shown below CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 111 Configuring components Select Apply Board Configuration Select an import source type filter text General amp cic CodeWarrior Example Project Y MCU Executable Importer gt Component Development Environment amp cvs Install Processor Expert Eg Apply Board Configuration Component Settings to Project S Component s to Components Library H Run Debug gt Software Analysis HH Team gt Other lt Back Finish Figure 3 24 Import wizard 2 Click Next The Apply Board Configuration page appears CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 112 Freescale Semiconductor Inc EE Chapter 3 Application design Apply Processor Expert Board Configuration Apply Board Configuration Import selected component settings from the file to selected project Select input file D Profiles b13706 try peb Browse Select target project Select mode For import of component settings S 12c_ReB Imported component Mode Corresponding target component testi dl Cpu MkL252128LK4 CD Replace settings CpuiMkL25z128Lk4 try E PwMTimerB TimerUnit LDD gt Replace settings e PWMTimerBC Ti
113. he Language and Build Tool Options page set C in Languages page Click Next In the Rapid Application Development page select the Processor Expert from Rapid Application Development group and click Finish The new project is created and ready for adding new components For adding new components see Adding components topic 4 1 2 Adding components L In the Components Library view switch to Alphabetical tab and find a GPIO_LDD component and from its pop up menu invoked by the right mouse button select Add to project option Find TimerUnit_LDD component and from its pop up menu invoked by the right mouse button select Add to project option The components are now visible in the Components folder in the Components view CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc ET Chapter 4 Processor Expert tutorials zw 77D Sy Components Library Sy Processor Generator angie S mk600 256VL910_INTERNAL_RAM E MK60DX256VLO10 IMTERMAL FLASH H OSs Processors GJ Cou MK60DX256VLO10 Es 4 Cpu MK60DX256VLO10 E B Components TU1 TimerUnit_LDD GPIO1 GPIO_LDD Figure 4 1 Component view For configuring new components see Configuring components topic 4 1 3 Configuring components 1 In the Components view double click GPIO1 GPIO_LDD component to open it in Component Inspector view 2 In the Component Inspector view set th
114. he Timing dialog shows the list of values ranges that are allowed to be set It might be necessary to increase the allowed error using the Error field in the Timing dialog that specifies the allowed difference between the required value and possible value that can be produced by the hardware Settings for the device are mutually incompatible or can t be used with another device In this case the problem is reported by all components that share some timing hardware Due to dependencies between used parts of the timer it is necessary to adjust the values of the shared elements such as prescalers to the same value For example if two rimerint components are using two channels of one timer and all timer channels are connected to one common prescaler it is not possible to set the values that would require a different prescaler values In this case it is useful to manually adjust the prescaler values of all components to the same value switch to Expert view mode and adjust the property in the Component Inspector view The Runtime setting from interval is selected and it is not possible to set the values CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 97 Configuring components The required run time settings are outside the range of one prescaler This is a limitation of this mode of runtime setting 3 3 4 3 Run time timing settings limitation Some components al
115. he current project state is memorized Configurations of the current project are listed in the Generator_Configurations folder of the Components view Configurations can also hold additional settings that may influence code generation These settings can be changed in the configuration inspector See Configuration Inspector for details The symbol for conditional compilation is defined if it is supported by the selected language compiler The symbol PEcfg ConfigurationName is defined in the processor interface You can switch using this symbol between variants of code according to the active configuration see example in this chapter Configuration also stores which processor is selected as the target processor If the name of the configuration matches the name of one of the CodeWarrior s targets the target is automatically selected as an active target when the user runs code generation NOTE It is possible to have two components with the same name in project Each of the components could be enabled in different configuration This way you can have different setup of a component a component with the same name in multiple configurations 3 3 2 1 Example Suppose there is a configuration named testing case You can use a component and part of our code using the component only in the testing case configuration Then you can make the testing case configuration active After the successful code generation the cpu n file contains t
116. he following definition Active configuration define symbol define PEcfg Testingcase 1 CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 94 Freescale Semiconductor Inc ESSSSS_D__ _ SR Se Chapter 3 Application design Add the following lines ifdef PEcfg TestingCase Component MethodCall endif 3 3 83 Design time checking consequences and benefits During the design time Processor Expert performs instant checking of the project As a result of this checking error messages may appear in the Problems view or directly in the third column of the Component Inspector on the faulty items line Sometimes it may happen that only one small change in the project causes several general error messages 3 3 3 1 On chip peripherals Some components use on chip peripherals In the Component Inspector you can choose from all possible peripherals that can be used for implementation of the function of the current component Processor Expert provides checking for required peripheral features such as word width and stop bit for serial channel pull resistor for I O pin and others Processor Expert also protects against the use of one peripheral in two components If the peripheral is allocated for one component then the settings of this peripheral cannot be changed by any other component The state of an allocated peripheral should never be changed directly in the user code using special regi
117. hout interrupt support because they depend on interrupt s ExtInt TimerInt FreeCntr8 FreeCntr16 FreeCntr32 RTIshared InterruptVector TimeDate Derivatives of the RS08 family with processor core version 2 support a single global interrupt vector The interrupt doesn t support a vector table lookup mechanism as used on the HC S 08 devices It is the responsibility of a routine servicing the global interrupt to poll the system interrupt pending registers SIPx to determine if an interrupt is pending To support the single global interrupt vector Processor Expert defines a set of emulated interrupt vectors for each HW module which duplicates interrupt vectors of the HCS08 family When an emulated interrupt vector is used by CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 135 Implementation details a component a call to the appropriate interrupt service routine is added to the global interrupt service routine The global interrupt vector routine performs check of the SIPx registers to determine if an interrupt is pending The order in which the SIPx registers are polled is affected by priority of the emulated interrupts For priority settings see Processor Expert priority system topic for details Processor Speed Mode selection processor methods SetHighSpeed SetLowSpeed SetSlowSpeed if processor clock dependent components are used then signals generated from such int
118. ic peripheral features support Low level partially no partially yes peripheral initialization settings Speed mode yes yes mostly yes no independent timing Events support yes yes yes no direct interrupt handling Software no yes no no emulation of a component function if the specific hardware is not present Support for yes no no no RTOS drivers creation 3 2 1 8 Logical Device Drivers Logical Device Drivers were developed to offer users the Hardware Abstraction Layer HAL for bare metal applications as well as RTOS applications The components provide tested optimized C code tuned to the application needs The code may be tuned to the specific RTOS when the RTOS component is in the project 3 2 1 8 1 Differences between LDD and high level components Each component provides tnit method to initialize appropriate peripheral and driver init 0 method returns a pointer to driver s device structure CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 69 R T Basic principles e Each component provides peinit o method to de initialize appropriate peripheral and driver The first parameter of each component s method is a pointer to a device structure returned from rnit method It is up to you to pass a valid device structure pointer to component s methods null check is highly recommended e The nit
119. idually configurable channels and usually do not allow to control any pins These devices cannot be shared i e used by multiple components The following devices are members of this group on RS08 RTI MTIM These devices are usually listed in Processor Expert under their original names without any extensions These devices can be used by the TimerOut component The MTIM peripheral can additionally be used in event counter components EventCntr8 16 32 All peripherals from this group are also supported by the Peripheral Initialization Components for details see Component categories 3 4 7 1 2 Complex timer peripherals These timer peripherals provide multiple channels and allow several modes of operation The RSO8 contains only one device of such kind TPM Timer PWM modules Processor Expert shows each of these timer peripherals as multiple devices that can be used by the components The name of such device shown in the peripheral selection list consists of the peripheral and a suffix specifying the part of the peripheral or it s specific function These named devices represent the whole peripheral or parts of the peripheral set to work in a specific mode Using only a part of the timer allows to share the timer by multiple components The following devices are usually defined for the complex timer peripherals the examples are for MCORS08SA12 processor CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014
120. ify the name on function invoked in the case of event occurrence They are usually invoked from the internal interrupt service routines generated by Processor Expert If the enabled event handling routine is not already present in the event module then the header and implementation files are updated and an empty function without any code is inserted You can write event handling code into this procedure and this code will not be changed during the next code generation All Methods and Events of each component inserted into the project are visible as a subtree of components in the Components view 3 2 1 5 Interrupt subroutines Some components especially the low level components and the Peripheral Initialization components for more details see Component categories topic allow to assign an interrupt service routine ISR name to a specific interrupt vector setup The name of the Interrupt service is generated directly to the interrupt vector table and you have to do all necessary control registers handling within the user code See Typical usage of component in user code topic for details ISRs items are listed in the subtree of a component in the Components view v Up ADC1 Init_ ADC V M Init I 8 lConvComplete lSR name of INT ADCA Complete B ZeroCross ISR name of INT ADCA ZC LE Figure 3 1 Example of a component with two ISRs 3 2 1 6 Highly configurable and extensible library Embedded components can be cre
121. igh Level components but provide more options on configuring low power and slow clock modes of the processor Refer to the details on individual settings in the processor component s on line help 3 5 Code generation and usage It explains you about the principles and results of the Processor Expert code generation process and the correct ways and possibilities of using this code in the user application For more details see the following topics Code generation Predefined Types Macros and Constants Typical usage of component in user code User changes in generated code 3 5 1 Code generation ProcessorExpert pe pop up menu Generate Processor Expert Code Generate Code command initiates the code generation process During this process source code modules containing functionality of the components and CPU components contained in the project are generated During this process source code modules containing CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 143 p Code generation and usage functionality of the components contained in the project are generated The project must be set up correctly for successful code generation If the generation is error free all generated source code files are saved to the destination directory There are two options available Always Write Generated Component Modules Don t Write gene
122. independent interrupt priority values in Processor Expert described above are mapped to these values 3 3 1 5 3 Version specific information for RS08 without interrupt support and HCS08 derivatives without IPC Interrupt Priority Controller These derivatives do not support interrupt priorities The interrupt priority settings for example imported from a project for another processor are ignored 3 3 1 5 4 Version specific information for RSO8 with interrupt support On these RS08 derivatives the interrupts are handled through single interrupt vector The priority of each individual emulated interrupt is determined by order in which the SIPx registers are polled in the sofware handler The priority can be in the range CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 89 L S Configuring components 0 number of interrupts 1 for example 0 15 The lower is the number the higher is the priority The platform independent interrupt priority values in Processor Expert described above are mapped to these values The default priority depends on the position of an associated bit in a SIPx register The interrupt priority can be changed to any value within the allowed range Interrupts with lower priority number higher priority of execution are polled first If two interrupts have assigned the same priority number then the order in which they are polled depends on the default pr
123. individually configurable channels and usually do not allow to control any pins These devices cannot be shared that is used by multiple components The following devices are members of this group e HC08 PIT TIM on some derivatives TBM PWU RTC e HCS08 RS08 ColdFire V1 RTI CMT MTIM RTC TOD These devices are usually listed in Processor Expert under their original names without any extensions These devices can be used by the following high level components TimerInt RTIshared TimerOut and FreeCntr8 16 32 The MTIM peripheral can additionally be used in event counter components EventCntr8 16 32 All peripherals from this group are also supported by the Peripheral Initialization Components Component categories 3 4 6 1 2 Multi channel timer peripherals These timer peripherals provide multiple channels and allow several modes of operation The following devices are members of this group CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 130 Freescale Semiconductor Inc EE Chapter 3 Application design HC08 TIM Timer Interface Modules HCS08 RS08 ColdFire V1 TPM and FTM Timer PWM modules Processor Expert shows each of these timer peripherals as multiple devices that can be used by the components The name of such device shown in the peripheral selection list consists of the peripheral and a suffix specifying the part of the peripheral or it s specific function These named
124. ing the development of an application and even to switch between multiple microcontrollers This can be done simply by adding another processor to the project and selecting it as the target processor To connect the new processor peripherals to the application components correctly it is possible to specify the processor on chip peripheral names This way the same peripheral could be used on different processor derivatives even if the original name is different 3 2 2 2 Adding a processor to a project 1 In the Components Library view select the Processors tab and find the desired processor component 2 Double click the desired processor icon to add it to the project When the processor component is added it appears in the upper part of the Components view If selected as the target processor the processor will be displayed in the Processor view 3 2 2 3 Selecting a processor as target processor The first microcontroller added to the project is automatically selected as the target processor It means that code will be generated for this microcontroller When there are more than one processor in the project the target processor can be changed by following these steps 1 Right click the processor icon in the Components view to display a pop up menu 2 Select Select processor as target and the required processor is selected CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc
125. init method of each component uses a dynamic allocation of its device structure through the RTOS API peinit method of each component uses a dynamic de allocation of its device structure through the RTOS API e Interrupt Service Routines are allocated through the RTOS API in tnit method and de allocated in peinit method of each component The Interrupt table is not generated from processor component in case whether RTOS provides runtime allocation of interrupt service routines CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 70 Freescale Semiconductor Inc EE Chapter 3 Application design The Linker Command File LCF is not generated from processor component in case that RTOS provides its own LCF for applications The main module ProcessorExpert c is not generated if specified in RTOS adapter For information and hints on LDD components usage refer to the Typical LDD components usage topic for details 3 2 1 8 4 RTOS adapter The RTOS adapter component is a way how to utilize generated code to the specific RTOS The RTOS adapter provides necessary information to the driver which API should be used to allocate memory create a critical section allocate interrupt vector Microcontroller Application Embedded RTOS File System Graphics Kernel l O Map co Ej Initialize Hardware Figure 3 2 Example of HAL
126. initialization modules System the directory with system and common source code modules including processor modules 3 10 5 Project static modules Embedded Components with static code support uses or creates several project files These files can be divided into following groups Processor component files Peripheral Initialization Component files Peripheral memory map files Common project files Each Embedded Component with static code implements the following modules e Static modules with peripheral initialization code module name has _rnit suffix Configuration header files with parameterization of the static module header file name has config suffix Parameterization constant are controlled by component properties Generated component interface header file header file has the same name as the component 3 10 6 Processor component files Static modules e cpu Init c the file contains startup initialization code and processor runtime methods code e cPU Init h the file contains declaration of runtime methods and their input parameter types CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 174 Freescale Semiconductor Inc E B SSS Chapter 3 Application design For more information on processor runtime methods refer to the documentation of specific processor component For detailed startup code description see Reset Scenario topic of Implementation details
127. ion is performed when a speed mode is changed that is the peripheral continues to run with the same configuration for all speed modes No speed mode handling code is generated for this component The component timing values are valid only for high speed mode The following features are available for high level components if the processor clock speed selection is not set to ignored During the design all the timing related settings for such a component are checked to be correct in all the speed modes that the component supports and the component is enabled in these modes If the speed mode is changed the current timing components are preserved recalculated to be the same in the new speed mode except the timing that is set at runtime from interval If the processor speed mode is changed to a mode that the component does not support for any reason the component is disabled right after the processor speed mode is changed Otherwise the component is enabled Before or after the speed mode is changed the BeforeNewSpeed and AfterNewSpeed event functions are called CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 78 Freescale Semiconductor Inc EE Chapter 3 Application design 3 2 2 8 3 Clock configurations support Clock configurations are available for Kinetis Vybrid Cold Fire and MC56F82xxx families As in case of speed modes the purpose of clock configuration is to offer power management
128. iority For more details on interrupts on RSOS refer to the Version specific information for RSOS topic 3 3 1 5 5 Version specific information for ColdFire V1 derivatives On the ColdFire V1 platform an interrupt priority of an interrupt is determined by an Interrupt Level 1 7 and a Priority within Level 0 7 Refer to the processor data sheet for interrupt priority system details The applied interrupt priority value the value displayed in the third column of the Component Inspector contains both values For example Level 4 priority within level 6 The target independent values of interrupt priority for example minimum maximum are mapped either to the default priority of the selected interrupt or to Level 6 Priority within level 6 or level 6 Priority within level 7 3 3 1 5 6 Priority of event code Priority of event code is not supported for Kinetis and ColdFire 3 3 1 5 7 Version specific information for Kinetis and ColdFire derivatives Priority of event code is not supported for Kinetis and ColdFire You can also select a priority for the processing of the event code This setting is available for the events that are invoked from the Interrupt Service Routines This priority may be different from the interrupt priority However the meaning of the number is same the event may be interrupted only by the interrupts with the higher priority Processor Expert offers the following architecture independent values same
129. ipse IDE as plugin application The IDE main menu contains a new menu item named Processor Expert The Processor Expert menu includes Show views Shows standard Processor Expert windows in case they are hidden Hide views Hides Processor Expert views Import Component s This command allows to select and install Processor Expert update packages pzupa files These files can be for example created in CDE by exporting a user s component 2 1 1 Project pop up menu This menu is available on right clicking at the processorzxpert pe file It contains the standard CodeWarrior commands with the Processor Expert specific command Generate Processor Expert Code Invokes code generation for the current project The generated files are automatically inserted into the active default target in the CodeWarrior s project Generated files corresponding to the Embedded Components can be accessed from the Generated Code folder For more details see Code Generation topic For Processor Expert related settings and options see Processor Expert Options 2 1 2 Processor Expert options This section contains the following topics Project options Preferences 2 1 2 1 Project options Project options related to Processor Expert can be found in Properties dialog To access this dialog click Project Properties The Properties dialog appears Select Processor Expert option in the list on the left Description of the individual opti
130. irectory with system and common source code modules including processor modules 3 10 4 Processor Expert static code directory structure Processor Expert uses the following sub directory structure within the project directory Generated Code the directory containing all generated source code modules for components Among others this directory stores components interface headers and configuration header files included in the static modules for static code parameterization Documentation the directory with the project documentation files generated by Processor Expert CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 173 Static code support in Processor Expert Sources the directory for main module event module and other user modules Static Code the directory containing project static code repository with all static source code modules Project static code repository contains either copy in case of standalone project or link in case of linked project to Processor Expert static code repository Names of sub directories are customizable in Project options Static source code sub directory contains O Map the directory with processor peripheral memory map file PDD the directory containing Physical Device Drivers PDD header files For more information on PDD see Physical device drivers topic Peripherals the directory containing all peripheral
131. is not changed interrupts disabled All maskable interrupts are disabled The state of the register CCRH is not changed e 0 Same as interrupts disabled e 7 Priorities from lowest 1 to highest 7 The code generated by Processor Expert before the event invocation sets the event code priority to the specified value by writing to the CCRH register and enables interrupts CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 92 Freescale Semiconductor Inc Ey Chapter 3 Application design e same as interrupt Default behavior of the architecture no interrupts can interrupt the event It is same as Interrupts Disabled e Other values are mapped to the priorities 1 7 3 3 1 5 13 Version specific information for HCS12 derivatives Processor Expert offers the following event priority options e interrupts disabled All maskable interrupts are disabled e interrupts enabled All maskable interrupts are enabled Note that this settings might lead to possible problems see the warning within this chapter e same as interrupt Default behavior of the architecture no interrupts can interrupt the event It is same as Interrupts Disabled 3 3 1 5 14 Version specific information for 56800 derivatives Processor Expert offers the following event priority options e interrupts enabled Interrupts are enabled so the event routine can be interrupted by another interrupt e interrupts disabled All
132. istory available in Components view It allows to compare files with the version before the code generation CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 147 Vee S B Code generation and usage 3 5 2 Predefined Types Macros and Constants Processor Expert generates definitions of all hardware register structures to the file 10 Map h The Processor Expert type definitions are generated to the file pz_types n which also contains definitions of macros used for a peripheral register access See Direct access to peripheral registers topic for details 3 5 2 1 Types The following table lists the predefined types and their description Table 3 4 Predefined types byte 8 bit unsigned integer unsigned char all bool Boolean value unsigned char TRUE Jall any non zero value FALSE 0 word 16 bit unsigned integer unsigned int all dword 32 bit unsigned integer unsigned long all dlong array of two 32 bit unsigned integers all unsigned long TPE ErrCode Error code uint8 t all except MPC55xx 3 5 2 2 Structure for images typedef struct Image word width Image width in pixels word height Image height in pixels byte pixmap Image pixel bitmap word size Image size in bytes char name Image name TIMAGE typedef TIMAGE PIMAGE Pointer to image CodeWarrior Develo
133. it is necessary to allow the interrupt invocation by having interrupts enabled and if the processor contains priority system set the corresponding interrupt priority level This can be done using the appropriate method of the processor component NOTE It is a common bug in user code if the application is waiting for a result of the component action while the interrupts are disabled In this situation the result of the component method does not change until the interrupt service routine is handled Refer to the description of the property Interrupt service event for detailed information about the particular component 3 3 1 2 Enabling event Functionality of each event can be enabled or disabled You can easily enable the event and define its name within the Component Inspector of the appropriate component Another possibility is to double click an event icon in the component s subtree or use a pop up menu in the Component Inspector view CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 87 Configuring components x Component Inspector 3 Basic Advanced Expert V Gl Properties Methods Events Event module name BeforeNewSpeed AfterNewSpeed ate code El OnInterrupt generate code Event procedure name Priority same as interrupt H Figure 3 10 Event example in the Component Inspector Events tab 3 3 1 3 Writing an event handler Event handl
134. king shifting etc 3 8 4 Processor Expert system library NOTE PESL is supported only for 56800 E PESL Processor Expert System Library is dedicated to power programmers who are familiar with the microcontroller architecture each bit and each register PESL provides macros to access the peripherals directly It should be used only in special cases when the low level approach is necessary PESL is peripheral oriented and complements with Embedded Components which are functionality oriented While Embedded Components provide very high level of project portability by stable API and inheritance feature across different CPU DSP PPC architectures PESL is more architecture dependent PESL commands grouped by the related peripheral can be found in Processor Expert Project Panel in PESL folder 3 8 4 1 Convention for PESL macros Each name of the PESL macro consists of the following parts PESL device name command parameter Example m PESL SCIO SCI SET BAUDRATE 0 CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 166 Freescale Semiconductor Inc Chapter 3 Application design 3 8 4 2 Using PESL and peripheral initialization components For every Peripheral Initialization Component for details see Component categories topic there is a C macro defined by Processor Expert with the name component name _pevice This macro results to the name of the peripheral selected in the component named comp
135. l Initialization component 25 PESL 25 CodeWarrior Development Studio Processor Expert User Guide 194 Freescale Semiconductor Inc PESL h 146 PIT 30 PLL 25 Popup menu 25 PPG 128 141 Predefined Types 148 Preferences 29 Prescaler 25 Processor 25 127 Processor component 23 Processor Expert 6 Processor External Devices 67 Processor Internal Peripherals 67 Processor Memory Map 35 Processor module 44 Processors 36 Project Options 28 Properties 25 53 PulseAccumulator 47 PWM 126 141 PWU 130 R Refresh 37 Remove component 35 Rename Component 35 Resources 47 RTC 130 RTIshared 30 RTOS 25 S Save component 35 seconds 53 Shared Ancestor 0 Shared modules 745 Show Views 28 Signal names 45 Signals names 99 Sources 170 Speed Mode 27 startupfile c 46 SW 67 SynchroMaster 42 SynchroSlave 729 I Target Processor Package 35 Template 25 TimeDate 728 TimerInt 30 TimerOut 30 Timer ticks 53 TIMx 131 Index TIMx PPG 7 31 TIMxfree 3 TIMxPP 131 TIMxy 131 TIMxyPPG 31 TOD 130 Toggle Enable Disable 35 U UART 728 Unused components 760 Unused Methods 160 Use after reset values 54 User defined component template 25 User module 25 V Vectors c 45 View Code 35 View Menu 34 W WatchDog 128 WatchDog Component 125 WordIO 729 X Xtal 25 CodeWarrior Development Studio Processor Expert User Guide Freescale Semiconductor Inc 195 Index C
136. l in their name This is how pins can be easily identified CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 182 Freescale Semiconductor Inc Chapter 3 Application design Properties N Methods Events Name Value Details S Component name ACi Analog comparator CMPO CMPO Interrupt service event Disabled 4 Positive inputs 1 4 Positive input 0 Er A Pin DAC12b0_Output CMPO0 INO PTC6 LLWU P10 Source component CMPO INO PTC6 LLWU P10 SPI0 MOSU EXTRG IN SPI0 MISO 4 Negative inputs CMPO0 IN1 PTC7 SPD MISO SPI0 MOSI 4 Negative input 0 CMPO IN2 PTC8 2C0 SCL TPMO CH4 E A Pin CMP0_IN3 PTC9 12C0_SDA TPM0_CH5 Source component CMP0_INS ADCO_SE4b PTE29 TPM0_CH2 TPM_CLKINO Comparator output DACO OUT ADCO SE23 CMPO IN4 PTE30 TPMO CH3 TPM CLKINI Output filter Inverted output Analog comp mode Power mode Figure 3 35 Multiple analog comparator inputs in AnalogComp LDD However Processor Expert offers clear differentiation between internal signals and pins as shown in figures below Properties _ Methods Events Name Value Details Component name ACI Analog comparator CMPO CMPO Interrupt service event Disabled 4 Positive inputs 1 4 Positive input 0 A Pin CMPO_INO PTC6 LLWU_P10 SPI0_ CMPO_INO PTC6 LLWU_P10 Source c it ae z Positive analog comparator input pin a Negativeinputs peripheral description HSCMPO input 0 General purpose IO Port C bit 6 Low leakage wake up pi
137. lag is cleared immediately after the interrupt occurs Content of the capture register can be updated immediately with any input active transition Interrupt service is enabled and event oncapture is enabled It is recommended to use the method cetcapturevaluewithin oncapture event Content of the capture register is protected against the change until the end of oncapture event only 3 4 5 3 TimeDate component It is recommended to set a resolution to multiples of 10 ms resolution of the time provided by the cecrine settime methods It should be 10ms or more Smaller values are unnecessarily overloading the system 3 4 5 4 PulseAccumulator component This component is generally used to count pulses events generated on external inputs Thus the primary and secondary input can only be a physical pins of the device The primary input is required to be an internal clock the Init TMR component should be used 3 4 5 5 WatchDog component The interrupt service routine for the vector tnr_copreset is generated only if the OnWatchDog event is used Otherwise the rwr copresec entry in the interrupt vector table contains only the call of the zutzysoint which is same as zur gesec service routine You can find out the cause of the reset by using a processor component method cetresetsource 3 4 5 6 FreescaleCAN component This component can encapsulate r1excaw device or mscaniz device FlexCAN device CodeWarrior Development Studio Process
138. le component it has an icon of the component and there is a component name at the end of the list line and user double clicks it it is added into the project Also you can right click on the line to open the pop up menu of the component allowing to add it into the project or view its documentation for details see Components Library view topic If more questions are necessary for the component selection the line with the answer contains a group icon and in brackets a number of components that still can possibly be selected After clicking on such line a next question is displayed CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 38 Freescale Semiconductor Inc E Chapter 2 User interface This mode of Components Library does not offer addition of processor components If you would like to add another processor component switch to processors tab 2 4 Component Inspector view Component Inspector allows to view and edit attributes of the item selected in the Project Explorer To open this view click Window gt Show View gt Other and select Processor Expert gt Components Inspector Inspector window displays three columns e Name name of the item to be selected Group of items may be collapsed or expanded by double clicking on the first line of the group with its name it has or sign on the left Value the settings of the items are made in this column For list of item types
139. llers allowing to develop simpler and more portable RTOS drivers or bare board application For more details refer to the Logical Device Drivers topic Processor Expert allows to examine the relationship between the embedded component setup and control registers initialization e You can create your own components using the Component Development Environment CDE tool An intuitive and powerful user interface allows you to define the system behavior in several steps A simple system can be created by selecting the necessary components setting their properties to the required values and also dragging and dropping some of their methods to the user part of the project source code The other key features are Design time verifications Microcontroller selection from multiple microcontroller derivatives available Microcontroller pin detailed description and structure viewing Configuration of functions and settings for the selected microcontroller and its peripherals Definition of system behavior during initialization and at runtime Design of application from pre built functional components Design of application using component methods user callable functions and events templates for user written code to process events e g interrupts Customization of components and definition of new components Tested drivers Library of components for typical functions including virtual SW components Verified reusable compone
140. lly to provide functionality to most microcontrollers in market An application built from these components can be easily ported to another microcontroller supported by the Processor Expert This basic set contains for example components for simple I O operations BitIO BitsIO BytelO timers EventCounter TimerInt FreeCntr TimerOut PWM PPG Capture WatchDog communication AsynchroSerial SynchroMaster SynchroSlave AsynchroMaster AsynchroSlave IIC ADC internal memories This group of components allows comfortable settings of a desired functionality such as time in ms or frequency in Hz without user knowing about the details of the hardware registers microcontroller specific features are supported only as processor specific settings or methods and are not portable The components inheriting or sharing a high level component s to access hardware are also high level components Low level components Components that are dependent on the peripheral structure to allow you to benefit from the non standard features of a peripheral The level of portability is decreased due to a different component interface and the component is usually implemented only for a microcontroller family offering the appropriate peripheral However you can easily set device features and use effective set of methods and events Peripheral initialization components Components that are on the lowest level of abstraction An interface of such compon
141. low to change the timing at run time by switching among several predefined values or by setting a value from given interval For the runtime setting from interval the prescaler value is fixed and the Processor Expert allows to adjust the time using a compare reload registers It means that Processor Expert allows to configure the limits of an interval only within a range of one prescaler and it is possible to set values from this interval only See Dialog for timing settings topic for details 3 3 4 4 Speed modes Processor Expert provides three speed modes that are generalization of all the possible processor clock speed modes used for power saving supported by most of the modern microcontrollers See Speed modes support topic for details 3 3 5 Creating user component templates If you frequently use a component with the same specific settings you may need to save the component with its settings as a template This template is displayed in the Components Library view under given name behaves as a normal component and could be added to any project The template has the same properties as the original component The value of the properties are preset in the template and could be marked as read only This topic describes how to create a component template and save it 3 3 5 1 Creating and saving templates 1 Open the pop up menu of the component in the Component view and select Save component settings as template Alternatively you can u
142. maskable interrupts are disabled e same as interrupt Default behavior of the architecture within interrupts service routines interrupts are disabled 3 3 1 5 15 Version specific information for 56800E derivatives Processor Expert offers the following event priority options e interrupts disabled All maskable interrupts are disabled within the event routine e 1 3 Priorities from the lowest 1 to the highest 3 The code generated by Processor Expert before the event invocation sets the event code priority to the specified value The event routine can be interrupted only by a higher priority interrupt than the specified number e same as interrupt The priority of the event routine stays on the level set for the interrupt The event routine can be interrupted only by a higher priority interrupt than the value set for the interrupt e Other values are mapped to the priorities 1 3 CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 93 Configuring components 3 3 2 Configurations You can have several configurations of the project in one project file The configuration system is very simple Every configuration keeps the enable disable state of all components in the project it does not keep any component settings If you enable disable a component in the project the component state is updated in the currently selected configuration If you create a new configuration t
143. mended to make a setting close to 10 ms resolution provided by cetrine secrine methods Smaller values unnecessarily overload the system e WatchDog When the Watchdog component is added to the project it is automatically enabled The enabling code is placed in the processor initialization code NOTE Watchdog is enabled by a write to the configuration register This register can be written only once after processor reset Since the register also contains other bits that are written during the processor initialization the watchdog must be enabled when processor is initialized The property cpu clock speed selection has no effect because the COP timer clock source is CGMXCLK AsynchroSerial Timing setting values from list enables to select various values denoted by changes of the prescaler most tightly coupled with UART If a software handshake is used for extremely high baud rates it may happen that no overruns appear and transmitted characters get lost AsynchroMaster Same as AsynchroSerial AsynchroSlave Same as AsynchroMaster CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 128 Freescale Semiconductor Inc _ EE_L _______ Chapter 3 Application design e SynchroMaster Because of the disability of an SPI device configured as Master caused by a mode fault the mode fault automatically disables the component inside an interrupt service if inte
144. mer channels can be chained Chaining of 16 bit counters is supported by accommodating counts up to 64 bits The chained channels can be selected by a Timer property For example if 32 bit counts are required for the FreeCntr component it is possible to set the Timer property of the component by selecting the vwsao1 compare Or TMRAO1 Free Values These counters are not standalone 32 bit HW counters but rather two chained 16 bit counters NOTE Only chaining of the channels 0 1 2 3 and 0 1 2 3 are available Another possible chains can be created using 1nic rw amp components 3 4 5 2 Capture component Once the capture is triggered the capture register cannot be overwritten until the Input edge flag is enabled again This is provided in a different way depending on the Interrupt service settings and oncapture Event usage CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 124 Freescale Semiconductor Inc pu o Chapter 3 Application design The following cases can occur nterrupt service is disabled Once a capture event occurs no further updating of the capture register will occur until the method cetcapturevalue is used the Input edge flag is enabled in this method e Interrupt service is enabled and event oncapture is disabled The Input edge f
145. merUnit_LDD KB PwMTimerRG TimerUnit LDD gt Replace settings g PWMTimerRG TimerUnit_LDD WBrec 12 _Lop CD Replace settings I2CAS I2C LDD cs101 Consolelo CD Replace settings B CsIO1 ConsoleIO Figure 3 25 Apply board configuration page Before importing you can rename some of the components as shown in figure above so it will show the mapping of components with different names but same device allocation To import component settings from the file to selected project click the Browse button Select the input file with the peb extension The default option Replace settings is selected if imported component settings are having same peripheral device allocation or ID and type For more information on different types of modes see Component settings to project topic 3 Click Finish The settings from the pe file is imported to the selected project You are ready to import board configuration 3 3 9 5 Component s to component library To import a component CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 113 Configuring components 1 In the IDE select File gt Import The Import wizard appears Expand Processor Select Import Embedded Component s from Package Select an import source Expert tree Select Component s to Components Library option as shown below amp General l E Cic 3 CodeWarrior Exa
146. mily projects it s necessary to remove the files xinetis sysinic c and kinetis sysinit h from Project Settings Startup Code This module contains definitions that conflict with Processor Expert definitions 9 For Coldfire family projects it is necessary to remove the cfm c file in Sources folder This module contains definitions that conflict with Processor Expert definitions If this module is changed it is necessary to update the cpu component settings in Internal peripherals VFlashConfigurationField to match the changes in the c n c module CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 164 Freescale Semiconductor Inc EE Chapter 3 Application design 3 8 Low level access to peripherals In some cases a non standard use of the peripheral is required and it is more efficient to write a custom peripheral driver from scratch than to use the component In addition there are special features present only on a particular chip derivative not supported by the component that could make the user routines more effective however the portability of such code is reduced 3 8 1 Peripheral initialization It is possible to use Processor Expert to generate only the initialization code function for a peripheral using the Peripheral initialization components You can choose a suitable Peripheral initialization component for the given peripheral using the Peripherals tab of the Components Library See Componen
147. ming contentions Processor Expert allows the efficient use of the microcontroller and its peripherals and building of portable solutions on a highly productive development platform 1 2 2 2 Minimize time to learn microcontroller There are exciting possibilities in starting a new project if the user is starting from ground zero even if the user is using a new and unfamiliar processor You can work on microcontroller immediately without studying about the microcontroller Documentation You can implement simple applications even without deep knowledge of programming PE presents all necessary information to the user using built in descriptions and hints PE has built in tutorials and example projects CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 19 Features of Processor Expert 1 2 2 3 Rapid development of entire applications Processor Expert allows you to try different approaches in real time and select the best approach for the final solution You are not confined to a pre determined linear approach to a solution Easy build of application based on system functional decomposition top down approach Easy microcontroller selection Easy processor initialization Easy initialization of each internal peripheral e Simple development of reusable drivers e Simple implementation of interrupt handlers nherited modularity and reuse nherited e
148. mple Project Y MCU Executable Importer E Component Development Environment amp cvs amp Install HERE Ec EH Ee amp Processor Expert E Apply Board Configuration Ss Component Settings to Project S H E Run Debug HL Software Analysis H E Team gt Other Finist Figure 3 26 Import wizard 2 Click Next The Import Processor Expert Components page appears Cancel CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 114 Freescale Semiconductor Inc E e EE Eus Chapter 3 Application design Import Components from PE Update package Import Processor Expert Components Select PE update package File EXtempkey Beans 30 04 2010 PEupd Figure 3 27 Export Processor Expert component settings page 3 Click Finish to select and install Processor Expert update packages PEUpd files 3 4 Implementation details This topic explains implementation details for Embedded Components and Processor Expert generated code The following describes Reset scenario with PE for HC S 08 RS08 and 56800 E Reset scenario with PE for 56800EX Reset scenario with PE for 56800EX with static code support Reset scenario with PE for ColdFire and Kinetis microcontrollers Version specific information for 56800 E EX e Version specific information for Freescale HCS08 and ColdFire V1 derivatives Version specific information for RS08 Version specific information fo
149. mponent do not allow it to generate this method 3 3 7 3 Component sharing Component sharing allows you to cause several components to use capability of one component similar to inheritance This feature allows sharing of its resources and its drivers with other components For example components may share an I2C component for communication with peripherals connected to the I2C bus or some component may do DMA transfers using DMA component 3 3 7 4 Settings in Processor Expert A shared ancestor component contains a property that allows you to select existing shared ancestor component or create a new one In this case the ancestor component is included in the project tree as the other components The ancestor component may be used with the descendant component only if it is created from a template registered in the descendant component or if the component type is registered in the descendant component It is recommended that you always create a shared ancestor component through a descendant component DMA controller device DMA1 E Channel DMAL edea Figure 3 16 Popup menu for selection creation of a shared ancestor component 3 3 7 5 Run time resources allocation Processor Expert generated code does not check the usage of shared resources code It s up to you to ensure the correct run time resources allocation of a shared ancestor component Often it is not possible for a shared ancestor component to be used simultaneously by several
150. mponents timing related values or information showed in the initialization components are valid for initial system timing For example if a specific timer period value is calculated from current divider property settings and showed as additional information in the component then this time value is valid only for Clock Configuration 0 and might be different when the clock configuration is switched 3 2 2 8 3 4 Support of clock configurations in embedded components As described in Clock configuration topic particular system timing scheme which is defined as reference clock source selection and settings clock processing settings for example configuration of a PLL circuit and value of main system clocks such as internal peripherals bus clock is in Processor Expert represented as a clock configuration and is configured in CPU processor component In case of embedded components that encapsulate timing features derived from the system timing Processor Expert also ensures that component timing settings are valid and consistent with the clock configuration Unlike other clock configurations Clock Configuration 0 has some specific features NOTE As mentioned in Clock Configuration 0 topic the Peripheral Initialization Components see Levels of abstraction topic support only Clock Configuration 0 Therefore following part of documentation generally applies to Logical Device Driver LDD components and High Level Components although implemen
151. mponents and PE devices Component Selected PE devices defined for the timer Selected device s TIMx TIMxy TIMxfree TIMx_PPG TIMxPP TIMxyPPG PWM TIMxy Blocked Used 1 Blocked Blocked Blocked Blocked channel 2 in buffered mode Others free PPG TIMxPP Blocked All channels Blocked Used Used Used TIMxyPPG blocked TimerOut TIMxy Blocked Used 1 Free Blocked Blocked Blocked channel 2 in buffered mode Others free Timerlnt TIMxy Blocked Used 1 Free Blocked Blocked Blocked RTIShared channel TimeDate Others free FreeCntra TIMxfree Blocked All channels Used Blocked Blocked Blocked FreeCntr6 free FreeCntr32 EventCntr8 TIMx Used All channels Blocked Blocked Blocked Blocked EventCntr16 blocked EventCntr32 Capture TIMxy Blocked Used 1 Free Blocked Blocked Blocked channel Others free CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 132 Freescale Semiconductor Inc pun ee ee ee Chapter 3 Application design Table legend Blocked Device might not be directly used by the component but it cannot be used shared by other components because it would disrupt the component s function Used Device is required and used by the component Free Device is not used nor blocked by the compo
152. n SPID Master 4 Negative input Fl Data Out Slave Data In External igger input SPI0 Master Data In Slave Data Out A Pin Pin number on the pro ge 63 Source component external Comparator output Disabled Output filter Disabled Inverted output no Analog comp mode falling or rising edge Power mode Power saving Pass through mode Disabled Hysteresis 0 5mV DMA Disabled Figure 3 36 Pin selection CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 m Freescale Semiconductor Inc 183 Internal signals Properties _ Methods Events Name Component name Analog comparator Interrupt service event a Positive inputs 4 Positive input 0 Pin 4 Source component Component 4 Negative inputs E Negative input 0 A Pin Source component Comparator output Output filter Inverted output Analog comp mode Power mode Pass through mode Hysteresis Value Details 2 ACi CMPO CMPO Disabled 1 DAC12b0_Output DAC12b0_Output L Positive analog comparator input pin DAL Peripheral description 12 bit DACO Output 1 Internal signal not available on processor Bandgap Bandgap Disabled Disabled no falling or rising edge Power saving Disabled 0 5 mV Figure 3 37 Internal signal selection Clear differentiation is possible in property hint In case of pins full description of pin functions along with pin number on processor package is showed If internal signal is selected
153. nal list 4 Trigger signal 0 A Trigger input Trigger type Trigger active state 4 Voltage reference 4 High voltage reference A Volt ref pin 4 Low voltage reference A Volt ref pin 4 Initialization Enabled in init code Auto initialization 4 Event mask OnMeasurementComplete OnErrot CPU clock configuration selection Chapter 3 Application design Value Details 2 unsigned 16 bits right justified Enabled 1 Enabled CMPO output ADCO SEI4 TSI CHI13 PTC ADCO SE14 TSIo CH13 PTCO EXTRG IN CMPO OUT CMPO INO PTCG LLWU P10 SPIO MOSU EXTRG IN SPID MISO RTC seconds z TPMO Overflow TPMI Ch Flag TPMI Overflow Figure 3 33 A D converter trigger selection in ADC LDD From the list internal signals are cupo_output Comparator 0 output tow power timer LOW power timer event prr trigger o 1i Periodic interrupt timer 0 and 1 event arc a1arm Real time clock alarm event rtc_seconds Real time clock second event Temo overflow Timer PWM module 0 overflow event eui cho riag Timer PWM module 0 channel 0 event and rpm1_overflow Timer PWM module 1 overflow event Timer synchronization some timers can be synchronized by trigger Figure below shows how selection of appropriate trigger looks like in the mnit_rem component This example also shows that selection of internal signals in Peripheral Initialization components is same as in high level and LDD components CodeWarrior Development Studio Processor Expe
154. nent so it can be used by another component 3 4 6 1 5 How to use the table The table allows to find which component in which setup can share the timer peripheral The following rule determines the condition necessary for sharing When you take the rows of table corresponding to the components and their configurations you want to use every column containing Used value must contain Free in all other rows it cannot be used or blocked In case of individual channels there has to be enough channels for all components Note that if a component allocates some channels it is possible to share the timer among several components of the same type for example Timerint Using the TIMxy device 3 4 6 1 6 PWM sharing limitation There are some limitations for the PWM component if it shares the timer peripheral with other devices The PWM in this case uses the whole range of the counter that is the modulo register is not used so the period values are limited to the value s determined by the prescaler value 3 4 6 1 7 Example The 68HC908AZ60 contains two timer modules TIMA and TIMB Each one of these modules is based on a 16 bit counter that can operate as a free running counter or a modulo up counter TIMB module has 2 channels and 2 related input output pins Can we use the TIMB peripheral for PWM output and input capture components at once Timer Module B TIMB is supported in PE by the following devices TIMB TIMBO TIMBI TIMBfree T
155. ng on a value from the settings table Units Time units for the value See Syntax for the timing setup in the Component Inspector topic for details CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 50 Freescale Semiconductor Inc Chapter 2 User interface 2 4 7 1 5 Timing precision configuration It is possible to specify desired precision of the timer settings by using one of the following settings which one is used depends on the type of the timing The field Allowederror allows to specify a tolerated difference between the real timing and the requested value The Unit field allows to specify the units for the error allowed field time units or a percentage of the requested value The field Min resolution is used for setting interval or capture component timing Allows you to specify maximum length of one tick of the timer In case of interval settings type the of low limit percentage of the low limit value can be used as the unit for this value 2 4 7 1 6 Minimal timer ticks NOTE This item is available only for setting of period in components where it is meaningful for example PWM PPG It represents requirement for minimal number of timer ticks for specified period usually it affects minimal value set into reload or modulo register This is useful for configurations where it is expected to change period or duty in runtime and in this case the parameter affects supported scale f
156. nn 47 AA AAA Timing dilog contol snn adie ana ener 48 pr wx SU ii os mone OPO aaa Ena E a EE uatidoueed 49 2A LLS BAe seting GORBESDESRDEL uis ssondsia aste arena a aA aariaa 49 kr MuR o ire T 50 2371 5 Timing precision COUT AI OT stasis eoi iecit In Rene cn he darkt ute cba R tn ha ales c tua R cd aR RAE CR Ea 50 2303 0 5 Ipfa DEOO TIER uas dae e pecie a E 51 2A Adjsted VANES T 51 pA A ord c 51 pron Mee NPG iro Dori T amp l 24 72 Syntax for the timing setup in the Component l spectorsueeececiciet remeras epin tabs ci E CRRU IN ners 52 pcE TEE M du oni uo e 53 ZASI Froo Me E E 53 EEUU gon E 54 PA Cont is T 56 PA WANG TT 56 PONG CU MT E SE EA O meade 57 PRENNE I M E E E A A EE T A E E E E E T af CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc Section number Title Page Deda Ae CELIA PCa EAB Vm 57 2oaJ41 PBPenpberdl or Pan Pop up Memi us perte tet cesisentsvieateostavcneceusayesiscarieemciystaassnseniacs 58 Zh Memory Map Vio ie arci p oneri wed Sash Rape nla totale coupe cag Scr qu LR kel blancs bd cop HM pze edd ag za X nhenpetu ie ee VIE Lo ue matetes pretia i op edis ea ecdbac died v bte eid a Pda cedri RA da AF CHER d E ERE 60 2o Inxidlsston Sh SUR TIE Lado cit a a de qu een dona ICD IE Rn pda ipa patte aut tiep tesa qupd 61 Chapter 3 Application design 31 Creaonsapphesgondeng Proce
157. ns list of the available processors CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 36 Freescale Semiconductor Inc pw Chapter 2 User interface Component names are colored black and the component template names are colored blue The components that are not supported for the currently selected target processor are gray By double clicking on the component it is possible to insert the component into the current project The description of the component is shown in a hint 2 3 2 Filtering Filter can be activated using the filtering icon If it is active only the components that could be used with the currently selected target processors are shown If the filter is inactive Processor Expert also shows components that are not available for the current processor 2 3 3 Pop up menu A pop up menu opens by right clicking a component or folder It contains the following commands Add to project Adds the component to the current project Add to project with wizard Adds the component to the current project and opens a configuration wizard Expand all Expands the folder and all its subfolders Collapse all Collapses the folder and all its subfolders Refresh Refreshes the view area Delete Only user templates and components are deleted User component is deleted from the folder MCU Install gt ProcessorExpert Beans lt ComponentToBeDeleted gt Other files like inc drv
158. nt Expert view Maximum visibility level All possible settings including all settings of basic and advanced view The visibility can be switched in the Component Inspector using Basic Advanced and Expert buttons or within its view menu NOTE If an error occurs in a property with a higher visibility level than the level currently selected then also this error is displayed 2 4 7 Component Inspector Component Inspector is one of the inspector view variants intended to configure component settings It allows to setup Properties Methods and Events of a component Use command Help on Component from View menu invoked by the down arrow icon to see documentation for currently opened component CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 46 Freescale Semiconductor Inc Chapter 2 User interface NOTE Property settings influencing the hardware can often be better presented by the processor package view using the Processor view See Processor view topic for details Basic Advanced Expert In vo Name Details CPU type L25Z128VK4 Clock settings Internal oscillator Slow internal reference clock 32 768 32 768 kHz Fast internal reference clock 4 0 4 MHz RTC clock input Disabled System oscillator 0 Enabled Clock source External crystal Clock frequency MHz 8 0 8 MHz Clock source settings 1 Clock source setting 0 Figure 2 14 Component Inspect
159. nterface The Processor Expert menu is integrated as a plugin in the CodeWarrior IDE providing set of views The CodeWarrior IDE main menu has a menu item named Processor Expert The user interface of Processor Expert consists of the following windows Component Inspector Allows you to setup components of the project Component Library Shows all supported components including processor components and component templates Configuration Registers Shows overview of the peripheral initialization settings for the current processor Memory Map Shows the processor address space and internal and external memory mapping Components Shows an embedded component that can be used in Processor Expert nitialization Sequence It is possible to customize the initialization sequence of components By default the sequence is not specified You can change the sequence using up or down buttons Initialization of processor component is always first Processor The processor derivative used in a given project This chapter explains Main menu Components view Components Library view Component Inspector view Processor view Memory Map view Configuration Registers view nitialization Sequence view CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 27 Main menu 2 1 Main menu The Processor Expert plug in is integrated into the CodeWarrior Ecl
160. nts allowing inheritance CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 17 a BHS I Features of Processor Expert Verification of resource and timing contentions Concept of project panel with ability to switch port between microcontroller family derivatives Code generation for components included in the project Implementation of user written code nterface with Freescale CodeWarrior This section includes the following topics Key Components Advantages 1 2 1 Key components The key components are Graphical IDE Built in detailed design specifications of the Freescale devices Code generator 1 2 2 Advantages PE based tool solution offers the following advantages to Freescale microcontroller customers n all phases of development customers will experience substantial reductions in development cost development time Additional benefits in product development process are ntegrated Development Environment increases productivity Minimize time to learn microcontroller Rapid prototyping of entire applications Modular and reusable functions Easy to modify and port implementations 1 2 2 1 Integrated Development Environment increases productivity Integrated development environment increases productivity This tool lets you produce system prototypes faster because the basic setup of the controller is easier This could m
161. number Title Page 349 Version sp ecihic information Tor Kmets and ColdPired use savsnsoscecsnsvhidiosvereaesncaneubvaredeasoaveneubewanvanitves 143 BD Iul Bene TA OM n Nt T M 143 354 o ap m 143 SOL Piesproduced By Processor BAD i asepistaa takes FU RE M REPERI PERI PvE RITE RRI OU RO d AMT E RR 144 3 5 1 2 Tracking changes in generated eode ise tcd eter Ioni ture nta o tape nd i desd bak A 147 452 PuedoiuedEypes Macros A COBSBIBIS ioi cud UA Cabo asta bats i Mipd Dad i equas dun Ep e MIR LR cR RM MEER UR RU Mua 147 RS CNEEL T NIE 148 LOO NMER egal Nigri t e x Tm 148 202 9 istuc for GUE VE TBE onana uapipiabap latio osdpdecap Bat eoque tabu una duisi e val U df wa utu RU Eq eUO 148 3 3 2 3 Version specific information for 36BDU E iiu coe ttt dert tbt rit LIE everti turbis 149 Rx MU 149 RE AMNES Lr c 149 35 26 Methods error CORB m 149 3 5 2 5 Version specific information for 36800 E isssccsiccsassiiavsssdssoasativectsotiasassanesnntecncasaesaavenes 150 352 7 56800 E additional types for SDK Componerse sua iiare da Coa er UR IR Reda 150 35 Typicalusage GT component x user COUE ueneno resi CU Re pee Leda ead CU MEO XI AO ELLO ke ainen 153 Asl Penphiraluutali2d on CORSDONCQIS ea deie cua cita es ip secat ati boim La acca pma eI Rt Rb rE laos 153 233055 Method Enable DISSBIG s
162. o method has one parameter userpataptr You can pass a pointer to its own data and this pointer is then returned back as a parameter in component s events The pointer or date pointed by this pointer is not modified by driver itself A bare board application typically passes a null pointer to mit 0 method LDD components are not automatically initialized in processor component by default If Auto initialization property is not enabled you must call appropriate tit method during runtime Otherwise the Init method is automatically called in processor component and device structure is automatically defined LDD components have RTOS adapter support allowing to generate variable code for different RTOSes e Runtime enable disable of component events Low Power Modes support 3 2 1 8 2 Logical device drivers in bare metal applications Logical Device Drivers can be used in applications where the RTOS is not required Logical Device Drivers in bare metal environment have following specific features init method of each component uses a static memory allocation of its device structure Interrupt Service Routines are statically allocated in generated interrupt vector table IVT The Linker Command File LCF is generated from processor component The main module ProcessorExpert c is generated 3 2 1 8 3 Logical Device Drivers in RTOS environment Logical Device Drivers in RTOS environment have following specific features
163. o objects in the Object Oriented Programming OOP concept 3 2 1 1 Easy initialization You can initialize components by setting their initialization properties in the Component Inspector Processor Expert generates the initialization code for the peripherals according to the properties of the appropriate components You can decide whether the component will be initialized automatically at startup or manually by calling the component s Init method CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 64 Freescale Semiconductor Inc pM y Chapter 3 Application design 3 2 1 2 Easy on chip peripherals management Processor Expert knows exactly the relation between the allocated peripherals and the selected components When you select a peripheral in the component properties Processor Expert proposes all the possible candidates but signals which peripherals are allocated already with the icon of the component allocating the peripheral PE also signalizes peripherals that are not compatible with the current component settings with a red exclamation mark In case of an unrealizable allocation an error is generated Unlike common libraries Embedded Components are implemented for all possible peripherals with optimal code The most important advantages of the generated modules for driving peripherals are that you can Select any peripheral that supports component function and change it whenever you want du
164. o that you can write code here Event module The event module is generated only if it does not exist If it exists only new events are added into the module user written code is not changed CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 144 Freescale Semiconductor Inc ET Chapter 3 Application design The event module contains all events selected in the components By default these event handler routines are generated empty without any meaningful code It is considered that user will write code here Event module can also contain the generated ISRs for the components that require a direct interrupt handling Peripheral Initialization Components It is possible to configure the name of event module individually for each component in the ADVANCED view mode of the Component Inspector However note that the event module is not generated by Processor Expert if there is no event enabled in the component except the processor component for which the event module is always generated e Method list file with description of all components methods and events generated from your project The name of the file is projectname txt OF projectname doc This documentation can be found in the Documentation folder of the Project Panel Signal names This is a simple text file projectname SIGNALS txt OF projectname SIGNALS doc with a list of all used signal names The signal name can be assigned to an
165. oblems same as interrupt Default behavior of the architecture no interrupts can interrupt the event It is same as interrupts disabled 3 3 1 5 10 Version specific information for RS08 with interrupt support Because of architecture limitations the Processor Expert allows only interrupts disabled value so the interrupt is always disabled within the event routines The same as interrupt value is mapped to interrupts disabled 3 3 1 5 11 Version specific information for ColdFire V1 derivatives Processor Expert offers the following event priority options interrupts disabled All maskable interrupts are disabled within the event routine 0 7 Priorities from the lowest 0 to the highest 7 The code generated by Processor Expert before the event invocation sets interrupt priority mask to the specified value The event routine may be then interrupted only by an interrupt with higher priority than the specified number same as interrupt The priority of the event routine stays on the level set for the interrupt The event routine can be interrupted only by a higher priority interrupt then the value set for the interrupt 3 3 1 5 12 Version specific information for HCS12X derivatives Processor Expert offers the following event priority options interrupts enabled Interrupts are enabled and the interrupts with the higher priority than the current interrupt priority can interrupt the event code The state of the register CCRH
166. ode rack CRAM RSS ae aia c rasis tup cinia bse a ted lecum Pap E d bmc idu ca ups ai rA CM cbe uA AE RA OE ANA 177 3 10 12 Multiple properties accessing common FeSgIBDet uuciese codecs iut vnde kei QU HI oraora e 0 Me Lael ped laud ce UHR KG Raoi 178 ENDO CIEI I ic CE 179 LILI Difierentianon of intemal signals and ponies ic icissiavacetciicdecasstvenshraeeaaiaosbanimaniaaslasieensaie OE 182 AIL2 Internal signal producer component Hnkingas sesaria aiin TRU RES HR e ENTRAR RN EE aS 184 Chapter 4 Processor Expert tutorials 41 Tu toralprioject for Wane his un misce pills P P E aia a 187 4 1 1 Creant a DEW PROPEL a e o E 187 ALL guddins commoni e A E cet E 188 AIS C oniaine Componer AA E E 189 CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 12 Freescale Semiconductor Inc Section number Title Page DNE MEE N T du ncc loose 190 AVA WMS ici sor Men A 190 191 4 1 4 2 Running application CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 13 Freescale Semiconductor Inc CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc Chapter 1 Introduction Processor Expert PE CodeWarrior plug in is designed for rapid application development of embedded applications for a wide range of microcontrollers and microprocessor systems This chapter explains Overview Features of Proce
167. odeWarrior Development Studio Processor Expert User Guide 196 Freescale Semiconductor Inc How to Reach Us Home Page freescale com Web Support freescale com support Information in this document is provided solely to enable system and software implementers to use Freescale products There are no express or implied copyright licenses granted hereunder to design or fabricate any integrated circuits based on the information in this document Freescale reserves the right to make changes without further notice to any products herein Freescale makes no warranty representation or guarantee regarding the suitability of its products for any particular purpose nor does Freescale 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 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 does not convey any license under its patent rights nor the rights of others Freescale sells products pursuant to standard terms and conditions of sale which can be found at the following address freescale com SalesTermsandConditions Freescale
168. og available using the command Window gt Preferences The PE related items can be found under Processor Expert in the list on the left Description of the individual options can be found in the hint window displayed when the cursor is placed on an item CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 29 a SSS Main menu Preferences Processor Expert General General Cice Auto connect component Yes Colorina Edit Enable new component in configuration In all configurations nie mnl Default items view level Basic Freescale Licenses Show pop up help tooltips Enabled Help Preferred inspector views Classic Table View Install Update MQX Preferences Processor Expert Component Development General Paths Remote Launch Remote Systems Runj Debug Software Analysis Team Terminal Trace Configurations EE EE E E Restore Defaults gt Figure 2 2 Preferences dialog There is an option Preferred inspector views that allows you to decide how to display the tabs of Component Inspector view There are three views Custom Classic and Tabs For more details see Component Inspector view topic To start or shutdown the processor expert click Windows gt Preferences and expand General and select Startup and Shutdown Processor Expert starts after the Eclipse workbench user interface is displayed if the Processor Expert Co
169. on allows to change the component from the list of the available components or add a new component to the project See Component inheritance and component sharing topic for details List of items A list of items may be expanded collapsed by clicking on the plus minus button in the left side of the row or by double clicking on the row You may add remove items by clicking on the plus minus button The items in the list can be arranged using the Pop up menu related commands Peripheral selection You can select a peripheral from the list of the available peripherals The peripheral that are already allocated have the component icon in the list The properties that conflicts with the component settings have the red exclamation mark Real Number You can insert any real floating point number String Allows to enter any text or value If there are no recommended values specified there is no change in the user interface If the values are specified these values helps user to select typical or recommended value for the property This feature is supported for String and Real Number properties The recommended values used for the property are ONE TWO and THREE The string property can offer predefined values accessible hitting key stroke ctrl space You can see that this is available when the string value is edited and there are predefined values available small yellow bulb is displayed before top left corner of edit field
170. on and processor components use static peripheral initialization drivers Both modes use shared and project static code repository Project repository is placed in the project directory see Project static code directory structure section for more details and shared repository is placed in the Processor Expert installation directory see Processor Expert static code repository section In standalone mode project repository contains copy of shared repository created during project creation In linked mode project repository links the shared one It is not possible to change mode once it is selected 3 10 2 1 Standalone mode Complete set of static drivers is stored directly in the project directory During project creation static drivers are copied from shared static code repository to the project repository After project is created it is independent from development environment and from other projects therefore changes made in static drivers in one project don t affect rest of the projects It is possible to synchronize project s local repository with the common one Processor Expert detects changes in the common repository informs user about them and offers project local repository update Also if static driver is missing in the project directory but is required by Embedded Component used in the project then Processor Expert offers adding of the missing files CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2
171. onent name Using this macro instead of a real peripheral name allows a peripheral to be changed later by changing the component property without modifying the PESL commands in user code Example Let s expect we have a component Init SCI named SCII PESL SCI1 DEVICE SCI SET BAUDRATE 1 Processor Expert shows the list of the available PESL commands as a subtree of the Peripheral Initialization component in the Components view see Processor Expert options topic for details User can drag and drop the commands into the code from this tree The PESL commands created this way use the component name svice macro instead of a specific peripheral name 3 8 4 3 PESL commands reference For details on PESL its commands and parameters see PESL Library user manual using the Help command of PESL project panel folder pop up menu 3 8 5 Direct access to peripheral registers NOTE Register access macros are not available for Kinetis and ColdFire family microcontrollers The direct control of the Peripheral s registers is a low level way of creating peripheral driver which requires a good knowledge of the target platform and the code is typically not portable to different platform However in some cases is this method more effective or even necessary to use in the case of special chip features not encapsulated within the Embedded component implementation See Low level access to peripherals topic for details The common basic peripheral op
172. ons can be found in the hint window displayed when the cursor is placed on an item CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 28 Freescale Semiconductor Inc Chapter 2 User interface Properties for proj test Processor Expert Project Options proj test E Resource Builders Name Value C C Build C C General Main amp Events directory Sources Processor Expert Generated code directory Generated Code Project References Static code directory Static Code Run Debug Settings Documentation directory Documentation Project settings directory Project_Settings Set periph init component name as peripheral Yes Main module update Smart update recommended Event module s update Smart update recommended Update of other user modules Smart update recommended Generate ISRs No Delete unused events and ISRs Yes Delete unused previously generated files Yes Freeze code generation No Generate code before build automatically Yes Save project before code generation Yes Create code generation log No Code generation reference number 1 Restore Defaults Apply Figure 2 1 Project properties dialog NOTE Restore Defaults button restore all settings to its default values except Code Generation reference number This number indicates number of times code was generated for a given project 2 1 2 2 Preferences Global settings related to Processor Expert can be found in Preferences dial
173. or ColdFire and Kinetis microcontrollers eese 122 PU MRAM RIM RT REEL E 123 Sapdo WMS DS Bulb oucicaseacek erred eo IE E xke ti ie EA a TR E rd pus uk citt ditu Er RI E doa 123 24543 PE low dece ui busto dues bi loea e bb E Epp Mb eda bid mc di RisS 123 CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc Section number Title Page RETE c 124 245 Wersionspscihecoanftormaston for S68 DD EER asisepis border prs l ertt Fr RAE S EVEA GE EILEEN RE 124 3451 ChaunrotBmsr habnslis deve edi baden deir barre ultio SRL e a ue t b Rt 124 SOUS TEENS CONHTDOEUE E eu ded Ea RRIFRIE PIS IHE AS REFS at POR Fa E PER P PLE POR Een 124 5455 5 ToncDatc component e que ect ie PARDO Ub eT M ps tup M p LM ud dd prati uid tnim pt dec Lip aE EM Edda 125 SAA PulseAconmibitor compon isena equo Cite auth o SU Cup dedu A eade cR da RR MR 125 34359 WCCO CODEPODODE uni qd ipo babeo ie Ip QUb doit E sabia umpca b curb aM LEUR uPAD Mon Ui Dub 125 res Malis CAIN CORN ss cate cas mmm 125 3 4 5 7 AsynchroSerial SynchroMaster SynchroSlave FreescaleSSI Components 126 Ads SEU COHIDDNIgUE siiacansciawiancutaasandecnicands emp iciapiaider EE duae dS RM E 126 3 4 6 Version specific information for Freescale HCS08 and ColdFire V1 derivatives sess 127 54 61 HCS03 ColdFire VI tim
174. or Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 125 eee M Implementation details The FlexCAN device receives self transmitted frames if there exist a matching receive MB FlexCAN module is implemented on 56F83xx derivatives Message buffers should be configured as receive or transmit using the FreescaleCAN component s settings MSCANI2 device When interrupt mode is enabled received frames should be read in the OnFullRxBuffer event to avoid message buffer lock unlock problems 3 4 5 7 AsynchroSerial SynchroMaster SynchroSlave FreescaleSSl Components When the component is configured in DMA mode then Send Receive routines use a user buffer that is passed as a parameter to these methods You should avoid changing a buffer content during receive transmit process 3 4 5 8 IntFlash components If Save write method is used property Write method the Save buffer buffer for saving data from the sector which has to be erased is implemented by component in data RAM If the Virtual page feature is used property Virtual page the page buffer is implemented by component in data RAM The basic addressing mode of IntFLASH component methods is a 16 bit word It is used by most of the memory access methods Only SetByteFlash GetByteFlash SetBytePage GetBytePage and SetBlockFlash GetBlockFlash methods use a byt
175. or Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 81 Basic principles Figure 3 8 Clock configuration example in application low power state This example also shows that some peripherals allow using multiple clock sources for instance clock generator output raw output from reference clock source or other alternative clocks Clock configuration in such case can be used to switch clock source of the peripheral clock input Furthermore the example demonstrates possibility to enable or shut down entire peripheral during clock configuration switch For more information about clock configuration options available in the embedded components see Support of clock configurations in embedded components topic Clock configuration switch is explained in Changing active clock configuration topic 3 2 2 8 3 2 1 Changing active clock configuration CPU processor component setclockconfiguration Configurationrp method is used to change active clock configuration This method will switch to clock configuration defined by configuration1p passed as input parameter The required configuration has to be predefined in the processor component otherwise the method returns an error Clock configuration change is done during CPU setclockconfiguration method call in the following order 1 It is checked whether required clock configuration number was defined in the CPU processor component If not method returns with an error
176. or such changes There will be guaranteed that there will be at least the given number of distinct values available for adjusting the duty of output signal This will also be guaranteed for any available period of the signal 2 4 7 1 7 Adjusted values This table displays real values for each speed mode of the selected row in the Timing values table These values are computed from the chosen on chip peripheral settings selected prescaler s value and the difference between a value selected by the user and the real value 2 4 7 1 8 Status box The status box displays a status of the timing setting s If the timing requirements are impossible to meet a red error message is displayed otherwise it is blank and gray CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 51 Component Inspector view 2 4 7 1 9 Possible settings table This table is displayed on the right side of the timing dialog when you click the Possible settings button on the top The table displays values supported by the Processor for the selected peripheral If there are only individual values available to set the table contains a list of values each row represents one value If there are intervals with a constant step available each row contains one of the intervals with three values From Till minimum and maximum value Step a step between values within the interval The way the values are displ
177. or view The Build options page is present only in the processor component and it provides access to the settings related to linker and compiler The Resources page shows list of the processor component resources You can also manually block individual resources for using them in Processor Expert The page consists of the three columns First shows the name of the resource Resources are in groups according to which device they belong to e Second column allows you to either reserve resource for example pin for external device or to be used in Processor Expert Reserved resource is not used in Processor expert Third column shows the current status of the resource and the name of the component which uses it if the resource is already used For more details on component inspector items see Dialog for timing settings and Syntax for the timing setup in the Component Inspector topic CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 47 Component Inspector view 2 4 7 1 Dialog for timing settings The Timing dialog provides a user friendly interface for the settings of the component timing features When you click the button of a timing item in the Component Inspector view the Timing dialog is displayed Before you start to edit component timing you should set Target processor in the Component view Used peripherals in the component s properties e Suppor
178. ory The address in the diagram is increasing upwards To improve the readability of the information the size of the individual memory blocks drawn in the window are different from the ratio of their real size small blocks are larger and large blocks are smaller The black line crossed area shows the memory allocated by a component or compiler The address axis within one memory block goes from the left side to the right it means that the left side means start of the block the right side means the end CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 59 Configuration Registers view O01 FFF FLASH 001000 Figure 2 18 Sample of used part of the memory area 2 7 Configuration Registers view Configuration Registers view shows overview of the peripheral initialization settings for the current target microcontroller It displays initialization values of all control status and data registers of selected peripheral device including single bits The values are grouped into two parts Peripheral registers containing registers directly related to the selected peripheral device and Additional registers containing the registers that are influenced by the component but are not listed for the peripheral currently selected in this view To open this view click Window gt Show View gt Other and select Processor Expert gt Configuration Registers The initializa
179. ou can unspecify the initialization order of given component by clicking on the Don t care button CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 61 Initialization Sequence view CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 62 Freescale Semiconductor Inc Chapter 3 Application design This chapter will help you to design application using Processor Expert and Embedded components You will find here recommendations and solutions to write and optimize a code effectively This chapter explains Creating application using Processor Expert Basic principles Configuring components mplementation details Code generation and usage Embedded component optimizations Converting project to use Processor Expert Low level access to peripherals Processor Expert files and directories e Static code support in Processor Expert nternal signals 3 1 Creating application using Processor Expert To create an application using processor expert 1 Open an example You can start learning Processor Expert by opening one of the available examples Select File Import to open the Import dialog Then select General Existing Projects into workspace and click Next All Processor Expert examples are located at CodeWwarrior for MCUs WMCUNVCodeWarrior ExamplesVProcessor Expert Use the Browse button and select the directory o
180. ow during evaluation ERR_ENABLED 6 Device is enabled ERR_DISABLED 7 Device is disabled ERR_BUSY 8 Device is busy ERR_NOTAVAIL 9 Requested value not available ERR_RXEMPTY 10 No data in receiver ERR_TXFULL 11 Transmitter is full ERR_BUSOFF 12 Bus not available ERR_OVERRUN 13 Overrun is present ERR_FRAMING 14 Framing error is detected ERR_PARITY 15 Parity error is detected ERR_NOISE 16 Noise error is detected ERR_IDLE 17 Idle error is detected ERR_FAULT 18 Fault error is detected ERR_BREAK 19 Break char is received during communication ERR_CRC 20 CRC error is detected ERR_ARBITR 21 A node loses arbitration This error occurs if two nodes start transmission at the same time ERR_PROTECT 22 Protection error is detected ERR_UNDERFLOW 23 Underflow error is detected ERR_UNDERRUN 24 Underrun error is detected ERR_COMMON 25 General unspecified error of a device The user can get a specific error code using the method GetError ERR_LINSYNC 26 LIN synchronization error is detected ERR_FAILED 27 Requested functionality or process failed ERR_QFULL 28 Queue is full 3 5 2 6 1 Version specific information for 56800 E For information on SDK constants definitions go to the page SDK types 3 5 2 7 56800 E additional types for SDK components The following types definitions are generated into the file pzrypes n in the Processor Expert for 56800 E These types are intended to be used with the algorithms coming from the o
181. owever some of the components additionally allow creating list of timing values and switching between them using dedicated component specific method For more information about available types of timing values see Runtime setting configuration topic 3 2 2 8 3 4 2 2 Input clock source selection Often peripherals can be clocked not only from internal peripheral bus but also from variety of alternative clock sources such as dedicated asynchronous clock generator or any other system clock source Although the way how such selection is implemented is component specific and might be common for all clock configurations it is common practice that high level and LDD components allow selecting input clock source for each clock configuration independently switching between them during the application runtime during setclockconfiguration method call If peripheral input clock is not available for example because the clock configuration is set to disable the required reference clock source the Processor Expert notifies the user about this CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 85 Configuring components 3 3 Configuring components Configuring the components in the project is one of the main activities in Processor Expert It affects the initialization run time behavior and range of functionality available to the generated code For the description of the user interfac
182. ows only one breakpoint placed in the flash memory However executing an SWI instruction while running is functionally equivalent to hitting a breakpoint except that execution stops at the instruction following the SWI The user can use this feature to actively capture unused interrupts There are two options for capturing such interrupts f the property named Unhandled interrupts located in Build Options tab is set to Own handler for every there is an interrupt routine generated for each unhandled interrupt generated into the cpu c module The SWI instruction can be placed in the generated routine of the interrupt that need to be caught You can also use the InterruptVector component In the properties of the component select which interrupt will be monitored and set the name of the ISR function for example trap One function can be used to capture more interrupts if property a11ow duplicate ISR names lS Set to yes The Trap function will contain only the SWI instruction interrupt void Trap void asm SWI 3 4 7 Version specific information for RS08 The ROM and RAM ranges depend on the target processor The reservep_ram size for pseudo registers storage is by default 5 bytes Component implementation details e Interrupts Some of the RSOS derivatives do not support interrupts so the components on these processors are limited and some are not available The following components are not available on the RSO8 derivatives wit
183. pert CWMCU_PE5_00 3 10 Static code support in Processor Expert This chapter describes static initialization support in Processor Expert For selected microcontrollers Processor Expert offers static that is not generated initialization code consisting of Processor Expert startup code Peripheral Initialization Components and CPU processor component code Peripheral Device Drivers PDD and peripheral memory map This feature is currently available for MC56F8200 Kinetis V Kinetis W families and MK24 MK63 MK64 MKE06Z128 64 MKE04Z128 64 and SKEAZ128 64 derivatives Rest of the Kinetis derivatives support only PDD and peripheral memory map static code CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 170 Freescale Semiconductor Inc EE Chapter 3 Application design 3 10 1 Static initialization code For selected families of processors Peripheral initialization and processor components use static peripheral initialization drivers Each instance of MCU peripheral has its own initialization driver placed in static i e not generated module Processor module which covers MCU startup is also implemented using static code Peripheral Initialization Components covers all MCU peripherals with exception for system and bus clock generator peripherals which are controlled by processor component as they are part of Processor Expert timing model and their initialization is done during the startup Each
184. pment Studio Processor Expert User Guide Rev 10 6 02 2014 148 Freescale Semiconductor Inc EE I Chapter 3 Application design 3 5 2 3 Structure for 16 bit register 16 bit register big endian format typedef union word w struct byte high low b TWREG 3 5 2 3 1 Version specific information for 56800 E For information on SDK types definitions go to the page SDK types 3 5 2 4 Macros DI Disable global interrupts EI Enable global interrupts EnterCritical It saves CCR register and disable global interrupts ExitCritical It restores CCR register saved in EnterCritical For the list of macros available for Peripheral registers access see Direct access to peripheral registers topic 3 5 2 5 Constants 3 5 2 6 Methods error codes The error codes are defined in the PE_Error module Error code value is 8 bit unsigned byte Range 0 127 is reserved for PE and 128 255 for user ERR OK 0 OK ERR SPEED 1 This device does not work in the active speed mode ERR RANGE 2 Parameter out of range Table continues on the next page CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 149 Code generation and usage ERR_VALUE 3 Parameter of incorrect value ERR_OVERFLOW 4 Timer overflow ERR_MATH 5 Overfl
185. ponent Inspector by changing the address of the memory area with the name INT VECTORS CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 140 Freescale Semiconductor Inc EEEEEyyyyyyEE M Chapter 3 Application design Note that if the IVT placement is changed you have to provide a full IVT on the the address defined by the processor datasheet and the vectors allocated by Processor Expert have to be redirected into the IVT generated by PE If the interrupt vector table in RAM application option is selected then it generates the table in RAM and special redirection code to ROM This code transfers program control to the selected address according the table in RAM You can use the processor method SetIntVect to set the address of interrupt service routine It is recommended to select the event OnSWI together with this option to minimize the size of generated code Please note that the redirection is available only for interrupt vectors not used by Embedded Components in the current project On HCS12X derivatives These derivatives allow to change the placement of the interrupt vectors beginning So the Processor Expert allows to adjust both the physical placement of vectors or the placement of the generated IVT The content of the property group Interrupt Reset vector table in the group Interrupt resource mapping and its documentation PPG HW doesn t support an interrupt Aligned Cente
186. ponent settings a user specified name of an ISR and name of the interrupt vector is shown If an ISR name is not specified interrupt has to be disabled in this case only the interrupt vector name is present You can specify an ISR in the component and generate the code If the Generate ISRs project option is selected empty ISR templates are generated into an event module If you disable an ISR and select the Delete unused events and ISRs project option empty ISR templates are removed automatically PESL commands low level PESL commands related to the peripheral configured by this component This folder is available only for Peripheral Initialization components PDD Macros low level PDD macros for peripherals allocated by the component Macros can be dragged and dropped into the source code If the PDD macro is dragged the base address parameter is automatically filled with the macro value which uses the peripheral selected in the component PDD The global list of all PDD macros for all available peripherals are grouped by peripheral name This folder is available only if PDD is available for the currently active CPU PDD commands are low level peripheral access macros and they are the replacement of PESL macros PDD commands are available on all platforms supported by Logical Device Drivers LDD Macros can be dragged and dropped into the source code For details on PDD see Low level access to peripherals topic NOTE PESL and PDD
187. pplications 22 Alphabetical 36 C startup 716 Ancestor 07 Assistant 36 D AsynchroMaster 28 AsynchroSerial 28 Deinit 70 AsynchroSlave 728 Delete 37 Descendant 701 B design specifications 8 Disable Event 54 Bare metal Applications 70 Distinct mode 35 Basic view 46 Documentation 70 bit 53 BitlO 129 E BitIO BitsIO ByteIO Byte2IO Byte3IO Byte4IO 142 Easy Initialization 64 Build options 47 EIO 149 Bus clock 23 Embedded Components 27 Byte2IO 129 Enable Event 54 Byte3IO 129 EnterCritical 149 Byte4IO 29 ERR ARBITR 50 BytelO 129 ERR BUSOFF 50 ERR COMMON 150 C ERR FAILED 7 50 ERR LINSYNC 150 capture 24 ERR MATH 7 50 Capture 42 ERR OVERFLOW 150 Categories 36 ERR QFULL 750 CDE 17 ERR RANGE 1 49 CGMXCLK 28 ERR SPEED 7 49 CMT 130 ERR TXFULL 7 50 code generation 35 43 ERR VALUE 150 Code generation log 45 EventCntr16 728 Code generator 18 EventCntr8 16 32 141 ColdFire 90 143 Event module 44 ColdFire V1 Derivatives 90 Events 24 Collapse 37 ExitCritical 749 Communication components 62 Expand 37 Complete initialization in Peripheral Init Expert view 46 Component 54 Export 34 Component 23 External user module 24 Component driver 24 ExtInt 129 143 Component Enabled 35 Component Inspector 23 46 Component module 44 CodeWarrior Development Studio Processor Expert User Guide Freescale Semiconductor Inc 193 Index F Filtering 37 fixed value 49 FlexCAN 25 FPGA 7 FreeCntr8 16 32 130 Free running device
188. processor component inspector defined for this purpose See Component Inspector topic for details 3 4 1 2 C startup function The C startup function in the C startup module is called at the end of the _zntryPoint o function It provides a necessary initialization of the stack pointer runtime libraries At the end of the C startup function the maino function is called CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 116 Freescale Semiconductor Inc EEE Chapter 3 Application design 3 4 1 3 PE_low_level_init There is a second level of Processor Expert initialization pz_1ow 1eve1_init called at the beginning of the main function pz_1ow_level_init function provides initialization of all components in project and it is necessary for proper functionality of the Processor Expert project 3 4 1 4 OnReset event You can write the code that will be invoked from the pz 1ow 1evei inic function after the Processor Expert internal initialization but before the initialization of individual components Thus you should expect that peripherals are not completely initialized yet This event can be enabled disabled in the processor component inspector s events page For details on 56800EX family see Reset scenario with PE for 56800EX topic CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 117 Implementation details 3 4 2 Reset s
189. r HCS12 and HCS12X Version specific information for Kinetis and ColdFire Additional implementation specific information can be found on individual component documentation pages CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 115 Implementation details 3 4 1 Reset scenario with PE for HC S 08 RS08 and 56800 E CPU reset 1 EntryPoint pL itializati f 1 1 I 1 initialization PLL ext bus 1 1 1 l 1 1 I I l 1 PE low level init Second level of PE initialization Cpu_OnReset e nd User s code ll initialization code generated by Processor Expert Lege E User application code in event module Call of a method or occurence of an event Return from method event or interrupt Interrupt Figure 3 28 Reset sequence diagram with Processor Expert 3 4 1 1 _EntryPoint function The entrypoint function is called as the first function after the reset This function is defined in the cpu module usually cpu c and provides necessary system initialization such as PLL and external bus Sometimes it is necessary to do some special user initialization immediately after the cpu reset Processor Expert provides a possibility to insert user code into the _entrypoint function There is a User Initialization property in the Build Options tab of a
190. r Mode Counter counts from 0 up to the value period register and then back down to O If the align mode is switched to Center align mode then real lengths of Period and Starting pulse width signals will be twice as much as is being displayed in the Component Inspector Note See the Internal peripheral property group of the processor component for special settings PWM HW doesn t support an interrupt Aligned Center mode Counter counts from 0 up to the value period register and then back down to 0 If align mode is switched to Center align mode then the real lengths of Period and Starting pulse width signals will be twice as much as is being displayed in the Component Inspector NOTE See the Internal peripheral property group of the processor component for special settings EventCntr8 16 32 Functionality of this component is a subset of the pulse accumulator For work with hold registers gated time mode use the PulseAccumulator component instead of the EventCounter component PulseAccumulator Method Latch This method causes capture of the counter in the hold registers of all capture and pulse accumulator components in PE project because this method is invoked for all ECT modules CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 141 See el Implementation details NOTE See Internal peripheral property group of the processor component for special settings Captur
191. rally useful and generic types that are used throughout the domain of motor control kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk kkkkkkkkk RR KKK KKK Fractional data types for portability typedef short Fracl6 typedef long Frac32 typedef enum mcPhaseA mcPhaseB mcPhaseC me ePhaseType typedef struct CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 151 Code generation and usage Fracl6 PhaseA Fracl6 PhaseB Fraci6 PhaseC mc s3PhaseSystem general types primary used in FOC typedef struct Fraci6 alpha Fracl6 beta me sPhase MEME struct Fracl6 sine Fracl6 cosine mc_sAngle typedef struct Fracl6 d axis Fracl6 q axis mc_sDQsystem typedef struct Fracl6 psi Rd Fraci6 omega field Fracl6 i Sd Fraci6 i Sq mc sDQEstabl typedef UWordi6 mc tPWMSignalMask pwm tSignalMask contains six control bits representing six PWM signals shown below The bits can be combined in a numerical value that represents the union of the appropriate bits For example the value 0x15 indicates that PWM signals 0 2 and 4 are set general types primary used in PI PID and other controllers typedef struct Wordl6 ProportionalGain Wordl6 ProportionalGainScale Wordl6 IntegralGain Wordl6 IntegralGainScale Wordl16 DerivativeGain Wordl6 DerivativeGainScale Wordl16 Positive
192. rated Component Modules 3 5 1 1 Files produced by Processor Expert The existence of the files can be conditional to project or Processor Expert environment settings and their usage by the components See Project static modules topic for more details on files produced for project with static code support Component module This module with its header file is generated for every component in the project with exception of some components that generate only an initialization code or special source code modules Name of this file is the same as the name of the component Header file h contains definitions of all public symbols which are implemented in the component module and can be used in the user modules The module contains implementation of all enabled methods and may also contain some subroutines for internal usage only Processor module The processor module is generated according to the currently active target processor component The processor module additionally contains microcontroller initialization code interrupt processing Main module The main module is generated only if it does not already exist if it exists it is not changed Name of this module is the same as the name of the project The main module contains the main function which is called after initialization of the microcontroller from the processor module By default this function is generated empty without any reasonable code It is designed s
193. ration header file is generated for each component with static code support added to the project These modules are generated only for projects with static code support For more details refer to the Peripheral initialization component files topic For more details refer to the Predefined Types Macros and Constants topic CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 146 Freescale Semiconductor Inc EEL Chapter 3 Application design 3 5 1 2 Tracking changes in generated code Processor Expert allows to track changes in generated modules It is just necessary to enable the option Create code generation log in the Processor Expert Project options Refer to the Processor Expert options topic for details If this option is enabled a file ProcessorExpert CodeGeneration txt i generated into Documentation folder The file contains a list of changes with details on purpose of each change Refer to the example below Listing Example Tracking changes in generated code EHE PEHE HE HE HE HE HE HE HE HE HE HE HE HE HE HE HE HE HE HE HE HE HE HE HE HE HE HE HE HE HE HE HE HE HE PE HE HE HE HE FE HE HE HE HE HE HEHE HE H H HH H HHH HHHH Code generation 2010 10 22 15 57 CodeGen 1 by user by Processor Expert 5 00 for Freescale Microcontrollers PE core 04 46 Configuration Debug_S08GW64CLH Target CPU MC9S08GW64_64 CPUDB ver 3 00 000 The following code generation options were changed gt option
194. re checkbox is selected as shown below CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 30 Freescale Semiconductor Inc Chapter 2 User interface gt Preferences t e Gt EO Er H E H E 2 2 Components view To open this view click Window gt Show View gt Other and select Processor Expert General Appearance Capabilities Compare Patch Content Types Diagnostic Information Drag and Drop Editors High Latency File System Keys 4 Network Connections Perspectives Search Security Startup and Shutdown Web Browser Workspace C C Coloring Editor Freescale Licenses Help Install Update Processor Expert Remote Launch Remote Systems RunjDebug Software Analysis Team Terminal Trace Configurations Startup and Shutdown Refresh workspace on startup Confirm exit when closing last window Plug ins activated on startup CodeWarrior Core IDE Toolchain Diagnostic Information Core Core IDE Disassembler Core IDE Drop Support Core IDE License Manager CodeWarrior New Project Wizard Automatic Path Mapping Core IDE Preprocessor Code IDE Resources Automatic Project RSE Settings Cache CodeWarrior Core IDE UI Core IDE Utility Freescale Update Custom Actions Equinox Provisioning Platform Automatic Update Support CodeWarrior CDT Debugger Adapters CodeWarrior CDT Debugger Startup CodeWarrior Remote Launch Scripting Plug
195. red not to wait until the end of the programming erasing operation property Wait enabled in init method SetWait the FinishProcess method has to be called after the end of the operation Since the flash device does not support erase verification feature the zraseverity method is implemented by software routine Thus it takes more time to verify the flash memory than this method is implemented by hardware module all parts of the flash memory have to be read 3 4 6 Version specific information for Freescale HCS08 and ColdFire V1 derivatives The ROM Z_RAM and RAM ranges depend on the target microcontroller It is recommended to increase the stack size if some standard libraries are used For the detailed information on debugging HC08 application using MONS interface see Debugging on HC08 using MONS topic Components implementation details All the components Interrupts priorities For details on priority settings for interrupts and event see Processor Expert priority system topic Processor bd Speed Mode selection processor methods SetHighSpeed SetLowSpeed SetSlowSpeed If processor clock dependent components are used the signals generated from such internal peripherals may be corrupted at the moment of the speed mode selection if function of clocked devices is enabled Handling of such a situation may be done using events BeforeNewSpeed and AfterNewSpeed nterrupt vector table in ROM is placed at the def
196. riginal SDK library For more details refer to the appropriate components documentation CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 150 Freescale Semiconductor Inc SSS SSS een Chapter 3 Application design SDK types definition typedef signed char Word8 typedef unsigned char UWord8 typedef short Wordl6 typedef unsigned short UWord16 typedef long Word32 typedef unsigned long UWord32 typedef signed char Int8 typedef unsigned char UInt8 typedef int Int16 typedef unsigned int UInt16 typedef long Int32 typedef unsigned long UInt32 typedef union struct UWord16 LSBpart Word16 MSBpart RegParts Word32 Reg32bit decoder uReg32bit typedef struct union Wordl6 PositionDifferenceHoldReg Wordl6 posdh union Wordl6 RevolutionHoldReg Word16 revh union decoder uReg32bit PositionHoldReg Word32 posh decoder sState typedef struct UWordl6 EncPulses UWord16 RevolutionScale Int16 scaleDiffPosCoef UInt16 scalePosCoef Int16 normDiffPosCoef Int16 normPosCoef decoder sEncScale typedef struct UWord16 Index 1 UWordl6 PhaseB UWordi16 PhaseA UWordl6 Reserved 13 decoder sEncSignals typedef union decoder sEncSignals EncSignals UWordl6 Value decoder uEncSignals kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk kkkkkkkkkkkkkkk sI ak ockckckck kckok This Motor Control section contains gene
197. ring design time Be sure that the component setting conforms to peripheral parameters Choose the initialization state of the component Choose which methods you want to use in your code and which event you want to handle Use several components of the same type with optimal code for each component The concept of the peripheral allocation generally does not enable sharing of peripherals because it would make the application design too complicated The only way to share resources is through the components and their methods and events For example it is possible to use the RTIshared component for sharing periodic interrupt from timers 3 2 1 3 Methods Methods are interfacing component functionality to user s code All enabled methods are generated into appropriate component modules during the code generation process All Methods of each component inserted into the project are visible as a subtree of the components in the Components view You can use in your code all enabled methods The easiest way to call any method from your code is to drag and drop the method from Components view to the editor The complexity and number of methods depend on the component s level of abstraction CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 65 Basic principles 3 2 1 4 Events Some components allow handling the hardware or software events related to the component You can spec
198. rnal or internal event such as button push or internal timer overflow When the event occurs microcontroller is switched to high speed mode to make a measurement computation and communication with external devices When the job is done microcontroller is switched back to sleep The figure below shows situation when application runs the microcontroller is clocked from an external source the reference clock is processed by internal clock circuits for example clock frequency is increased by PLL module and distributed across system Core and IP 1 run from divided output of internal clock generator data computation and communication interface handling whether IP 2 runs directly from external reference clock for example because frequency from clock generator output is out of admissible range of this peripheral Internal reference clock and IP 3 are not used therefore are powered down Figure 3 7 Clock configuration example in application run state The next schematic shows low power configuration an internal clock reference is used instead of external as it spends less energy No computation power is needed nor any peripheral that would need high speed clocks enabled therefore core is powered off along with the clock generator circuits Only IP 2 and IP 3 are enabled and clocked directly from the internal clock source waiting for event that will bring the microcontroller back to operational mode CodeWarrior Development Studio Process
199. rocessor component inspector s events page 3 4 3 Reset scenario with PE for 56800EX with static code support 3 4 3 1 EntryPoint function The entrypoint function is called as the first function after the reset This function is defined in the cpu_tmnit c module and provides necessary system initialization such as PLL and external bus The first level of PE initialization in _Entryroint contains 1 Setting either normal or fast run mode based on Clock settings OCCS Dual speed clock property in processor component 2 Disabling of the watchdog if required in Common settings Watchdog item in processor component Initialization of the fast interrupt 0 and fast interrupt 1 if they are used Initialization of the PLL interrupts priority Initialization of the external reference clock source including initialization of related pins based on settings of Clock settings OCCS External reference clock properties in processor component 6 Initialization of the external reference clock source including initialization of related pins based on settings of Clock settings OCCS External reference clock properties in processor component 7 Initialization of the internal oscillators based on settings of Clock settings OCCS Internal oscillator properties in processor component 8 Selection of the CPU clock source based on Clock settings OCCS Clock configurations Clock configuration O Input clock source property in processor compon
200. rror code zrr_pisasiep neither zrr_ewasiep If the method is called in unsupported mode it may not work correctly Ignore speed mode test This option can disable generation of the code that provides a testing if the component is internally supported in the selected speed mode If the option is set to yes methods do not return error code za srzsr If the method is called in the speed mode when the component is not supported it may not work correctly Use after reset values This option allows Processor Expert to use the values of peripheral registers which are declared by a chip manufacturer as default after reset values If the option is set to no all registers are initialized by a generated code even if the value after reset is the same as the required initialization value If the option is set to yes the register values same as the after reset values are not initialized Complete initialization in Peripheral Init Component This option can disable shared initialization peripheral in Init methods of Peripheral Initialization Components If this option is set to yes the complete peripheral initialization is provided in Init method even for parts that are already initialized in processor or elsewhere It could mean longer code but the initialization can be repeated in application using the Init method 2 5 Processor view This view displays selected target microcontroller with its peripherals and pins It allows you to generate
201. rrupt service is enabled If the interrupt service is disabled and a mode fault occurs the component will be disabled at the beginning of recvchar method SynchroSlave e On HCO8 family microcontrollers A mode fault doesn t disable an SPI device configured as Slave therefore it doesn t disable the component If a mode fault error occurs software can abort the SPI transmission by disabling and enabling of the device gnabie and pisable methods When Clock edge property falling edge Shift clock idle polarity property Low or Clock edge property rising edge and Shift clock idle polarity property High the SS pin of the slave SPI module must be set to logic 1 between bytes The falling edge of SS indicates the beginning of the transmission This causes the SPI to leave its idle state and begin driving the MISO pin with the MSB of its data Once the transmission begins no new data is allowed into the shift register from the data register Therefore the slave data register must be loaded with the desired transmit data before the falling edge of SS BitIO BitsIO ByteIO Byte21IO Byte3IO Byte4IO The cetva1 and cetpir methods are always implemented as macros Optimization for property BitIO BitsIO does not influence the generated code WordIO LongIO These components could not be implemented on Freescale HCO08 this processor has no instructions for 16 bit and 32 bit access into the I O space ADC Clock inp
202. rsion steps are as follows 1 Select the menu command File gt New gt Other 2 Within the Select a wizard dialog select Processor Expert Enable Processor Expert for Existing C Project and click Next 3 Select the project that you would like to convert and the project type Processor Expert can generate initialization code and drivers for on chip peripherals and also drivers for selected external peripherals or software algorithms See Features of Processor Expert topic for details Select the microcontroller that the project is designed for Select the microcontroller variant s and Processor Expert configurations that you would like to have available in the project NOTE The functionality of the existing build configurations in the existing project like console_ram is not guaranteed These build configurations need to be updated typically a linker command file name has to be changed to the one generated by Processor Expert Un A 6 Review the actions that Processor Expert is about to perform You can deselect the checkboxes for items you would like not to be done Ensure that you have backed up your project before confirming before you confirm by clicking Finish button 7 Now it s necessary to move the application code from original main c located in Sources folder into new processorExpert c generated by Processor Expert in previous step consequently remove original main c module from the project 8 For Kinetis fa
203. rt User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc Internal signals Properties Methods Clock Diagram Name Value Details Component name TPMO Device TPMO TPMO Settings Channels 4 Pins External clock pin Disabled 4 HW Synchronization trigger Enabled A Pin EU MISS Sie MS metas ADCO SE14 TSIO_CH13 PTC Interrupts ADCO_SE14 TSIO_CH13 PTCO EXTRG_IN CMP0_OUT 4 Initialization CMPO INO PTC6 LLWU P10 SPIO MOSI EXTRG IN SPIO MISO Call Init method PTBS EXTRG IN CMPO output Low power timer PIT trigger 0 RTC seconds TPMO Overflow TPMI Overflow TPM2 Overflow Figure 3 34 Timer synchronization trigger selection in Init TPM From the list internal signals are cupo_output Comparator 0 output Low power timer Low power timer event prr trigger o 1i Periodic interrupt timer 0 and 1 event rtc_alarm Real time clock alarm event rtc_seconds Real time clock second event TPM0 1 2 Overflow Timer PWM module 0 and 2 overflow event 3 11 1 Differentiation of internal signals and pins It is often possible to choose peripheral input between internal signals and package pins For example figure below shows comparator input source selection offered in the AnalogComp_Lpp Component There is list of pins and internal signals that can be used as comparator input In Processor Expert only pin names uses slash separator to distinguish individual pin functions Internal signals do not contain this symbo
204. rt wizard appears Expand Processor Expert tree Select Component Settings to Project option as shown below Select Import Processor Expert Component Settings Select an import source General amp cic CodeWarrior Example Project MCU Executable Importer amp Component Development Environment cvs Install amp Processor Expert Eg Apply Board Configuration Component Settings to Project SS Component s to Components Library gt RunjDebug gt Software Analysis H E Team gt Other D E E i E Ee Ee Figure 3 22 Import wizard 2 Click Next The Import PEx Project Component Settings page appears CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 109 Configuring components Import Processor Expert Component Settings Import Processor Expert Project Component Settings Import selected component settings from the File to selected project Select input file D Profiles b13706 workspace try try pef Select target project Select mode For import of component settings Sy I2C RGB Imported component Mode Correspondin Y testi dB Cpu MKL252128LK4 gt Replace settings Cpu mki2 Sty 3 PWMTimerB TimerUnit_LDD gt Replace settings g PwWMTimer Pw TimerRG TimerUnit_LDD co Replace settings g PWMTimer l 12 12C_LDD cp Replace settings I2C I2C L cs101 Consolelo CD Replace settin
205. s no no Enumeration red External file Images About_bw bmp External bitmap file Images About_bw bmp Directory El Group of items group of integer numbers Integer signed i 5 Integer unsigned 100 D Link to inherited component EventCntr8 Link to shared component DT1 El List of items 1 Realo 0 0 Peripheral selection ADC Real number 0 0 String default string value String list 0 line s Time 08 15 00 Date 2000 12 31 Y Timing settings 100 ms E Figure 2 13 Example component with various inspector item types This table explains the various types of items Table 2 2 Inspector item types C a S ae Boolean Group A group of settings controlled by this boolean property If the group is enabled all the items under the group are valid if it is disabled the list of items is not valid Clicking sign will show hide the items in the group but doesn t affect value or validity of the items Boolean yes no You can switch between two states of the property using a drop down menu The Generate code Don t generate code settings of methods and events works the same way and determines whether the implementation code for the Table continues on the next page CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 44 Freescale Semiconductor Inc Chapter 2 User interface Table 2 2 Inspector item types continued po Description corresponding method or event will be generated or not you m
206. s for instance cpu and peripheral init modules PDD modules io map system files are linked from the repository of Processor Expert ProcessorExpert lib subdirectory Modification of these files is possible only in the Processor Expert s repository and affects other projects n Standalone mode static files for instance cpu and peripheral init modules PDD modules io map system files are placed in the project folder They are copied from Processor Expert s repository ProcessorExpert lib subdirectory during project creation This mode allows to modify the static files in the project without affecting other projects NOTE Static files are not supported for all derivatives For details on configurations see Configurations topic 3 2 2 6 Compiler selection This dialog is shown when you add a new processor component into project using Components Library view If there are more target compilers available you can select the compiler to be used for the newly added processor imi xi Processor Expert Project Select target compiler Target Compiler CodeWarrior ARM C Compile Finish Cancel Esh Figure 3 5 Compiler selection CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 76 Freescale Semiconductor Inc EE Chapter 3 Application design 3 2 2 7 Processor properties overview Processor properties can be set in processor Component Inspector view The complete
207. s all items within the selected group Otherwise all groups in the inspector are expanded If the expanded group contains any groups that are disabled gray the user is asked if the disabled groups should all be expanded Collapse All if a group is selected collapses all items within the selected group Otherwise all groups in the inspector are collapsed Help on Component shows a help page for the component Pin Sharing Enabled enables the pin sharing This command is available only for pin properties For more information see Pin sharing topic Move Item Up moves the item up in the list CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 43 Component Inspector view Move Item Down moves the item down in the list Move Item Top moves the item on the top of the list Move Item Bottom moves the item at the bottom of the list NOTE Move options are enabled for ListItemFromFlle property Delete Item does not delete the component but can delete the property item from the list of property The list of items can have some constraints on minimal or maximum number of items Add ADC component into the project and add at least one extra channel then you will be able to see this option enabled 2 4 5 Inspector items The following types of the items are there in the Component Inspector view Boolean group Enabled Boolean ye
208. s is the LDD TDeviceData Structure pointer If the component is set to Auto initialization yes as in this example then there is generated a component name DeviceData constant that can be used If not it is up to the user to call the tit method first and then use the returned pointer as the first parameter Events c 23 cmg seas ZZD TITT ra STS TSS TSS TS TST STS TSS ei jal void TU1 OnCounterRestart LDD TUserData UserDataPtr t Write your code here GPIO1 ToggleFieldBits GPIO1 DeviceData LedPin 1 Figure 4 4 Inserted command 4 1 4 2 Running application 1 Build the project using the Project gt Build command from the CodeWarrior menu 2 If you have the TWR K60N512 board connect it now Run and debug the application using the Run Run command from the CodeWarrior menu When the application starts running one of the on board LEDs starts blinking CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 191 Tutorial project for Kinetis microcontrollers CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 192 Freescale Semiconductor Inc Index Index A components 27 Configuration Registers 35 A D converter 27 Configurations 94 abstraction 67 ConnectPin 703 Abstraction 67 ConnectPin Method 703 Access Macros 68 Constants 48 ADC 129 Counter 24 Add to Project 37 CPU ticks 53 Advanced view 46 Creating A
209. s that it is possible to reach all values within the interval by using the same prescaler Note that this kind of runtime setting requires runtime computations that can be time and space consuming and may not be supported on all microcontrollers NOTE Some of the methods used for runtime setting of timing will be enabled only if the appropriate runtime setting type is selected 2 4 7 1 4 Timing values table This table allows to set or modify a requested value s for the configured timing Each row represents one time value and the number of rows depends on the selected type of runtime setting For the option fixed value there is only one row Init Value containing the fixed initialization value For the option from a list of values there is one row for each of the possible timing modes It is possible to enter 16 possible values modes The empty fields are ignored You can drag and drop rows within the table to change their order See Runtime setting configuration topic for more information For the option from interval the table has three rows that contain the Initial value low limit and high limit of the interval See Runtime setting configuration topic for details on this type of runtime setting There are two editable columns Value Fill in a requested time value without units The drop down arrow button displays a list of values and you can select one of them It is also possible to set the value by double clicki
210. se the Component Inspector window open the view menu using the arrow icon in the top right corner and select Save component settings as template 2 Fill in the template details into the dialog and confirm CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 98 Freescale Semiconductor Inc Py Chapter 3 Application design xi Component Template Name MBye1 Template Author me Template Description General Byte Input Output 8 bits a Figure 3 11 Component template 3 The template appears within the Components Library view and can be inserted into projects It may be necessary to invoke refresh command by selecting the pop up menu of Components Library and select Refresh option S Components Library 53 gv n0 Categories Alphabetical Assistant Processors Component Component Level gt CPU Internal Peripherals gt Logical Device Drivers E Communication amp Converter i Logical Device Driver A DAC LDD Logical Device Driver amp Display LCDC LDD Logical Device Driver SegLCD LDD Logical Device Driver DMA amp Human Interface gt Measurement i EJ m ft amp Ge E Er lt No project Focused filtering disabled L Figure 3 12 Components Library view 3 3 6 Signal names The main purpose of signals allows you to name the pins used by components with names corresponding to the application 3 3 6 1 Assigning signals to pins
211. se three processor Component speed modes instead High speed mode this mode is selected after reset and must be enabled in the project This speed mode must be the fastest mode of the main processor clock Low speed mode this mode is usually used for another PLL or main prescaler settings of the main processor clock Slow speed mode this mode is usually used for the slowest possible mode of the main processor clock CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 77 Basic principles 3 2 2 8 1 Switching speed modes at runtime The modes can be switched in the runtime by the following processor component methods SetHighSpeed e SetLowSpeed e SetSlowSpeed If a speed mode is enabled in the processor Component properties the corresponding method is enabled automatically NOTE It is highly recommended to disable interrupts before switching to another speed mode and enable them afterwards 3 2 2 8 2 Speed modes support in components Using the component property processor clock speed selection it is possible to define the speed modes supported by the component Some components allow to set two values of the processor clock speed selection property e Supported The processor clock speed selection group contains properties defining which speed modes are supported for the component Ignored The speed mode settings are ignored and there are no act
212. see Inspector items topic for details It also displays pin variant and package in drop down list of supported processor variants for example MQXLite project as shown below amp y Component Inspector Cpu 2 Basic Advanced Cg C Properties Methods Events Build options Resources Mame Value Details CPU type MKE02216VLD2 in LOFP 44 p v Clock settings MKE02216VLD2 in LOFP 44 Initialization priority MKE02216VLC2 in LQFP 32 pin package Watchdog disable CPU interrupts resets Clock configurations 1 Clock configuration 0 Clock source setting configuration 0 ICS mode FEI System clocks Core clock 16 777216 16 77721 Bus clock 16 777216 16 77721 Figure 2 8 Displaying pin variant and package e Details the current setting or an error status may be reflected on the same line in the rightmost column of the inspector CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 39 Component Inspector view The Component Inspector can be displayed in three views The views can be selected from the Preferences dialog On the left side of the Preferences dialog select Processor Expert gt General On the right side select Preferred inspector views from the drop down list as shown below Preferences be Ee EH H E General CiC Coloring Editor Freescale Licenses Help Install Update MQX Preferences
213. several inspector views for different components opened at once CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 42 Freescale Semiconductor Inc Chapter 2 User interface Tabs view this view displays configuration elements in graphical form better organized easy to understand and use Nested tabs and tables are used to present complex configurations Search searches Inspector item by name It also accepts wild cards like or any string and any character 2 4 4 Pop up menu This menu is invoked by right clicking a specific inspector item The menu contains the following commands Sy Component Inspector Cpu 3 Basic Advanced a BH Mame CPU type amp Clock settings Internal oscillator System oscillator Clock source settings ICS settings ICS mode FLL settings FLL module ICS output clock Initialization priority Watchdog disable Properties Methods Events Build options Resources Slow internal reference clock 32 768 j Resource Configurations gt Clock source setting 0 ICS external ref clocl 0 0 FLL output MHz 33 554432 ICS output prescaler Auto select Value Details MKE02216VLD2 Expand All Collapse All Help on Component Disabled 1 FEI Enabled 16 777216 interrupts enabled yes Figure 2 12 Component Inspector view pop up menu Expand AIl if a group is selected expand
214. sh to complete the exporting of component settings Now you know how to export component settings 3 3 9 2 Export board configuration It is possible to export one processor and one or more components the components automatically selected are CPU Pin settings LDD and Init components CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 106 Freescale Semiconductor Inc EE Chapter 3 Application design You can save the current state of components related to board configuration in to the external file The extension of the file is peb The default location for saving the output file is recently selected folder your home directory To export board configuration 1 In the IDE select File gt Export The Export wizard appears Expand Processor Expert tree Select Export Board Configuration option as shown below Select Export Board Configuration Select an export destination General cic E Component Development Environment amp Install Processor Expert a SS Export Component Settings Remote Systems amp RunjDebug Team amp Other D H 6 H H D E E Cancel Figure 3 20 Export wizard 2 Click Next The Expert Processor Expert Board Configuration page appears CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 107 Configuring components Export Processor Expert project
215. sor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 157 Code generation and usage End of Processor Expert internal initialization p MyDevice AS1 Init NULL Initialize driver and peripheral AS1 Deinit MyDevice Deinitialize driver and peripheral for 3 5 3 4 1 Deinit method Deinit method disables a peripheral and frees the allocated memory if supported by the RTOS adapter peinit method is usually used in RTOS applications not in bare metal applications 3 5 3 4 2 Interrupt handling Most of LDD components are designed to be used in the interrupt mode It means that the interrupt service routine ISR is called by the interrupt controller when an asynchronous interrupt occurs Interrupt service routine is defined in LDD driver and a user is notified through component s events Events can be enabled or disable in the component inspector according to an application needs When an event is enabled the appropriate function is generated into Event c where a user can write own event handler code Events are called from the ISR context so a user should keep an event code as short as possible to minimize a system latency 3 5 4 User changes in generated code It s necessary to say at the beginning of the chapter that modification of the generated code may be done only at user s own risk Generated code was thoroughly tested by the skilled developers and the functionality of
216. ssor EXDGIL une recae teta eire telae reser Ee mue qua RM RcOR canceusngead a e ERE IRA tra E 63 A2 Basie Principle T 64 3 2 Embedded COMPONGING e 64 PAN E A T A A P A A T E A I 64 3 212 Easy on chip penpherals msneagemebl eerie bom tora e nerin Ea n iveri t iieiaeie 64 Bilis CI a E A E O E E E A EE E 65 EVO MET o mtt RENE 65 Jala T i ein e T UU Abdesab menecwlenaeeaneesbard 66 241 5 IhBphlycontisumbls and extensible DLA Y iurien cire ema dde ipsc dk ime iS 66 doi Ao TOUR Cale IOC qaod eh dipsa O Une DU Leliabplu ta etii anes 66 Ag Lessheor qbelb clbdL ueepoosaciamactucaiae ea a A Mirac uisu pe mudo La dU add 67 LM Lose Derce DAYE e 69 3 2 1 8 1 Differences between LDD and high level components eene 69 3 2 1 8 2 Logical device drivers in bare metal applications ceres e enr ntes 70 321 8 3 Logical Device Drivers in RTOS envitonfi ni senrima 70 ENG E C M RTOS irr m 71 ENS MNT Ir c T 71 LA T Lor power TASS e T 72 Iaa Processor compone PT 72 Saal MPP ca sess ca cence shatter ain bata a a N A a T3 22212 Judd DUODESSD T0 3 DEOIGER aaa a RE E cia eau aM NES UE 73 deaa dmelechng d processor AS TATHED Process DE neroa ara a doi nid axiekiscd ont db cod visia tubi adii etaRIE E CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc
217. ssor Expert Concepts Terms and Definitions Used in Processor Expert 1 1 Overview Processor Expert provides an efficient development environment for rapid application development of the embedded applications You can develop embedded applications for a wide range of microcontrollers and microprocessor systems using Processor Expert Processor Expert is integrated as a plug in into the CodeWarrior IDE You can access Processor Expert from the CodeWarrior IDE using the Processor Expert menu in the CodeWarrior IDE menu bar The Processor Expert plug in generates code from the embedded components and the CodeWarrior IDE manages the project files and compilation and debug processes Figure below shows the Processor Expert menu in the CodeWarrior IDE menu bar CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 15 aa E Features of Processor Expert E CodeWarrior Project 23 5 Components test S Component Inspector Cpu 3 Basic Advanced Expert ih Sy Properties Methods Events Build options Used E z Name ELE Puy NEN Ej P rile Name eae O MKI0DX128VMPS XX amp Clock settings O MKIODNI28VMPS E File N Ham L s Initialization priority i Oo MK10DX64VMP5 S p testi MK10DN32 INTERNAL R Watchdog disable Omi orn E E Documentation S CPU interrupts resets 2 K10DN64VMPS v E E Generated Code NMI interrr
218. sters I O ports etc It is recommended to always use methods generated by Processor Expert If the functionality of generated methods is not sufficient for your application you can use PESL Processor Expert System Library See Low level access to peripherals topic for details Note that if a peripheral is allocated to any component all its parts are reserved For example if you use the 8 bit I O port all the I O pins of the port are allocated and it is not possible to use them in other components In some timer components you can choose if you want to use only a part of the timer compare register or an entire timer If you select the entire timer the driver can be optimized to work best with the timer For example invoke reset of the timer whenever it is needed by the component function CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 95 Configuring components 3 3 3 2 Interrupt priority If the target processor shares interrupt priority between several interrupt vectors or shares interrupt vectors Processor Expert provides checking of interrupt priority settings For detailed information about Interrupt Priority see Interrupt priority topic 3 3 3 5 Memory Processor Expert always checks the usage of the internal and external memories accessible through processor address and data bus Position and size of internal memory is defined by the processor type and can
219. t Component with the highest level of abstraction and usage comfort An application built from these components can be easily ported to another microcontroller supported by the Processor Expert They provide methods and events for runtime control For details see Component Categories topic Internal peripherals Internal devices of the microcontroller such as ports timers A D converters etc usually controlled by the processor core using special registers ISR Interrupt Service Routine Code which is called when an interrupt occurs LDD components Logical Device Driver components The LDD components are efficient set of components that are ready to be used together with RTOS They provide a unified hardware access across microcontrollers allowing to develop simpler and more portable RTOS drivers For details see Component Categories topic Low level component a component dependent on the peripheral structure to allow the user to benefit from the non standard features of a peripheral The level of portability is decreased because of this peripheral dependency For details see Component Categories topic Microcontroller Microcontroller Unit microcontroller used in our application Methods user callable functions or sub routines The user can select which of them will be generated and which not Selected methods will be generated during the code generation process into the component modules Module Source code module co
220. t Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc Chapter 2 User interface B y Component Inspector Cpu 25 Basic advanced La Properties Methods Events Build options Resources Component name Cpu CPUtype MKEO2Z16VLD2 Initialization priority interrupts enabled s Watchdog disable 9 1 Al Clock settings E i Internal oscillator Clock settings Internal peripherals CPU interrupts resets Low power mode settings Clock configurations Bj System oscillator E Clock source settings z E Internal peripherals Internal oscillator gt _ System oscillator Clock source settings Bus clock output NMI pin Reset pin Shared Flash memory organization 32 768 kHz Flash configuration Field E MCM settings Power management controller System Integration Module S CPU interrupts resets Non maskable interrupt Hard fault Supervisor call Pendable service ICS Loss of lock E Low power mode settings Operation mode settings Clock configurations Slow internal reference clock kHz 32 768 Figure 2 10 Tabs view In the Preferences dialog you can also choose the number of columns that will appear in Component Inspector view for displaying properties Select Inspector columns count and choose the value from 1 to 4 from the drop down list This option is valid only for Tabs
221. t pin back to the main component In fact the peripherals can usually operate simultaneously but they have no connection to the shared pins unless the connectpin method is executed In case that all components control the shared pin using one peripheral it is not necessary to use the connectpin method Shared pins are presented in the Processor view as well The component to pin connection line is red 3 3 9 Export and import Processor Expert allows to import or export component settings or configuration of selected Processor Expert components This section explains Export component settings Export board configuration CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 103 Configuring components Apply board configuration Component settings to project Component s to component library 3 3 9 1 Export component settings It is possible to export one or more component settings such as Configurations Operating system Processors Components To export component settings 1 In the IDE select File gt Export The Export wizard appears Expand Processor Expert tree Select Export Component Settings option as shown below CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 104 Freescale Semiconductor Inc Chapter 3 Application design Select Export Processor Expert Component Settings Select an export
222. take memory Basically the unused methods code is dead stripped by the linker but when the dependency among methods is complex some code should not be dead stripped When useless methods or events are enabled the generated code can contain spare source code because of these unused methods or events Moreover some methods can be replaced by more efficient methods that are for special purposes and therefore these methods are not enabled by default 3 6 1 2 Disabling unused components Disable unused and test purpose components or remove them from the project Disabling of these components is sufficient because the useless code is removed but the component setting remains in the project If these components are required for later testing then add a new configuration to the project and disable these useless component only in the new configuration The previous configuration will be used when the application is tested again Moreover if it is required to use the same component with different setting in several configurations its possible to add one component for each configuration with same name and different setting 3 6 1 3 Speed modes NOTE These optimizations are not usable for the Peripheral Initialization Components Timed components which depend on the processor clock such as timer communication and conversion components may support speed modes defined in the processor component in EXPERT view level The Processor Expert allows the user
223. tation of described features slightly differs in case of high level components as they operate with legacy speed modes conventions CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 83 Basic principles The following table shows number of supported clock configurations for each category of embedded component Component category Clock configurations Nee Peripheral Initialization 1 Clock configuration 0 High level 3 Speed modes LDD There are two main clock configuration features available in embedded components Enabled clock configuration selection Timing settings 3 2 2 8 3 4 1 Enabled clock configurations selection For each clock configuration it is possible to specify whether component will be enabled or disabled This means that when application switches to the particular clock configuration using the setclockconfiguration CPU method call the underlying internal peripheral will be switched on or off if the hardware allows it This way clock configurations can be utilized to create not only multiple system timing schemes but also power consumption oriented scenarios The figure of Component Inspector view displays the clock configuration selection group available in LDD components 4 CPU dlock configuration selection Clock configuration 0 This component enabled This component is enabled Clock configuration 1 This component daa
224. ted speed modes in the component s properties The settings are instantly validated according to the Processor Expert timing model For details on the timing settings principles see Timing settings topic 2 4 7 1 1 Timing dialog controls Timing dialog allows to select clock source manually To access clock source click Advanced button You can manually select the value for prescaler and clock source Clock path shows current clock path from source to consumer including all used prescalers and its configuration Additionally it shows frequency at each point of path CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 48 Freescale Semiconductor Inc Chapter 2 User interface Timing dialog TU5 Counter frequency Auto select timing Prescalers Req value Speed mode 0 Adjusted values Clock source Auto select Speed mode 0 ERCLI Prescaler Auto select Speed mode 0 0 Runtime settings type fixed value v Possible settings Clock path Selected speed mode Speed mode 0 v Value type Value Unit Init value kHz Name Presc Value Frequency gt Im SYSTEM_OSC 8 MHz gt LPTMRO_ClockSelect ERCLK 8 MHz LPTMRO CNR prescaler presc not set 8 MHz TOTAL T Allowed error Unit s 95 v Figure 2 15 Timing settings dialog 2 4 7 1 2 Auto select timing option This option is not supported for all components It is supported onl
225. ter 2 User interface FAN DR eR 2I abt JRGISUDOD DEL e i a A E piat fuir t adi tU Ida 28 alz Faca Ee OPON e 28 DRaa coo RA b atianieomeanaadeuenee 28 2122 Preeren iS ncen ER E EROE ATRAER I EN A RAR 29 Bad Components VIEN Me 31 2 2 1 bi mo M 34 Lic MIC C i a dence cadena adel ie tsaa wari vadabilie acueiuacuncerats 34 23 Component LIBRUS VIEN s e nsipestis eE ANEA ATE EEEE OOE EEEREN 36 C NEED saruspa n Ei akea eE AE EE da eN E inden ace aeia AE 36 CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 3 Section number Title Page ps MM ro c 37 EAE Popop Te m T aT LAE MEER DU cn Do LM 38 er deci cu cod Nor abii T rE 39 2 4 1 Pead oniy Lu eM i t m mE 42 zog ien made DUHOHE a dp AH de Stud o qiie iata a gas di dbu edad pc ica tmc M UE C MAR bue a A DACo Mae cues tat de qach dd 42 Z4 YEN aes socials is cvs cas carey RUNE PORA Dip RN au cq ap mieu pU d LM SEMEN QU UU IR Lipi ost dRcRUdd 42 BUE IPOD TREO d deeds een pb Rbtepu bib ut dodo do bete diefeid uiv doi idv Ib quio dbi ei bagbid duae piubupi anb Mrd cR UR Md 43 e s MEE enu me RT 44 rr si gi iiiter 46 2A oci nd ion M 46 ZATA Dialog for tis setitis
226. terrupt Vector table during the code generation process Please note that if the ISR name is filled it is generated into the Interrupt Vector Table even if the interrupt property is disabled Figure 3 31 Example of the interrupt configuration Enabling disabling peripheral interrupts during runtime has to be done by user s code for example by utilizing PESL or direct register access macros because the Peripheral Initialization Components do not offer any methods for interrupt handling The ISR with the specified name has to be declared according to the compiler conventions and fully implemented by the user NOTE For 56800 E version users ISRs generated by Processor Expert contain the fast interrupt handling instructions if the interrupt priority is specified as fast interrupt 3 5 3 4 Typical LDD components usage The tnit method is defined in all Logical Device Drivers The mit 0 method contains a complete initialization of the peripheral according to the component s settings See Logical Device Drivers for details The following example shows how to use Init method in user code main module in this case Let s assume a component named AS1 has been added to the project The user needs to add the call of the Init method into the user code for example in main module void main void LDD TDeviceStructure MyDevice Processor Expert internal initialization PE low level init CodeWarrior Development Studio Proces
227. the C types such as bool byte word This file is included in every driver of the component PE Error h Common error codes This file contains definition of return error codes of component s methods See the generated module for detailed description of the error codes This file is included in every driver of the component PE Timer This file contains shared procedures for runtime support of calculations of timing constants startupfile c This external module visible in the External Modules folder of the Components view contains a platform specific startup code and is linked to the application The name of the file is different for the Processor Expert versions For details on the use of the startupfile during the reset refer to the Reset scenario with PE for HC S 08 RS08 and 56800 E topic e PESL h PESL include file This file can be included by the user in his her application to use the PESL library For more details refer to the Processor Expert system library topic Static modules with static source code of Peripheral Initialization components processor component methods including startup methods IO map Physical Device Driver macros and other Processor Expert modules These modules are available only for projects with static code support For more details refer to the Project static modules topic Configuration header files containing parameterization constants which controls static source code Configu
228. the modified code cannot be guaranteed We strongly don t recommend modification of the generated code to the beginners See more information for generated modules in Code generation topic To support user changes in the component modules Processor Expert supports the following features Code generation options for component modules Freezing the code generation CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 158 Freescale Semiconductor Inc p M M Chapter 3 Application design 3 5 4 1 Code generation options for component modules It s possible to select mode of the code generation for each component the following options can be found in the components s pop up menu in the project panel Always Write Generated Component Modules default generated component modules are always written to disk and any existing previous module is overwritten Don t Write Generated Component Modules the code from component is not generated Any initialization code of the component which resides in the processor component interrupt vector table and shared modules are updated 3 5 4 2 Freezing the code generation Sometimes there is unwanted any change in the code generated by Processor Expert It s for example in case of manual modification done by the user and the user doesn t want to loose the code by accidental re generation of PE project For su
229. then this fact is signalized at the last line of the hint 3 11 2 Internal signal producer component linking When internal signal is used in the high level or LDD component the component producing the signal might be required by the component In such case special component linking property is used to add required component This feature is used to guide user to the components that are necessary for correct function of peripheral that depends on signal generated by different peripherals as shown in figure below CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 184 Freescale Semiconductor Inc C Chapter 3 Application design 5 Components mki25 22 Sy Component inspector ACL 2 Components Library GSQ av 7 Properties Methods Events 4 amp Generator Configurations FLASH amp OSs Component name ACi 4 amp Processors Analog comparator CMPO Cpu MKL25Z128VLK4 Interrupt service event Disabled 4 Components Positive inputs 1 4 Referenced Components Positive input 0 Wy DAL DAC_LOD A Pin E ACi AnalogComp LDD Source component amp PDD Negative inputs 1 Negative input 0 Name Value CMP0_IN1 PTC7 SPIO_MISO SPID_ CMPO_IN1 PTC7 SPI0_MISO A Pin 4 Source component Component Comparator output DACI2b0 Output DACI2b0 Output nternal DAL DAI Output filter New component DAC LDD Inverted output New component Init DAC VAR Analog comp mode mum T
230. timal uint32 E Y Input clock source Internal Y Counter frequency 20 972 kHz Timing setting Failed it is impossible S Y Counter restart On match Period device PIT_LDVALO Co Y Period Unassigned timing g Interrupt Enabled Interrupt priority medium priority 8 Channel list 0 Mi Figure 4 3 Component Inspector enabled interrupt For code generation see Code generation topic 4 1 4 Code generation To generate code click icon Generate Processor Expert Code in the Components view This generates source files for components to the Generated_Code folder in the CodeWarrior project view The Sources folder of the project contains user editable main c module with a skeleton of the main function and events c with event handlers After code generation do these steps Writing application code e Running application CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 190 Freescale Semiconductor Inc Chapter 4 Processor Expert tutorials 4 1 4 1 Writing application code In the Components view expand the TU1 TimerUnit LDD component s list of events and methods To view the source code of the TU1_OnCounterRestart in editor select it and right click on it to select View Code option from context menu Insert the following line into the TU1_OnCounterRestart event handler function body GPIO1 ToggleFieldBits GPIO1 DeviceData LedPin 1 NOTE The first parameter of LDD component method
231. tion information reflects Microcontroller default settings When the peripheral is not utilized by any Embedded Component Embedded Component settings When the peripheral is utilized by an Embedded Component and the component settings are correct Peripheral Initialization Inspector shows initialization as required by the component settings SS Configuration Registers 23 mL CPU v Reg name Init value After reset Address Peripheral registers RTC_CR 00000000 00000000 4003D010 SIM SOPT2 oooo0000 00000000 40048004 al MCG C1 D4 04 40064000 McCG C2 8n 80 40064001 MCG_C4 D00 000 40064003 MCG C5 00 00 40064004 MCG C6 oo 00 40064005 M Figure 2 19 Configuration Registers view The table shows the registers and their initialization value displayed in the column Init value You can modify the register value Registers value can be changed if They are not read only and when the project is without errors Editing of configuration registers is supported by given component CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 60 Freescale Semiconductor Inc EU Chapter 2 User interface This value written into the register or bit by the generated code during the initialization process of the application It is the last value that is written by the initialization function to the register The After reset column contains the value that is in the register b
232. to non zero Error allowed values are not shown CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 52 Freescale Semiconductor Inc Chapter 2 User interface 2 4 7 2 Syntax for the timing setup in the Component Inspector The properties that contain timing settings can be configured using the timing dialog For details see Dialog for timing settings topic or directly entering the timing value If the timing values are specified directly it is necessary to enter not only a value integer or real number but also the unit of that value The following units are supported microseconds A value must be followed by us milliseconds A value must be followed by ws seconds A value must be followed by s CPU ticks A unit derived from the frequency of external clock source If there is no external clock enabled or available it is derived from the value of internal clock source A value must be followed by ticks Timer ticks A unit representing number of changes for example increments of the counter used by the component The real time of one tick is influenced by input clock set for the timer Hertz A value must be followed by zz e kilohertz A value must be followed by xuz e megahertz A value must be followed by mnz bit second A value must be followed by pits e kbit second A value must be followed by x ics For example if you want to specify 100 milliseconds enter 100ns
233. to set closest values for the component timing in all speed modes if possible If the requested timing is not supported by the component for example if the processor clock is too low for the correct function of the component the component can be disabled for the appropriate speed mode The mode can be switched in the runtime by a processor method The component timing is then automatically configured for the appropriate speed mode or the CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 160 Freescale Semiconductor Inc lt SSE yh SEULS Chapter 3 Application design component is disabled according to the setting Note however that use of speed modes adds extra code to the application This code must be included to support different clock rates See speed mode details here See Embedded component optimizations topic for details on choosing and setting the components to achieve optimized code 3 6 2 General port I O optimizations NOTE These optimizations are not usable for the Peripheral Initialization Components 3 6 2 1 BytelO component versus BitslO component ByteIO component instead of BitsIO component should be used when whole port is accessed The BitsIO component is intended for accessing only part of the port e g 4 bits of 8 bit port Using the BitsIO component results more complex code because this component provides more general code for the methods which allows
234. tools This section covers the following topics Embedded components Creating applications RTOS support 1 3 1 Embedded components Component is the essential encapsulation of functionality For instance the TimerInt component encapsulates all processor resources that provide timing and hardware interrupts on the processor Name Details Component name TIL Periodic interrupt source FTM2free FTM2free Counter FTM2 FTM2 E Interrupt service event Interrupt ftm2fault_ovf Vftm2fault ovf Interrupt priority medium priority level 4 priority withir Interrupt period 500 0 ms 500 ms Component uses entire timer no Initialization Enabled in init code yes Events enabled in init yes Figure 1 2 Example of Timerlnt component Periodical Event Timer properties You will find many components that are called embedded components in the Processor Expert Components library window These components are designed to cover the most commonly required functionality used for the microcontroller applications such as from handling port bit operations external interrupts and timer modes up to serial asynchronous synchronous communications A D converter I2C and CAN By setting properties you can define the behavior of the component in runtime You can control properties in design time by using the Component Inspector Runtime control of the component function is done by the methods Events are interfacing hardware or software events in
235. ts Library view topic for details Initial values that will be set to the peripheral control registers can be viewed in the Peripheral Initialization window See Configuration Registers view topic for details 3 8 2 Peripheral driver implementation The rest of the peripheral driver can be implemented by the user using one of the following approaches Physical device drivers Peripheral base address Processor Expert system library Direct access to peripheral registers NOTE Incorrect use of PESL or change in registers of the peripheral which is controlled by any Component driver can cause the incorrect Component driver function 3 8 3 Physical device drivers NOTE PDD layer is available only for Kinetis and ColdFire family microcontrollers Physical Device Drivers PDD is a software layer that provides set of methods for accessing microcontroller peripheral configuration registers CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 165 Low level access to peripherals PDD methods abstract from What kind of registers are available How registers are organized How they are named PDD header files are located at CodeWarrior Processor Expert lib MCU pdd Each file contains a definitions of PDD methods for one microcontroller peripheral Basic PDD methods are implemented by macros and do not provide any additional functionality like register mas
236. tures of the specific peripheral Logical Device Drivers LDD components Refer to the Logical Device Drivers topic for details Operating systems Components related to Processor Expert interaction with operating system running on the target SW Components encapsulating a pure software algorithms or inheriting a hardware dependent components for accessing peripherals These components along with components created by the user can be found in a components library in the folder SW Specific functionality of the microcontroller may be supported as a version specific settings of the component For more information about this feature refer to the Version specific parts in the component documentation or Components Implementation details topic 3 2 1 7 1 Levels of abstraction Processor Expert provides components with several levels of abstraction and configuration comfort LDD components Logical Device Drivers The LDD components are efficient set of components that are ready to be used together with RTOS They provide a unified hardware access across microcontrollers allowing to develop simpler and more CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 67 Basic principles portable RTOS drivers or bare board application See Logical Device Drivers topic for details High level components Components that are the basic set of components designed carefu
237. tween common and project repository and allows user to update project static code source files from common repository Differences between project and common repository are checked during code generation and user is informed about them in the Track Changes dialog window In this window user can view list of all files from common repository that has been modified check changes in their code and choose whether the modification of project file should be accepted or not NOTE IO_Map and System sub folders are always checked for differences PDD and Peripherals sub folders are checked only if associated Peripheral Initialization component is in the project See Project static code directory structure for more information on static code sub folders Typically static code changes when processor component or compiler is switched It is also possible to force project and common repository synchronization explicitly using Synchronize Processor Expert Static Code command available in Project menu or Components View menu In this case all static repository files are showed in the Track Changes window with their status Repository synchronization can be used for example to update project after Processor Expert update or when project should use different Processor Expert version 3 10 11 Static code track changes Static Code Track Changes window shows any differences between files in the common and project repository Window contains four columns
238. ty of the event code Priority can also be changed in the user code You may use a processor component method to adjust the priority to a requested value CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 88 Freescale Semiconductor Inc eeu eae Chapter 3 Application design 3 3 1 5 1 Interrupt priority You may select interrupt priority in the component properties just below the interrupt vector name Processor Expert offers the following values which are supported for all microcontrollers minimum priority low priority medium priority high priority maximum priority The selected value is automatically mapped to the priority supported by the target microcontroller It is indicated in the third column of the Component Inspector view You may also select a target specific numeric value such as priority 255 if portability of the application to another architecture is not required Peripheral Initialization components on some platforms also allow to set the default value that means that you don t have any requirement so the priority value will be the default after reset value 3 3 1 5 2 Version specific information for HCSO08 derivatives with IPC Interrupt Priority Controller The HCS08 derivatives with IPC module offer an interrupt priority configuration There are four interrupt priority levels 0 to 3 available where 0 is the lowest priority and 3 is the highest one The platform
239. uld be generated by Processor Expert Component modules processor Module events c or created by the user and included in the project user module CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 24 Freescale Semiconductor Inc E SSS SSS Chapter 1 Introduction OOP Object oriented programming OOP was invented to solve certain problems of modularity and reusability that occur when traditional programming languages such as C are used to write applications PE Abbreviation of Processor Expert that is often used within this documentation PESL Processor Expert System Library PESL is dedicated to power programmers who are familiar with microcontroller architecture each bit and each register PESL provides the macros to access the peripherals directly so PESL should be used only in some special cases For details see Processor Expert System Library topic Peripheral Initialization component encapsulates the whole initialization of the appropriate peripheral Components that have the lowest levels of abstraction and usage comfort For details see Component Categories topic They usually do not support any methods or events except the initialization method The rest of the device driver code needs to be written by hand using either PESL or direct control of the peripheral registers For details see Low level Access to Peripherals topic Popup menu this menu is displayed when the right mouse
240. upt gt Sy ProcessorExpert pe Hard Fault CPU variant Project Headers Bus Fault HH P Project Settings a usage raut E HB amp Sources E test1 MK10DN32 INTERNAL f S Components Library 33 ekgo testi MK10DN32 INTERNAL F H Categories Alphabetical Assistant Processors Component Component Level CPU Internal Peripherals H E Peripheral Initialization amp Logical Device Drivers gt Communication Converter Ad abc LoD Logical Device Driver W DAC_LDD Logical Device Driver H E DMA gt Measurement Filter on for MK10DX128EXS test1 lt A Figure 1 1 CodeWarrior IDE with Processor Expert menu NOTE For more information about how to create a new project refer to the Processor Expert Tutorials chapter or Creating Application using Processor Expert chapter for step by step instructions on how to create a new Processor Expert project NOTE Processor Expert generates all drivers during the code generation process The generated files are automatically inserted into the active default target in the CodeWarrior project For more information on generated files refer to the Code Generation chapter 1 2 Features of Processor Expert Processor Expert has built in knowledge internal definitions about all microcontroller units and integrated peripherals The microcontroller units and peripherals are encapsulated into configurable components called em
241. ut of A D clock generator cannot be changed in runtime A conversion time in the Conversion time dialog is calculated for the worse case which is usually 17 cycles per conversion ExtInt If a pin other than IRQ IRQI is set in this component setting of the Pull resistor property affects only disable state of the device component If the device component is enabled the pull up resistor is always connected to the pin KBI CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 129 Implementation details e Limitation for HCOS8 Setting of the Pull resistor property affects only the disabled state of the device component If device component is enabled the pull up resistors are always connected to the used pins Only one KBI component can be used to handle one peripheral in PE project IntEEPROM A component expects that all security options of EEPROM are disabled If some security option is enabled methods performing write operation such as SetByte can return an error For details on sharing and usage of the high level timer components see HCS08 ColdFire V1 timers usage and sharing topic for details 3 4 6 1 HCS08 ColdFire V1 timers usage and sharing The HC S 08 and ColdFire V1 microcontrollers provide two main groups of timer devices 3 4 6 1 1 Single channel timer peripherals These devices are simple counters that do not contain multiple
242. utually dependent For example they share one common prescaler Processor Expert instantly checks components configuration and only valid combinations are allowed See Timing settings for details 3 4 6 1 3 Timing model restrictions for high level components TOD Interrupt each 1 4 second is not available CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 131 Implementation details TPM It is not possible to select interrupt after 1 tick of the counter because of hardware restrictions At least 2 ticks must be used MTIM1 as a shared prescaler On some derivatives MTIMI can be used as a clock source for other timers This feature allows you to select large range of timing even the timing model does not support all combinations of the MTIM1 prescaler and the modulo register 3 4 6 1 4 Using complex timers in high level components This topic explains the options of usage of the complex timers in the high level components allowing you to benefit from the advanced features of these components All peripherals from this group are also supported by the Peripheral Initialization Components for details see Component categories topic The following table shows a list of the timer components and PE devices that can be used in the components as rows The columns show the state of all devices defined for the timer for conditions determined by rows Table 3 2 Timer co
243. view You can filter pin names in the Component Inspector view It is now easy to select pin from the long drop down list You can type the text and filter list of available values Filtering is enabled only when more than 3 values are available in the list Properties Methods Events Name A D converter Shanng 4 Interrupt service event A D interrupt priority ADCO SEL2 TSID CH7 PTE2 DCO SCL UARTO RTS b ENETO 1588 TMRO FT ADCO SEL3 TSID CH amp PTB3 DCO SDA UARTO CTS b UARTO COL b ENETC Conversion time ADCO SEB ADCI SES TSID CHO PTBO LLWU P5 I2CO SCL FTMI CHO RMD Low power mode ADCO SES ADC SES TS CH6 PTBI I2CO SDA FTMI CHL RMID MDC M High speed conversion mode Warning The requested conversio Asynchro clock output Sample time Total conv time high 1 66 us 4 Initialization Enabled in init code Figure 2 11 Filtering pin names CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 41 Component Inspector view 2 4 1 Read only items Some items are read only so you can not change the content Such values are gray 2 4 2 View mode buttons They are placed at the top of the window Basic Advanced These buttons allow you to switch complexity of the view of the component s items See Items visibility topic for details 2 4 3 View menu This menu can be invoked by clicking on the down arrow icon The menu contains the following commands Basic Advanced
244. voked by the component to the user s code CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 21 INN Concepts You can enable or disable the appearance and availability of methods of the component in generated source code Disabling unused methods could make the generated code shorter For more details see General Optimizations topic Events if used can be raised by interrupt from the hardware resource such as timer SIO or by software reason such as overflow in application runtime You can enable or disable interrupts using component methods and define priority for event occurrence and for executing its Interrupt Service Routine ISR The hardware ISR provided by the component handles the reason for the interrupt If the interrupt vector is shared by two or more resources then this ISR provides the resource identification and you are notified by calling the user event handling code 1 3 2 Creating applications Creation of an application with Processor Expert on any microcontroller is fast To create an application first choose and set up a processor component add other components modify their properties define events and generate code Processor Expert generates all code well commented from components according to your settings For more details see Code generation topic This is only part of the application code that was created by the Processor Expert processor
245. y Low or Clock edge property rising edge and Shift clock idle polarity property High the SS pin of the slave SPI module must be set to logic 1 between bytes The falling edge of SS indicates the beginning of the transmission This causes the SPI to leave its idle state and begin driving the MISO pin with the MSB of its data Once the transmission begins no new data is allowed into the shift register from the data register Therefore the slave data register must be loaded with the desired transmit data before the falling edge of SS BitIO BitsIO ByteIO Byte2IO Byte3IO Byte4IO CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc y Chapter 3 Application design The cetva and cetpir methods are always implemented as macros Optimization for property BitIO BitsIO does not influence the generated code ADC Clock input of A D clock generator cannot be changed in runtime A conversion time in the Conversion time dialog is calculated for the worst case KBI Only one KBI component can be used to handle one peripheral in PE project e For details on sharing and usage of the high level timer components see RS08 timers usage and sharing topic for details 3 4 7 1 RS08 timers usage and sharing RS08 microcontrollers provide two main groups of timer devices 3 4 7 1 1 Simple timer peripherals These devices are simple counters that do not contain multiple indiv
246. y Embedded Component which would also initialize such registers If any component is found then it is checked that its settings doesn t produce initialization which would be in conflict with initialization required to route pin used by the consuming component If any conflict in initialization is detected user is informed by error showed for each property which affects the routing and user has to resolve them This is when Automatic property value can be used Properties which affects common hardware functionality allows setting Automatic value instead of using specific setting Automatic value signals that property doesn t require specific setting and leaves the control of hardware functionality to different property to specify it Therefore property set to Automatic is not causing any conflicts All properties that allow Automatic value have it as a default state after component is added to the project In example described above means that if consumer property defines required pin and at the same time properties involved in its routing have Automatic set then there are no conflicts or errors When Automatic is set in the property then currently used value is controlled by different property however the value is showed next to the automatically controlled property in the Details column in the Component Inspector View Also if the property controls registers which are initialized by the component s initialization method then the currently used value
247. y are allocated by special devices such as power signals external or data bus The special devices are indicated by a special blue icons The allocation of peripherals by special devices can be influenced by processor component settings In case of BGA package the pins that are used by some component are colored yellow Move the cursor on the pin to get detailed information 2 5 1 2 Hints Pin hint contains number of the pin on package both names default and user defined owner of the pin component that allocates it short pin description from processor database Component icon hint contains component name component type component description 2 5 1 3 Shared pins If a pin is shared by multiple components the line connecting the pin to the component has a red color See Pin sharing topic for details CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 57 Processor view 2 5 1 4 On chip peripherals The following information about each on chip peripheral is displayed on the processor package peripheral device name default or user defined icon of the component that uses allocates the peripheral device Peripheral device hint contains peripheral device name owner of the pin component that allocates it short peripheral device description Hint on icon contains component name component type component description
248. y default after the reset The values of the registers are displayed in the hexadecimal and binary form In case the value of the register or bit is not defined an interrogation mark is displayed instead of the value The Address column displays the address of registers NOTE For some registers the value read from the register after sometime can be different than the last written value For example some interrupt flags are cleared by writing 1 For details refer to the microcontroller manual on registers In case the peripheral is allocated by a component and the setting of the component is incorrect the initialization values are not displayed in the Configuration Registers view 2 8 lnitialization Sequence view It is possible to customize initialization sequence of components By default the sequence is not specified You can change the sequence using up down buttons To open this view click Window gt Show View gt Other and select Processor Expert gt Initialization Sequence SS Initialization Sequence 5 H Order Component Details Bem E Always First 1 Bit1 BitlO LDD 2 MM api ADC LDD Figure 2 20 Initialization Sequence view Third column displays any conflicts or component specific messages Initialization of processor component is always first Disabled components are also listed even if the code is not generated This allows to create configuration for the disabled component to re enable them Y
249. y for timer where the requirement can be specified both for counter and for compare capture overrun on this counter For example if Auto select timing option is selected for counter this timing is configured based on peripherals for compare capture overrun And if this option is selected for overrun it is configured based on requirement for counter configuration Currently it is supported only in timerunit_tpp component 2 4 7 1 3 Runtime setting configuration NOTE Runtime setting cannot be selected in the Basic view mode Runtime setting determines how the timing setting can be modified at runtime The following options available are fixed value Timing cannot be changed at runtime CodeWarrior Development Studio Processor Expert User Guide Rev 10 6 02 2014 Freescale Semiconductor Inc 49 Component Inspector view from a list of values Allows to change the timing by selecting one of predefined values from the list using component method SetX XXMode This method sets the value s corresponding to the selected timing into the appropriate prescaler and other peripheral register s The values modes in the list can be added removed by editing the timing values table from interval Allows to change a timing freely within a selected interval while all values of the interval are selected with specified precision Prescaler value is fixed in this mode timing is set only using compare reload registers value It mean
Download Pdf Manuals
Related Search
Related Contents
Pinnacle Version 4.0.20 Uncle Milton Moon In My Room XVS650AN(C) Supplementary Service Manual PMC66-SIO4BXR-SYNC - General Standards Corporation Honeywell UDA2182 User's Manual Tobacco Plus Expo 2014 - HUB Moen TS3516sp User's Manual Copyright © All rights reserved.
Failed to retrieve file