Home

Processor Expert - University of New Hampshire

image

Contents

1. BA Geval 1 Low speed mode This bean disabled This bean is dis a H Puval z Slow speed mode This bean disabled This bean is dis Api eraa e EA PutBit L E Ml SetBit E Stop in freeze mode no a A Cbi E MA Nesbit R A GetRawval ai m E Goian BASIC_ ADVANCED EXPERT lt Bn Bo a Eca General purpose paralel 4 7A lol Categories On Chip Prphris Alphabet Keywords View Help CPU y Registers EG User Modules 89 AsynchroSlave a B Interrupts Register Bit name Initialization value f Value after reset a Y testl c main 2 y Q Events c event 59 Ern oe EJ E gt Generated Modules 89 Intemuptvector Bean Modules Measurement Y EJ ASLe BS Memory Y El Bec SO InirLasH Peripheral Initialization Beans Sd ins FLASH Y E PE_Typesh Y ES PESLh Y E Vectors c ES Documentation 20 files Figure 1 1 CodeWarrior IDE with Processor Expert plug in active How to create a new project See the chapter 4 Processor Expert Tutorials or 3 1 Quick Start in Processor Expert for step by step instructions on how to start a new Processor Expert project Compiler and Linker settings To set the compiler and linker options select the command TargetName Settings in the Edit menu in the Code Warrior main menu You can find linker and compiler specific settings in the Target and Linker folders The command T
2. 24 Adding beans ____ 36 Adding CPU caia a teen 2 ee 90 Application design _ 85 Application options ___ ocio 19 Available beans 1 eee eee eee 37 36 Basic principles 86 Beans ite as ee oo NA 13 Bean Assistant 020 0 eee eee ee ee eee 39 Bean categories _ e 88 Bean Inspector occ o 45 40 Bean levels 025 wooo te Boe ek SO oe ee ee a 88 Bean optimizations oococccooooooo o 124 Bean related keywords ___ _ 36 Bean Selector Loco 36 Bean sharing 2 0 eee eee eee eee eee 105 Bean templates _ 101 Bean usage coccinea ere on ee tet a 119 Bean Wizard 22 2 2 223 ns risa Si ee Ste 141 Bean related keywords ____ _ 37 Beans folder pop up menu Lic 32 Benet arene eral id i tn 6 Building application Loco 85 Building blocks 2 e eee eee eee ee eee eee 86 Bus Clock oa aa a cum a a eya dl 13 AA ee ee lee oe ee 122 Changes in generated code _ 4 122 Changing target CPU ____ 90 Choosing a bean __ __ 36 37 Code generation _ 2 eee ee eee ee eee ee 111 111 Comparing generated code 33 Concepts muni at hh eaten weno ea ne Les 10 Configuration inspector naana aa eee ee eee eee eee 52 Configurations a a 22 2 cee eee ee eee 30 98 30 Configuring Beans _ _ 94 Control regi
3. Figure 2 44 Results of The CPU Query 2 12 List of Installed Beans with Additional Information Processor Expert View Installed Beans Overview This window contains information about installed beans in the current version of Processor Expert BEANS All installed beans including CPUs and user created beans are listed in the report Placing the mouse cursor on the bean s name will display the hint containing the detailed information about the latest bean version See menu View Bean Type for bean type selection Bean Info The amount of the information shown in this column can be controlled via View Bean info menu Note This information is also displayed as a hint on the bean Bean description File format and access encrypted full source compressed Author of the bean version List of revisions of the bean Each revision contains a version number date and author of the revision e Drivers Installed bean s drivers Driver Info The amount of the information shown in this column can be controlled via View Driver info menu 65 Processor Expert User s manual User Interface Placing the mouse cursor on the file name will display the detailed information about the latest bean driver version Status file format and access encrypted full source compressed Author of the bean s driver Current version of the bean s driver Init date date of creation Last modification date of l
4. 3 Figure 3 2 CPU Peripheral Names Editor 93 Processor Expert User s manual Application Design 3 3 Configuring Beans Configuring the beans in the project is one of the main activities in Processor Expert It influences the initialization run time behavior and range of functionality available to the user of the generated code For the description of the user interface of the beans settings please see the chapters 2 3 Project Panel and 2 5 3 Bean Inspector This following sub chapters describe hints and information that should allow the user to correctly and effectively configure the Embedded Beans used in the project e Interrupts and Events e Configurations e Design Time Checking Consequences and Benefits e Timing Settings e Creating User Bean Templates e Signal Names e Bean Inheritance and Bean Sharing e Pin Sharing 3 3 1 Interrupts and Events This chapter describes the details of interrupt and events processing in the code generated by Processor Expert An Interrupt is a signal that causes the CPU stop the execution of a code is suspended the state of the CPU core is saved on the stack and Interrupt service routine is executed instead After the execution is finished the suspended program continues on the place where it was interrupted the previous state of the CPU core is restored from the stack The signals causing interrupts can be a hardware events or software commands For more details please see an
5. Processor Expert User s manual Application Design Processor Expert produces these files The existence of the files can be conditional to project or Processor Expert environment settings and their usage by the beans Bean module This module with its header file is generated for every bean in the project with exception of some beans that generate only an initialization code or special source code modules Name of this file is the same as the name of the bean Header file h contains definitions of all public symbols which are implemented in the bean 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 This module could be modified manually under certain conditions but it is recommended for experienced users only See chapter 3 5 4 User Changes in Generated Code for details Processor Expert also allows to track and review changes in the generated modules See chapter 3 5 1 2 Tracking Changes in Generated Code for details e CPU module The CPU module is generated according to the currently active target CPU bean The CPU module contains additionally CPU initialization code interrupt processing e 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 cal
6. e General Optimizations e General Port I O Optimizations e Timer Beans Optimizations e Code Size Optimization of Communication Beans 3 6 1 General Optimizations This chapter contains general hints and instructions how to setup Processor Expert and beans to generate optimized code The following optimization regards only the High or Low level beans not the Peripheral Initialization beans Disabling unused methods Notice These optimization are not usable for the Peripheral Initialization Beans 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 its code still can 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 Disabling unused beans Disable unused and test purpose beans or remove them from the project Disabling of these beans is sufficient because the useless code is removed but the bean setting remains in the project If these beans are required for later testing then add a new configuration
7. e Verified reusable beans allowing inheritance e Verification of resource and timing contentions e CPU resource meter balancing e Concept of project panel with ability to switch port between CPU family derivatives e Code generation for components included in the project e Implementation of user written code e Interface with Freescale CodeWarrior PE based tool solution offers the following advantages to Freescale CPU customers e In all phases of development customers will experience substantial reductions in development cost development time e Additional benefits in product development process are Integrated development environment increases productivity Minimized time to learn Freescale CPU Processor Expert User s manual Introduction Rapid prototyping of entire applications Modular and reusable functions Easy to modify and port implementations Integrated development environment increases users productivity e This tool lets me produce system prototypes faster because the basic setup of the controller is easier This could mean that I will implement more of my ideas into a 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 thoroughly e Very good for CPUs with embe
8. 1 MC9S12DP256 CPU bean Freescale HCS12 processor family 2 BitlO General 1 bit input output bean outputs to LEDs The LEDs receive 1 bit data which specifies whether the light should switch on or off value 0 switch off value 1 switch on 3 ExtInterrupt External Interrupt bean interrupt from button Pressing the button calls an external interrupt which switches the state of the LEDs on off steps 130 Processor Expert User s manual Processor Expert Tutorials There are step by step instructions how to create this tutorial project This tutorial goes through the following steps Creating a new project Adding beans Generating Code Adding the On Event Code 2 9 ME Note This demo project does not care about non defined states on the output of the key during the process of key pressing This may result in the fact that state of two LEDs stays apparently unchanged 4 2 1 Tutorial for Freescale HCS12 Project 2 Step 1 Creating a New Project 1 Click on the command New in the menu File in the Code Warrior Main panel window in order to create a new project Metrowerks CodeWarrior File Edit view Search Project Debug Processor Expert W Ctrl Shifk N A A la Open Ctri O a Find and Open File Ctrl D Glose Gtr Save Gtrl s Save All Gt Shift S Save S Save 4 Copy sS Revert Open Workspace Glose Workspace Save Workspace 2 Select HC S 12 New Project wizard in the New di
9. 84 Processor Expert User s manual Application Design 3 Application Design This chapter should help users to design application using Processor Expert and Embedded Beans You will find here recommendations and solutions helping you to write and optimize a code effectively and properly If you are a beginner please see the section Quick start that shows how to generate the code of your first project The following subchapters explain e Quick Start in Processor Expert e Basic Principles e Configuring Beans e Implementation Details e Code Generation e Embedded Bean Optimizations e Low level Access to Peripherals 3 1 Quick Start in Processor Expert Step 1 Open an example You may start learning Processor Expert by opening one of the available examples All Processor Expert examples are accessible from the CodeWarrior To open an example select the command CodeWarrior main menu File Open and find the directory Code Warrior ProcessorExpert projects HCS12 Demo Tutorial where the CodeWarrior is the path where the CodeWarrior is installed into and select the file LED mcp Step 2 Code generation After opening an example you need invoke the code generation of the project to obtain all sources Select command CodeWarrior Main Menu Processor Expert Generate Code Project Name After the code generation the bean source modules will be inserted into the Generated Code folder in the CodeWarrior project windo
10. 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 s possible to set values from this interval only See chapter 2 5 3 1 Dialog Box for Timing Settings for details Speed Modes Processor Expert provides three speed modes that are generalization of all the possible CPU clock speed modes used for power saving that supported by most of the modern microcontrollers See chapter 3 2 2 2 Speed Modes Support for details 3 3 5 Creating User Bean Templates If you frequently use a bean with the same specific settings you may save the bean with its settings as a template This template is displayed in the Bean selector under given name behaves as a normal bean and could be added to any project The template has the same properties as the original bean The values of the properties are preset in the template and could be marked as read only In this section we will show how to create a bean template and save it How to Create and Save Templates Click the right mouse button on the selected bean icon on the Project panel in order to display the Bean pop up menu amp Documentatic y ee eG PESL ean Enable Code Generation gt Rename Bean view Source View Edit Events Code Restore Default Template Settings
11. Save Bean Settings as Template Disconnect Bean From CPU Remove Bean From Project Copy to Clipboard Help Figure 3 5 Bean Pop up Menu Select the Save bean settings as template item to open the Bean Template dialog window which allows to create and save the template 101 Processor Expert User s manual Application Design Bean Template xx Bean Template Name Icon Existing templates LEDT 56852EWM_Button_IRDA 56852EVM_Button_IRGB 56852EVM_LED_Green1 56852EVM_LED_Green2 56852EVM_LED_Red1 56852EVM_LED_Red2 56852EVM_LED_ Yellow1 56852EVM_LED_ Yellow2 56858EWM_Button_IROA 56858EVM_Button_IRGB 56858EWM_Codec 56858EWM_LED_Greenl 5685SEVM_LED_Green2 56858EVM_LED_Red1 56858EVM_LED_Red2 56858EVM_LED_ Yellow1 56858EVM_LED_ ellow2 56FS801EVM_Button_IRGA 56FS01EVM_LED_User 56FSO1EVM_Switch_RUNST 56F801EVM_Switch_SpeedD x Parr mo Template Author Customize Settings Short Template Description LED device support Warning Setting of the bean template is dependent on the target CPU 56F8346 Associated Peripheral Mode all posible Y OK X Cancel Figure 3 6 Bean Template Dialog Dialog window has the following parts Bean template name Name of the new template e Icon Icon representing the template Click the icon to select a different icon Template author Your name name of the firm etc e Customize settings Button invokes the Templat
12. an error message will be displayed Show output file opens the file defined as a tool output file in the editor Tools Setup Tool list PDF to Text Da a ll Tool setup Toolname SHELL y MA Visblein Tools menu Application PE Browse Working dir Y Browse App type windows 32 bits y Hot key None Parameters FO Input file s renee Output file DP O O Comment System command prompt JV Wait for application termination J Redirection of application output Exit code lt gt 0 Display error y Input file E E Browse Dutput file NA Browse Error output A A Browse Hint format FO Warning format FO O O Error format FO Fatal err format Y X Coros 7 Hob Figure 2 3 Tools Setup Dialog mis Processor Expert User s manual User Interface 2 1 2 1 Tools Setup Macros Global macros Global macros can be used in the following tools setup options Application Working directory Parameters Input file s Output file Input files for redirection Output file for redirection Error output file for redirection Format of all messages See chapter 2 1 2 Tools Setup for details PRJNAME current name of the project without extension DIRPRJ current directory of the project absolute path terminated with a backslash DIRDRV current destination directory of drivers absolute path terminated with a backslash DIRRELDRV current destination
13. e interrupts disabled all maskable interrupts are disabled The state of the register CCRH is not changed e 0 The same as interrupts disabled e 1 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 e same as interrupt default behavior of the architecture no interrupts can interrupt the event The same as Interrupts Disabled e Other values are mapped to the priorities 1 7 Version specific information for HCS12 derivatives Processor Expert offers the following event priority options 97 Processor Expert User s manual Application Design e interrupts disabled all maskable interrupts are disabled interrupts enabled all maskable interrupts are enabled Please 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 The same as Interrupts Disabled 3 3 2 Configurations The user 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 beans in the project it does NOT keep bean settings If you enable disable a bean in the project the bean state is updated in the currently selected configurat
14. Generated files will be added into the new target You can enter a name of the target Settings of this new target i e entry point libraries access paths target s file mappings etc has to be configured manually by the user to configure the target to be built properly Click on the OK button to confirm the selection The Targets can be set for the project files in the Code Warrior project window To set the Target options double click on the name of the Target listed in the window You can also change the setting using the command CurrentBuildTargetName Settings ALT F7 in the Edit menu in the CodeWarrior main panel The following picture shows the Targets TAB in the Code Warrior project window ln 0 ProcessorExpertT arget hv A gt Fies Link Order Targets Targets x MONOS 5260 RAM 4 0 MONO8 4Z60 FLASH amp WRKSPC 0 ProcessorE xpertT arget NKI 3 targets Figure 3 16 Targets List in the CodeWarrior 114 Processor Expert User s manual Application Design 3 5 1 2 Tracking Changes in Generated Code Processor Expert allows to compare generated modules with the previously generated ones after each code generation which may prevent from unwanted changes in the bean modules This function has to be enabled by the Project Options Track changes The Modified Files dialog appears after the successful code generation and shows the list of the files that have been modified by Processor Exp
15. Metacharacters predefined classes w an alphanumeric character including _ W a nonalphanumeric d a numeric character D a non numeric s any space same as t n r f S anon space You may use w d and s within custom character classes Examples foob dr matches strings like foob1r foob6r and so on but not foobar foobbr and so on foob w s r matches strings like foobar foob r foobbr and so on but not foob1r foob r and so on Metacharacters word boundaries b Match a word boundary YB Match a non word boundary User Interface A word boundary b is a spot between two characters that has a w on one side of it and a W on the other side of it in either order counting the imaginary characters off the beginning and end of the string as matching a W Metacharacters lterators Any item of a regular expression may be followed by another type of metacharacters iterators Using this metacharacters you can specify a number of occurrences of a previous character metacharacter or subexpression x zero or more similar to 0 one or more similar to 1 zero or one similar to 0 1 n exactly n times n at least n times n m at least n but not more than m times 82 Processor Expert User s manual User Interface So digits in curly brackets of the form n m specify the minimum number of times to match the item n and the maximum m The form
16. Reading this tutorial may be all you need to start using Processor Expert for your own application The following tutorials are available HCS12 Project 1 HCS12 Project 2 4 1 Tutorial Project 1 for Freescale HCS12 Microcontrollers This simple animated tutorial describes a periodically blinking LED project The LED is connected to the one pin of the CPU and it is controlled by a periodical timer interrupt Please follow the instructions and animations showing the actions Click here to start the tutorial 4 2 Tutorial Project 2 for Freescale HCS12 Microcontrollers This tutorial describes a demo project of a simple LED controller The LED controller has two color LEDs a red and a green one and one command button How it works The button sends commands external interrupts to CPU through one pin and the CPU switches the red and green LEDs lights on or off If you press the key you can see that lights of two LEDs have been changed One of them is switched off and the other one is switched on At the beginning the green LED is on and the red one is off Minimal required hardware design In the demo application the following components are used 1 CPU MC9S12DP256 Freescale processor HCS12 family 2 Red LED connected to CPU output pin PBO_ADDRO_DATAO 3 Green LED connected to CPU output pin PB1_ADDR1_DATAI 4 Button connected to CPU input pin PHO_KWHO_MISO1 Beans This simple demo project uses the following beans
17. See chapter 2 3 5 User and Generated Modules Pop up Menus for details e Documentations list of files attached into project as documentation with relative or absolute path No actions are made with these files Please refer to chapter 3 5 1 Code Generation for details on generated documentation files All Project Panel items are organized in folders in a tree You can expand and collapse a tree s branches by n clicking on the plus or minus on signs respectively You can create your own folders in the Beans folder and move beans between them using mouse drag and drop function The following icons indicate the status of each project panel item Y Beans Processor Expert didn t found any problems in the bean s settings Configurations configuration is selected as active CPUs CPU is currently selected as a target CPU User Module Generated Module The module is all right and included in the project Beans Gray cross means that bean is disabled and code won t be generated for it Configurations Configuration is not active Double click the icon to select it as active configuration CPUs CPU is not selected as target CPU Double click the icon to select it as the Target CPU Beans CPUs beans CPU bean s settings are wrong or conflict with another bean See chapter 3 3 3 Design Time Checking Consequences and Benefits for details window including simple description Possibly incorrect
18. e The user can create his her own beans using the Bean Wizard external tool See chapter 5 Bean Wizard Description for details 1 1 Processor Expert Plug in Overview The Processor Expert was originally developed as a stand alone product Now to provide a more efficient and comfortable development environment we integrated it as a plug in to the CodeWarrior The CodeWarrior IDE menu contains a new menu item named Processor Expert The Processor Expert plug in generates code from the Embedded Beans and CodeWarrior manages the project files and the compilation and debugging processes Processor Expert User s manual Introduction lola File Edit View Search Project Debug Processor Expert Window Help PSS EoeKRBAARe SEER de o x bean inspector FCGLFreCcOra lol x Bean Items Visibility gt Peripheral Initialization gt testi mcp PSE ICD Jay g o 7 a a Properties Methods Events Comment Files Link Order Targets Processor Expert Bean name Timer Counter Interrupt service event v Inte gt Operating System aaa priority 26 CPUs Prescaler CpuMC9512DP256BCPV r SONO Y CpuMC9512UF32_64 i 2 Same resolution in modes B Beans w Bean uses entire timer YD AS1 AsynchoSerial 2 initialization E Y O Bt21 Byte210 0 Enabled in init code EN Configurations Y amp 112pin al UB GelDir 3 CPU clock speed selec uE SetDir High speed made This bean enabled ae
19. n is equivalent to n n and matches exactly n times The form n matches n or more times There is no limit to the size of n or m but large numbers will chew up more memory and slow down regular expressions execution If a curly bracket occurs in any other context it is treated as a regular character Examples foob r matches strings like foobar foobalkjdf1kj9r and foobr foob r matches strings like foobar foobalk3jdf1k39r but not foobr foob r matches strings like foobar foobbr and foobr but not foobalkj9r fooba 2 r matches the string foobaar fooba 2 r matches strings like foobaar foobaaar foobaaaar etc fooba 2 3 r matches strings like foobaar or foobaaar but not foobaaaar Metacharacters Alternatives uy You can specify a series of alternatives for a pattern using to separate them so that feelfielfoe will match any of fee fie or foe in the target string as would f elilo e The first alternative includes everything from the on last pattern delimiter or the beginning of the pattern up to the first nytt and the last alternative contains ji everything from the last to the next pattern delimiter For this reason it s a common practice to include alternatives in parentheses to minimize confusion about where they start and end Alternatives are tried from left to right so the first alternative found for which the entire e
20. requested value Interrupt Priority The user may select interrupt priority in the bean properties just below the interrupt vector name Processor Expert offers the following values which are supported for all microcontrollers e minimum priority e low priority e medium priority e 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 Bean Inspector The user may select a target specific value such as priority 255 if portability of the application to another architecture is not required 96 Processor Expert User s manual Application Design Priority of Event Code The user can also select a priority for the processing of his her 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 the same the event may be interrupted only by the interrupts with the higher priority Processor Expert offers the following architecture independent values e same as interrupt default value which means that Processor Expert doesn t generate any code influencing the priority of the event the priority is in the state determined by the default hardware behavior e minimum priority e low priority e medium priority high priority e maximum priority e interrupts dis
21. 3 2 2 3 Changing Names of Peripheral Devices for details This way the same peripheral could be used on different CPU derivatives even if the original name is different e Specific application options for single targets are set in Project Options Note CPU peripherals names and Application Options are in the same popup menu as CPU inspector See the last part of this page to learn how to open it How to Add a CPU to the Project e Inthe Bean Selector window select the CPU category and find the desired CPU bean e Double click the desired CPU icon to add it into the project When the CPU bean is added it appears in the upper part of the Project panel If selected as the target CPU the processor will be displayed in the Target CPU window How to Select a CPU as the Target CPU The first CPU added to the project is automatically selected as the target CPU It means that code will be generated for this CPU When there is more than one CPU in the project the target CPU can be changed this way e Move the mouse pointer to the CPU icon on the Project panel e Click with the right mouse button a popup menu will appear e Click Select CPU as target the CPU is selected as target This setting doesn t affect the setting of the target in the Targets tab in CodeWarrior s project panel When the user changes the target CPU in Processor Expert project panel and the CPU doesn t match with the current CodeWarrior target settings the lin
22. A D channels and 1 A D converter e serial number of asynchro synchro serial channels e CAN on chip CAN channels e Watchdog on chip watchdog e Special Special features and devices e RAM on chip RAM size e ROM on chip ROM size e EPROM on chip EPROM size e FLASH on chip FLASH size e OTP on chip OTP size e Power supply power supply voltage 64 Processor Expert User s manual User Interface e Storage CPU storage temperature Note Memory sizes are in minimal addressable units bytes words If you right click on the window a menu appears allowing you to add the selected CPU to the current project or to refine your previous query CPU Parameters Overview CPUs 615 of 616 CPU type dual clock AT9OLS8535 8Pl Dto8MHz no 40 to AT9OLS8535 8PC AVR Dto8MHz no Oto 70 MBSOF549 MB90545 3tol6MHz 32 768 kHz 40 to MB90497G_M03 MB90495 3to16MHz 32 768 kHz 40 to MCBSHCSO8BY4CSD Motorola HCO8 Oto32MHz 9 6to16 M 40to MC9S12DJ128BVFU Motorola HCS12 Oto 25MHz no 40 to 1 DSP56F807 Motorola DSP56800 Oto8MHz no 40 to 1 10 x PICI6C710 PICI6C 1 0 1 to 20 MHz no 55 to 1 PICTBFS44 PICI6F amp X Oto 20MHz no 40 to pcies iici TIA TT COPSANE9EMw8 National Semiconductor COP84ME 0 1 to 10 MHz 32 768 kHz 40 to COP84NESENA National Semiconductor COP84ME 0 1 to 10 MHz 32 768 kHz 40 to 1 COPS4NESEMW National Semiconductor COP84ME 0 1 to 10 MHz 32 768 kHz 40 to
23. If the interrupt service isdisabled and a mode fault occurs the bean will be disabled at the beginning of RecvChar method IntFlash 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 5 Code Generation This chapter informs the user about principles and results of the Processor Expert code generation process and the correct ways and possibilities of using this code in the user application Please follow to the subchapters for more information Code Generation Predefined Types Macros and Constants Typical Usage of the Bean in the User Code User Changes in Generated Code 3 5 1 Code Generation Processor Expert Generate Code ProjectName mcp Generate Code command initiates the code generation process During this process source code modules containing functionality of the beans 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 111
24. Interrupt initialization 2 22 eee 122 Interrupt vector __ 96 Interrupt vector table LL 96 InterrUpts io at a 94 Items visibility ccoo 44 Levels of abstraction 00 02 eee ee ee ee eee 88 List of installed beans ooo a 65 Low level beans _ occ 88 Low speed mode 2 coc 91 Low level access _ 127 Macros tana crias ee eed E ANET 22 Manifest constants 22 e eee eee ooooooo 122 ManUal ser ta o EE a 24 Memory map ____ 61 Methods te isso ete wis epee ie Bei dace ee Sie woe soe 14 Methods and events coco 86 Methods and events usage ___ _ 119 Module sence pte ar LC ea oe Li id O O RS At it 14 Optimizing communication beans _ 126 Optimizing port I O aaa coco 125 Optimizing timers 0000000 ee ee eens 125 PDF Search oscar ce ee ee 78 Peripheral direct control _ 128 Peripheral initialization 22 ee eee 67 Peripheral initialization beans _ 88 Peripherals usage _ _ 70 PESE oes cee ec ee oe a ohh Us 127 Pin Sharing crs eck Aces ets ots Sek eee ee 107 PEA 2b ts eked O ees BES 14 A AA A ee eed E 4 Porperty types ici jocs Mes Soci 42 Predefined symbols __ 117 PROSCANC ai Se eo eee 14 Priorities oi ti diosa 96 Processor Expert tab ___ _ 25 Projectioptions 028 0 a 19 Project panel 24 2 2 tas Ss Sees axed 25 Properties so ct a e
25. On HCS12 derivatives The placement of the IVT can be configured in the Build Options tab of the CPU Bean Inspector by changing the address of the memory area with the name INT_VECTORS Please notice that if the IVT placement is changed the user has to provide a full IVT on the the address defined by the CPU 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 CPU 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 notice that the redirection is available only for interrupt vectors not used by Embedded Beans 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 Please see the content of the property group Interrupt Reset vector table in the group Interrupt resource mapping and its documentation e PPG HW doesn t support an interrupt Aligned Center Mode Counter counts from 0 up to the value period register and then back down
26. Replace with new texi y Dption Scop IV Case sensitive Entire text TF Whole words only gt From cursor Backward I Prompt on replace Selected text x Find All Files Replace Replace All ME Figure 2 53 Search And Replace Dialog Input Fields Find what searched text e Replace with a new text that will replace the searched text in replace function Options e Case sensitive When checked the case of letter of the searched text has to match e Whole words only The searched text is found only as a whole word Backward direction of the search 76 Processor Expert User s manual User Interface e Prompt on replace specifies if the user will be asked about each item replacement during the replace process This option is available only if any replacement text is entered Scope Entire text Entire text will be scanned From cursor Text from cursor to the end of file will be scanned only e Selected text The current selection will be scanned only Buttons e Find Next Invokes the search process The cursor will be placed on the next occurrence of the searched text If the find replace operations have not been done yet the first occurrence of the text is found e Find All Files Invokes the search process within all opened files Places cursor in each file on the last occurrence of the searched text within the file e Replace A next
27. a method or event icon in the Project Panel It proposes a set of commands concerning the selected method event Enable Disable enables disables the selected method event in current project e View source method only shows generated method source Available only after successful code design e Edit code event only opens a selected event in editor Available only after successful code generation e Help displays documentation Init Code This menu is opened by right clicking on init code item on its icon in the Project Panel It proposes a set of commands concerning the selected initialization code item Enable Disable enables disables the selected item in current project e View source shows generated source of the initialization Available only after successful code generation Please see the code and comment describing what should be provided in user s code e Help displays documentation ISRs This menu is opened by righ clicking on ISR item in the Project Panel e Rename ISR opens the Bean Inspector and selects the property that specifies the name of the interrupt routine e Edit Code opens the source code editor at the interrupt routine if its name has been specified within the bean properties e Help Shows the related help for the bean 2 3 5 User and Generated Modules Pop up Menus User Modules Folder Pop up Menu e Add User Module This menu allows to add a user source code module of the sp
28. add it to the project Modes The Bean Selector contains the following four tabs allowing the user to select beans in the following modes e Bean Categories contains all available beans The beans are sorted in a tree based on the categories defined in the beans See chapter 3 2 1 1 Bean Categories for details Please see below for menu and control details On Chip Peripherals shows all beans available for the specific peripherals All chip peripherals sorted by name are listed in the appropriate CPU folder depending on which peripheral can be used Current target CPU bean is displayed at the top only if a target CPU bean is selected 36 Processor Expert User s manual User Interface There are three different icons of peripheral folders which depends on the usage of the peripheral If the peripheral is fully available the folder is displayed by yellow amp icon If the peripheral is partially used the folder is displayed by light blue amp icon The fully used peripheral is displayed by blue icon the Bean Selector provides the On Chip Peripherals view for the users that are not familiar with the beans functionality yet but they know the chip peripherals This page contains all on chip peripherals of the selected CPU and for each peripheral list of supported beans So it s very easy to find bean that supports functionality of the selected peripheral Please see below for menu and control details e Alphab
29. and parameter s description and syntax e Placing the mouse over any bean icon name displays the bean description 28 Processor Expert User s manual User Interface aS Configurations Y 2 sdm external memory 2 Idm external memory 2 sdm pROM xRAM x 2 Idm pROM xRAM x 2 sdm xROM xRAM x 2 Idm xROM xRAM Operating System aS CPUs Y SEE x Cpu 56ra346 x Cpu 56F8346 EE Beans Y 2 SM1 SPiMaster SynchroM aster a v Bit Bitlo E GetDir E M SetDir Y M Getal Y M Putval E MB Cival E AM Setval E A NeoYal E M ConnectPin E A GetRawal E User Modules Y E testSYNMASTER c main E Generated Modules E Bean Modules Cpu c SM1 c lt E l0_Map h Y E PE_Const h Y E PE_Error h Y E PE_Types h PESL h Y E Vectors c E Documentation Y E PESL Figure 2 5 The content of the Project Panel 29 Processor Expert User s manual User Interface 2 3 1 Configurations Pop up Menus Configurations folder pop up menu This menu is opened by right clicking on the Configurations folder icon in the Project panel Following commands are available e Add new configuration add a new configuration into the project All configuration settings i e target CPU selection and state of all beans are copied from the currently active configuration to the new one e Configurations Editor opens the Configuration Editor e Expand Collapse expands collapses one level of the folder s tree e Expand all completely
30. be disabled if it is not also shared e Communication beans like serial or CAN communication peripheral is disabled e Conversion beans A D D A converter is disabled The conversion is restarted by Enable If the bean is disabled some methods may not be used Please refer to beans documentation for details MAIN C void main void Bl_Enable enable the bean functionality handle the bean data or settings Bl_Disable disable the bean functionality 119 Processor Expert User s manual Application Design Methods EnableEvent DisableEvent These methods enable or disable invocation of all bean events These methods are usually supported only if the bean services any interrupt vector The method DisableEvent may cause disabling of the interrupt if it is not required by the bean functionality or shared with another bean The method usually does not disable either peripheral or the bean functionality MAIN C void main void Bl_EnableEvent enable the bean events bean events may be invoked B1_DisableEvent disable the bean events bean events are disabled Events BeforeNewSpeed AfterNewSpeed Timed beans which depends on the CPU clock such as timer communication and conversion beans may support speed modes defined in the CPU bean in EXPERT view level The event BeforeNewSpeed is invoked before the speed mode change and Af
31. bottom bar of the bean selector window works in this mode too The questions and answers are filtered so the beans that do not suit to the enabled filter s are not visible Notice that enabling of the filtering might remove some beans from the list If the All questions filter button is not pressed and there is only one answer available the question is automatically skipped like the user would select an answer For details please see the Bean selector help page This mode of Bean Selector doesn t offer addition of CPU beans If you would like to add another CPU bean please switch to another Bean Selector tab 39 Processor Expert User s manual User Interface Bean Selector Al ES Categories On Chip Prph Alphabet Assistant Quick help gt START Timing Q What kind of timing task do you need S Periodical interrupt bean Timerlnt 23 Measurement 7 beans 23 Generate signal to pin s 4 beans Create a virtual timer interrupt based timing source that can be shared by multiple beans bean ATIshared ER zl Filter for MC9S0SGBE0CFU only Licensed All questions YA Figure 2 8 Bean Selector in Assistant Mode 2 5 Inspector Processor Expert View Inspector Inspector is universal window which allows to view and edit attributes of the object selected in the Project Panel It could be a Bean Configuration User module or Peripheral Initialization bean Inspector can work in these m
32. can be displayed on the CPU package but they are also represented as a single block in the MCU block diagram Mouse Operations For Individual Items e Single click on a bean icon selects the bean in the Project panel e Double click on a bean icon opens its Bean Inspector and selects the property specifying the peripheral used by the bean e Double click on a peripheral opens the simple item structure view e Double click on an bs icon opens a selection menu with all the beans that use single parts of the peripheral Selecting one bean opens it in the Bean Inspector e Right button click on a bean icon opens the Bean pop up menu If the Bean Inspector is invoked from this pop up menu an appropriate property allocating the used peripheral is selected e Right button click on an bs icon opens selection menu with all the beans that use single parts of the peripheral Selecting one bean opens the Bean pop up menu e Right click on the peripheral opens the Peripheral Pop up menu see below Peripheral Pin Pop up Menu The following commands are available in the pop up menu e Show Peripheral Initialization shows initialization values of all control status and data registers This option is supported for all devices displayed on a CPU package See chapter 2 13 Peripheral Initialization for details e Show Peripheral Structure opens the peripheral s structure view it is supported for I O ports timer s counters serial ports T
33. directory of drivers relative or absolute path from Project Options setting terminated with a backslash S DIRRELEVENT EVENTTODRV DIREVENT current destination directory of main and event modules absolute path terminated with a backslash DIRRELEVENT current destination directory of main and event modules relative or absolute path from Project Options setting DIRBIN current destination directory of binary files maker linker and object absolute path terminated with a backslash DIRRELBIN current destination directory of binary files absolute or relative path starting from Project Options setting terminated with a backslash SDIRRELEVENT EVENTTOBIN DRVTOEVENT relative path from drivers directory to main and event modules directory drivers Driver subdir event Main and event dir from Project Options EVENTTODRYV relative path from main and event modules directory to drivers directory EVENTTOBIN relative path from main and event modules directory to binary files directory DIR_PE system directory of Processor Expert absolute path terminated with a backslash FILEDIR directory of the file that is currently edited or directory of the file that will be opened in External Text Editor terminated with a backslash FILENAME name of the file that is currently edited or name of the file that will be opened in External Text Editor including extension FILENAM name of the file
34. file content in specific colors with respect to file extension and compiler No horizontal scroll bar Disables horizontal scroll bar when line is not longer than window e Outline current line Editor shows a frame around the current line e Tab size number of spaces for tabulator Number of backup copies how many backup copies will be maintained for each saved document The backup files are created within the same directory as the saved file The name of file is the same but there is character added before the extension and a number of the backup copy is added at the end The latest backup file has the number 0 The bigger the number is the older is the backup e Hint delay how long will an editor hint stay on the screen 75 Processor Expert User s manual User Interface Editor Options ES Edit Operations A Preserve cursor position during paste Use tab character Editor Options gt J Show modules in separate tabs J Show line numbers IV Syntax highlighting Y No horizontal scroll bar 7 Outline current line Tab size e Number of backup copies o Hint delay 200 ms r DEUCE CPP e ee eee eee Figure 2 52 Editor Options Search And Replace Dialog This dialog window is invoked by the pop up menu commands Search Find and Search Replace It allows to specify the subject of search or replace and mode of operation SearchReplaceDialog Find what text y
35. in modes yes gt E E Bean uses entire timer no Type ADVANCED BASIC ADVANCED EXPERT Click icons on the toolbar to SAVE the bean te h Figure 3 7 Template Editor Window Finally click the Y icon on the bean inspector s toolbar to accept the changes To discard the changes and return without changing a template settings close the window or click the x icon 103 Processor Expert User s manual Application Design 3 3 6 Signal Names The main purpose of signals is to allow the user to name the pins used by beans with names corresponding to his application Assigning Signals to Pins A signal name can be assigned to an allocated pin in the Bean Properties available in ADVANCED view mode by specifying the signal name into the appropriate property e g Pin_signal Signal name is an identifier that must start with a letter and only letters numbers or underscore characters are allowed in the rest For the beans that allocate a whole port e g ByteIO there are two options e Assign a same signal name extended with bit number suffix to all pins of port by writing the name into the Port signal property Processor Expert automatically assigns this name 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 Even
36. 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 bean implementation See chapter 3 7 Low level Access to Peripherals for details 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 PE_Types h The declaration of the registers which could be read written by the macros is present in the file IO_Map h Whole Register Access Macros e getReg w RegName Reads the register content e setReg w RegName RegValue Sets the register content Register Part Access Macros e testReg w Bits RegName GetMask Tests the masked bits for non zero value e clrReg w Bits RegName ClrMask Sets a specified bits to 0 e setReg w Bits RegName SetMask Sets a specified bits to 1 e invertReg w Bits RegName InvMask Inverts a specified bits e clrSetReg w Bits RegName ClrMask SetMask Clears bits specified by ClrMask and sets bits specified by SetMask Access To Named Bits e testReg w Bit RegName BitName Tests whether the bit is set e setReg w Bit RegName BitName Sets the bit to 1 e clrReg w Bit RegName BitName Sets the bit t
37. matches any character not in the list Examples foob aeiou r finds strings foobar foober etc but not foobbr foobcr etc foob aeiou r find strings foobbr foobcr etc but not foobar foober etc Within a list the character is used to specify a range so that a z represents all characters between a and z inclusive n If you want itself to be a member of a class put it at the start or end of the list or escape it with a backslash If you want you may place it at the start of list or escape it with a backslash Examples az matches a z and az matches a z and a z matches a z and a z matches all twenty six small characters from a to z n x0D matches any of 10 11 12 13 d t matches any digit or t a matches any char from a Metacharacters Metacharacters are special characters which are the essence of Regular Expressions There are different types of metacharacters as described below Metacharacters line separators start of line end of line any character in line Examples foobar matches string foobar only if it s at the beginning of the line foobar matches string foobar only if it s at the end of the line 81 Processor Expert User s manual foobar matches string foobar only if it s the only string in the line foob r matches strings like foobar foobbr foob1r and so on
38. methods Don t be concerned about the complexity of this process simply choose from the Processor Expert Tools menu the Beans Wizard tool which makes all the arrangements for you You only need to enter the code of methods and events save new bean and install it on the Beans Palette or share it with others For additional information about Processor Expert and beans libraries please go to online help or the www processorexpert com website Processor Expert has built in knowledge internal definitions of the entire CPU with all of its units and integrated peripherals The CPU units and peripherals are encapsulated into configurable components called Embedded Beans and the configuration is fast and easy using a graphical Bean Inspector Processor Expert User s manual Introduction Peripheral Initialization Beans a subset of Embedded Beans allows the user to setup initialization of the particular on chip device to any possible mode of operation The user can easily view all initialization values of the CPU produced by Processor Expert with highlighted differences between the last and current properties settings Processor Experts performs a design time checking of the settings of all beans and reports errors and warnings noticing user about wrong property values or collisions in the settings with other beans in the project Processor Expert contains many useful tools for exploring a structure of the target CPU showing the details about the al
39. of rows depends on the selected type of runtime setting e For the option fixed value there is only one row Init Value containing the fixed initialization value e For the option from a list of values there is one row for each of the possible timing modes Please see the section There is possible to enter 16 possible values modes The empty fields are ignored The user can drag and drop rows within the table to change their order Runtime setting configuration within this chapter for more information e For the option from interval the table has three rows that contain the Initial value low limit and high limit of the interval Please see the section Runtime setting configuration within this chapter for details on this type of runtime setting There are two editable columns e Value Fill in a requested time value without units The drop down arrow button allows to display a list of neighboring values and the user can select one of them There is also possible to set the value by double clicking on a value from the possible settings table see below e Units units for the value When the Recalculate on unit change check box below the table is checked the value in the previous column is automatically re calculated to be the same in the newly selected units Timing precision configuration It is possible to specify desired precision of the timer settings by using one of the following settings which one 1s used depends on th
40. of the CH file is derived from the CPU bean name CPUbean CH To generate CH file it is necessary to set the following option Project Options Generate manifest constants CH file is generated also while smart generation of bean modules code see paragraph 3 for details CH file is always overwritten during the code generation 2 Mode of code generation for bean modules It s possible to select mode of the code generation for each bean the following options can be found in the bean s pop up menu in the project panel Code Generation 4 Always Write Generated Bean Modules default generated bean modules are always written to disk and any existing previous module is overwritten vF Preserve User Changed in Generated Bean Modules smart detection of user changes Notice Smart user changes preservation is not available in this version Don t Write Generated Bean Modules the code from bean is not generated Any initialization code of the bean which resides in the CPU bean interrupt vector table and shared modules are updated The mode of code generation is indicated as a bean s status in the project panel This mode influences only the generation of bean modules bean c bean h 3 Mode of code generation for non bean modules Processor Expert also allows to enable disable generation of the modules that not related to a specific bean or that are common for several beans This option can be configured in the pop up menu
41. of the File Editor The toolbar is visible as a part of the window or as a single panel Clicking on the toolbar corner it is possible to place the toolbar to other side of the window or to any other place on the screen as a floating panel e Help opens documentation 74 Processor Expert User s manual User Interface Editor D PE Config PE PrjTempl DOC testgen2 CODE Bitsit 10 x 2 Bits1 C Cpu C testgen2 C P Dre include Bitsi h Tide I man Include shared modules which are used for who include PE Types h include PE Error h include PE Const h include IO Map h include Cpu h p it gt a 76 20 Saved Syntax highlighting Figure 2 5 File Editor File Editor Options e Preserve cursor position during paste keeps the current position of the cursor during a paste operation e Use tab character The editor will write tabulator character after TAB key is pressed and these characters will not be replaced by spaces Show modules in separate tabs Displays tabs for each opened module extension When this option is not checked it is possible to switch between module extensions by clicking the right mouse button on the tab of the file and choosing the appropriate extension or by clicking on the Switch between module extensions button in the toolbar menu Show line numbers Displays line numbers in the editor window e Syntax highlighting Displays
42. peripheral abstraction An application built from these beans can be easily ported to another microcontroller supported by the Processor Expert e Low Level Beans The beans that are dependent on the peripheral structure to allow the user to benefit from a non standard features of a peripheral e Peripheral Initialization Beans These beans are on the lowest level of abstraction An interface of such beans is based on the set of peripheral control registers These beans cover all features of the peripherals and were designed for initialization of these peripherals contain only one method Init and no events Please see chapter 3 2 1 1 Bean Categories for more information For more details on bean inspector items please see also the following sub chapters e Dialog Box for Timing Settings e Syntax for the Timing Setup in the Bean Inspector e Defaut Values for Properties e Version Specific Items 2 5 3 1 Dialog Box for Timing Settings The Timing dialog box provides a user friendly interface for the settings of bean timing features When clicking on the E button of a timing item in the Bean Inspector the timing dialog box is displayed Before you start to edit bean timing you should set e Target CPU in the Project Panel e Used peripherals in the bean s properties Supported speed modes in the bean s properties The settings are instantly validated according to the Processor Expert timing model for details on the timing settings
43. peripheral using a Bean Selector under a Peripherals tab See chapter 2 4 Bean Selector for details The initial values which will be set to the peripheral control registers could be viewed by the Peripheral Initialization window See chapter 2 13 Peripheral Initialization for details Peripheral Driver Implementation The rest of the peripheral driver can be implemented by the user using one of the following approaches e Processor Expert System Library PESL e Direct control of the CPU registers Warning Incorrect change in registers of the peripheral which is controlled by any Bean driver can cause the incorrect Bean driver function 3 7 1 Processor Expert System Library Notice PESL is not available in this version PESL Processor Expert System Library is dedicated to power programmers who are familiar with CPU 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 Beans which are functionality oriented While Embedded Beans provide very high level of project portability by stable API and inheritance feature across different CPU DSP PPC architectures PESL is more architecture dependent 127 Processor Expert User s manual Application Design 3 7 2 Direct Access to Peripheral Registers The direct control of the Peripheral s registers
44. principles please see the chapter 3 3 4 Timing Settings 46 Processor Expert User s manual Timing Dialog Controls Timing Resolution xi Prescalers Req value High speed mode Low speed mode Slow speed mode Adjusted values Prescaler Auto select Auto select Auto select Runtime setting type fired value y Possible settings Clock path Value type Value Unit From Till Step Init value 8000 ms 5d 16 384ms 0 250ps 16 384ms 32 768ms O 500ps 32 768ms 65 535ms Ips 65 536ms 131 070ms 2us 131 072ms 262 140ms 4us 262 144ms 524 280ms Bus 524 288ms 1048 560ms 16us 1048 576ms 2097 120ms 32us User Interface TF Recalculate value on unit change Error allowed Unit jo x Adjusted value of the initialization value 0 00153 disabled disabled Timing settings failed in high speed mode it is impossible to set the following items initialization value Y nea q uo Figure 2 28 Timing Settings Dialog Prescalers table Note This table is visible only in Advanced or Expert view mode and if it is possible to select a prescaler for the selected peripheral 2 5 2 Items Visibility This table occupies the topmost part of the window It shows a clock source and prescaler s values related to the currently edited timing value see the section Timing values table for details A presence and number of rows in the table are optional and depend on the hardware structure and a typ
45. that is currently edited or name of the file that will be opened in External Text Editor without extension GOTOLINE can be used only with the External Text Editor It is replaced by the line number FILE Question name of the file set manually Question is displayed to the title of window PARAM Question Default parameters set manually Question is displayed to the title of window Default is a default value COMSPEC setting of the COMSPEC variable in the Windows environment MAKEFILE name of the currently used makefile for the current project 22 Processor Expert User s manual User Interface Global macros after code generation The following macros are supported only after successful code generation Can be used in the same items as the Global Macros GENDIRPRJ directory of the project during last successful code generation absolute path terminated with a backslash GENDIRDRV destination directory of drivers during last successful code generation absolute path terminated with a backslash GENDIRRELDRV same as GENDIRDRV during last successful code generation only relative path SGENDIRRELEVENT GENEVENTTODRV GENDIREVENT destination directory of main and event modules during last successful code generation absolute path terminated with a backslash GENDIRRELEVENT same as DIRRELEVENT during last successful code generation GENDIRBIN destination directory of binary fil
46. the Bean Wizard Options e Environment Options Project Options Application Options opens an appropriate page within the Processor Expert Options dialog window that allows to customize all settings related to the environment and project See chapter 2 1 1 Processor Expert Options for details e Tools Setup allows external tools to be included in the Processor Expert s plug in environment The tools may then be accessed via the Tools menu The setting changes will take effect after the restart of the Code Warrior application See chapter 2 1 2 Tools Setup for details e Save desktop saves the desktop settings windows position to the DSK file The desktop file can also be saved automatically if the option Environment Options Autosave desktop is enabled in Environment Options Update e Update Processor Expert from Package this command allows the user to update or add new beans from compressed packages PEupd that can be downloaded from the Processor Expert web site It is possible to select more beans in the selected directory using a multi select function To add more beans select the requested bean using the mouse and holding down the CTRL or Shift key The information on the package content is shown when the package is selected within an opening dialog window e Check Processor Expert Web for updates check for updates on the Processor Expert web site If there is any news for your version Processor Expert offers yo
47. the beans including CPU beans in the project panel are organized in a tree You may expand and collapse them by clicking on the plus or minus sign Bean s events and methods are present as a subnodes of the bean node Note By double clicking on any event method icon you change its enable disable state you can do it also in the bean inspector You need to invoke code generation again to generate code according to the new settings 2 Click the sign to expand the Button bean and display its events and methods 139 Processor Expert User s manual Processor Expert Tutorials Files Link Order Targets Processor Expert ES Configurations Y amp 112pin E CPUs Y CpuMC9512DP25EBCPY Beans Y RedLED BitlO Y 8 GreenLED Bit1O BE Y 9 Button Extlnt El Onlnterrupt E M Enable S M Disable Y M Getal E A SetEdge amp Documentation x E PESL 3 Double click the OnInterrupt event from the Button bean to open and find out the position of this event in code See the picture below E ee HE HH HH He HH HH ca cas AS Event Button _OnInterrupt 1 From bean Button ExtInt Description This event is called when the ac occurs Parameters None Returns Nothing void Button_OnInterrupt void place your Button interrupt procedure 4 Enter the following lines to the body of the Button_OnInterrupt function RedLED_NegVal GreenLED_NegVal The first line is a call of
48. the currently displayed module file Print file prints the currently displayed file on a printer Editor options editor settings w Help opens Help Al Change font changes the font of File Editor Undo restores the state of a file before the last change el Redo restores the last change e Find finds a string in the currently displayed file gt S Replace replaces a string with another string Mouse Actions e To move editor cursor to a specific place click the left button on the desired place in a text To select a text move mouse and hold the left button e To move the selected text to a different location drag a selected text with left button pressed e To invoke editor pop up menu click the right button e To scroll editor view move mouse with middle button pressed e To close an opened file click the middle button on the tab with a file name when multiple files are open e To select a square text block inside the window press and hold the ALT key and left mouse button while moving the mouse e To jump on a specified line number click the first status bar field containing a line number information e To place a method invocation to the source code drag the method from the Project Panel See chapter 2 3 Project Panel for details 72 Processor Expert User s manual User Interface File Editor Pop up Menu To open the File Editor pop up menu click the right mouse button
49. the imported file will be added into the current project e Export exports the selected objects in the project panel e g beans configurations to the specified file Its possible to insert them into another project using the Import command e Cut cuts selected bean with its settings to the clipboard e Copy copies selected bean with its settings to the clipboard e Paste inserts bean from the clipboard to the current project e Help displays related information for currently selected bean or method If there is nothing selected this help page for Project Panel is displayed Pop up Menus of Objects Pop up menus of individual objects in project panel are accessible with a right mouse button click on the object s icon or label Configurations pop up menu e CPUs pop up menu Beans and its methods events init code pop up menus User generated and external modules menus Documentations pop up menu Other mouse actions Drag n drop Dragging method with the left mouse button to the source editor will place a method call to the source code If the shift key is hold while the users drag and drops the method the call is placed exactly to the mouse cursor position on the line Otherwise the call is placed on the new line A behavior of this function is controlled by the option Environment Options Drag n drop method declaration See chapter 2 Processor Expert Options for details e Dragging user module into
50. the method NegVal of the bean RedLED The second line is a call of the method NegVal of the bean GreenLED Calling syntax of all bean s methods is BeanName _ MethodName 5 Finally to create a binary executable file click on Make icon in the CodeWarrior Project Window LED mcp gt em A 140 Processor Expert User s manual Index 5 Bean Wizard Description Bean Wizard is a tool dedicated to the creation and edition of Embedded Beans See chapter 3 2 1 Embedded Beans for details It provides a powerful interface for the composition of new beans and generates the bean files Using Bean Wizard the user can create new beans very quickly and easily without errors in the generated files The user needs only to determine the Properties Methods and Events and write the necessary implementations of the methods and events Bean Wizard facilitates the reusability of existing Beans and helps edit the source code quick location editor s Bean Wizard is an external tool not a part of Processor Expert For further information see Bean Wizard Help Fle Tods Heb Common Properties Global properties Property types Methods Events User Types Divers Help Bean Inspector Bean LCD graph PAE TT rae Display characteristics True True _ BASIC Te Y de wot isok P omais na 141 Processor Expert User s manual INDEX About dialog _
51. tutorials and example projects Rapid prototyping of entire applications Processor Expert allows the users to try several different approaches in real time picking and choosing the best of each for the final solution Users are not confined to a pre determined linear track to a solution e Easy Build of application based on system functional decomposition top down approach e Easy Auto CPU selection e Easy Auto CPU initialization e Easy Auto initialization of each internal peripheral e Simple development of reusable drivers e Simple implementation of interrupt handlers Processor Expert User s manual Introduction e Inherited Modularity and reuse e Inherited ease of implementation of system hardware and software firmware modifications Modular and reusable functions Processor Expert greatly decreases the start up time and minimizes the problems of device idiosyncrasies e It uses the concept of a function encapsulating entity called Embedded Bean with supporting methods and events e Uses a library of predefined beans e Uses a concept of device drivers and interrupt handlers that are easy to reapply e Uses a concept of well documented programming modules to keep the code well organized and easy to understand Easy to modify and port implementations PE allows optimal porting to a previously unused processor e Supports multiple devices within a project and makes it extremely easy to switch them e Supports desired cha
52. 1 BitIO in Processor Expert project panel if the Bean Inspector hasn t been opened automatically Automatical opening of the bean inspector is influenced by environment settings See chapter 2 1 1 Processor Expert Options for details 6 Select Items visibility Advanced view in the pop up menu of the Bean Inspector window in order to display detailed settings of the bean It is necessary for the following steps See picture below Bean Inspector Bit1 BitIO lt Bean Items Visibility Help Propertie Basic view Advanced view Pullre Expert view 134 Processor Expert User s manual Processor Expert Tutorials 7 Using Bean inspector set the bean properties as follows Bean name type RedLED into the edit box Pin for IO select PBO_ADDRO_DATAO Direction select Output BO_ADDRO_DATAO pull 8 To setup generation of methods click on the Methods TAB and set all methods to don t generate and NegVal method to generate code See the following picture 4 jene 2 generate code code 9 click the Change bean icon item of the Bean menu in order to choose a new icon in the list Select the RLEDON icon and click the OK button See the following pictures Change bean icon 135 Processor Expert User s manual Processor Expert Tutorials Choose new icon for RedLED AD D UNSUPPORTED useR Dev QHIMADUI A BULBON MONTOR LCD GLEDON CANZ SIGNALMER rey FLASH PHONE
53. A User application code in event module t Call of a method or occurence of an event Return from method event or interrupt lt Interrupt Figure 3 14 Reset sequence diagram with Processor Expert 108 Processor Expert User s manual Application Design _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 like PLL external bus etc 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 CPU bean inspector defined for this purpose See chapter 2 5 3 Bean Inspector for details 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 etc At the end of the C startup function the main function is called PE_low_level_init There is a second level of Processor Expert initialization PE_low_level_init called at the beginning of the main function PE_low_level_init function provides initialization of all beans in project and it is necessary for proper functionality of the Processor Expert project OnReset event
54. Beans Optimizations coco coo 125 3 6 4 Code Size Optimization of Communication Beans __ _ 126 3 7 Low level Access to Peripherals 2022 0 22 ieee eee coc 127 3 7 1 Processor Expert System Library ooo cc 127 3 7 2 Direct Access to Peripheral Registers _ 0020 e eee eee eee 128 4 Processor Expert Tutorials 130 4 1 Tutorial Project 1 for Freescale HCS12 Microcontrollers 2 2 2 130 4 2 Tutorial Project 2 for Freescale HCS12 Microcontrollers 130 4 2 1 Tutorial for Freescale HCS12 Project 2 Step 1 2 ee eee eee 131 4 2 2 Tutorial for Freescale HCS12 Project 2 Step 2 2 ee 133 4 2 3 Tutorial for Freescale HCS12 Project 2 Step 3 1 eee eee 138 4 2 4 Tutorial for Freescale HCS12 Project 2 Step 4 ooo 139 5 Bean Wizard Description 141 Processor Expert User s manual Introduction 1 Introduction Both hardware and software design have progressed so much with the ever advancing new technologies emerging everyday but their interrelationships and interdependence have been mostly neglected On one hand we often see a good new hardware architecture but the software design is too expensive for such an architecture On the other hand the computerization of nearly all mechanical gadgets all over the modern world leads to the use of embedded computer systems In situations where expense is a consideration embedded computer systems with efficient s
55. Biola 94 3 3 1 Interrupts and Events ccoo 94 3 3 1 1 Interrupt Vector Table occ 96 3 3 1 2 Processor Expert Priority System occ coco 96 3 3 2 GOMIGUIALIONS tio Ok hae Mee ee RN lk aliado 98 3 3 3 Design Time Checking Consequences and Benefits ccoo 99 913 4 TIMING SeCUINGS cios EEE ee eee ste a le da o oN 100 3 3 5 Creating User Bean Templates ccoo 101 3 3 6 Signali NAMES 22 2 2 eee eee eee oe Pos dere da EE E EE E E ahem ake sete Bs 104 3 3 7 Bean Inheritance and Bean Sharing _ 2 ee eee eee ee eee 105 3 3 8 Pin SHAning lt foso six aos Se a te dt ee 107 3 4 Implementation Details 2222 2 2222 eee eee 108 3 4 1 Reset Scenario with PE ocio eee ee ee 108 3 4 2 Version Specific Information for HCS12 and HOS12X occ 109 3 5 AE A 111 3 5 1 Code Generation __ 2 2 eee ee eee 111 3 5 1 Einket Didog z seco eee a as o el ce ce ek ts dd ec a 114 3 5 1 2 Tracking Changes in Generated Code ooo ee eee eee eee eee 115 3 5 2 Predefined Types Macros and Constants ccoo 117 3 5 3 Typical Usage of the Bean in the User Code ___ 2 2 2 eee eee ee eee eee eee eee eee 119 3 5 3 1 Typical Usage of Peripheral Initialization Beans _ 121 3 5 4 User Changes in Generated Code _ 2 2 ee eee eee eee eee eee 122 3 6 Embedded Bean Optimizations _ _ 2 2 2 22 2222 coco 124 3 6 1 General Optimizations ooo 124 3 6 2 General Port I O Optimizations occ 125 3 6 3 Timer
56. Clock path From Till 0 125us 8191 875ps 8192ps 16 384ms 16 384ms 32 768ms 32 768m 65 535ms a y 131 070ms 131 072ms 262 140ms 262 144ms 524 280ms 524 288ms 1048 560ms TF Recalculate value on unit change Error allowed Unit 5 Adjusted settings of the initialization value p x Figure 1 3 Example of TimerInt bean periodical event timer properties 16us Figure 1 4 Timing dialog allows a user friendly setting of beans timing Introduction You ll find many components that we call Embedded Beans in the Processor Expert Bean selector window These components were selected to cover the most commonly required functionality used for microcontroller applications from handling port bit operations external interrupts and timer modes up to serial asynchronous synchronous communications A D converter I2C CAN etc A bean provides a clear interface By setting properties a user defines the future behavior of the bean in runtime The user controls properties in design time by using the Beans Inspector Runtime control of the bean function is done by the Methods Events are interfacing hardware or software events invoked by the bean to the user s code Ais Processor Expert User s manual Introduction The user can enable or disable the appearance and availability of methods of the bean in generated source code Disabling unused methods could make the generated code shor
57. 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 prescaler and timing are shown in the third column of the bean inspector E Prescaler Auto selected prescaler high 64 Interrupt period 100 m fhigh 100 ms Figure 3 4 Example of the timing and prescaler setup The complete MCU timing model with the current state of the individual elements can be viewed using the CPU Timing Model Window See chapter 2 8 CPU Timing Model for details Timing Setup Problems The errors are reported red in the Timing Dialog or in the timing property line in the Bean Inspector The error summary is available in the Error window see details in chapter 2 6 Error Window Please 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 beans in the project Common problems that make impossible to set a timing value e Itis impossible to set some item s This problem is reported in the bean 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 CPU The timing dialog shows the a list of values ranges that are allowed to be set There also might be necessary to increase the allowed error using the Error field within t
58. Notice This feature is not available in this version It s necessary to invoke the bean method ConnectPin to connect a bean to the shared pin It s also necessary to invoke main bean method to connect pin back to the main bean 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 beans control the shared pin using one peripheral it s not necessary to use the ConnectPin method Shared pins are presented in the Target CPU view as well The bean to pin connection line is red 107 Processor Expert User s manual Application Design 3 4 Implementation Details This chapter contains implementation details for Embedded Beans and Processor Expert generated code The following subchapters concerns e Reset Scenario with PE e Version Specific Information for HCS12 and HCS12X Another implementation specific information can be found on individual bean documentation pages 3 4 1 Reset Scenario with PE CPU reset EntryPoint tryPoint User code before PE init First level of PE initialization PLL ext bus User code after C startup function PE init Initialization of the stack pointer runtime librarieg memories main Second level of PE initialization l User event if enabled 1 I 1 Legend User s code E Initialization code generated by Processor Expert
59. Osc DSPFNC 10 Using the procedure previously described for the red LED steps a b c d add the green LED bean to the project The difference from the redLED bean is in the bean s properties pin name and initial value 11 12 13 Set the bean properties as follows Bean name type GreenLED into the edit box Pin for IO select PB1_ADDR1_DATA1 Direction select Output Init value select 1 Click on the Methods TAB and switch all methods to don t generate and NegVal method to generate code using button on the right Click the Change bean icon item of the Bean menu in order to choose a new icon Select the GLEDON icon and click the OK button Now is time to add bean handling the button Open the Bean Selector window again and double click the ExtInt icon on the folder Interrupts in the in order to add the bean to the project See picture below ries Bean Categories On Chip Peripherals Quick help gt amp CPU a 3 CPU extemal devices E amp CPU internal peripherals amp Communication amp Converter E Interrupts soam 8 Interuptector el E Measurement Filter all CPU Licensed h 14 Open the bean inspector for the new bean double click it in the project panel and set the bean properties as follows Bean name type Button into the edit box Pin select PHO_KWH0_MISO1 Generate interrupt on click the option in order to display the options Select the falling ed
60. PU Cpu 56F8011 olx PORTA PORTB PORTC PORTD ANO AN7 En PWMO PW LEES m 0 Figure 2 35 Target CPU MCU block diagram view mode e CPU peripherals list a list of all peripherals of the CPU is displayed If a peripheral is unallocated by Processor Expert it is displayed as a gray icon Otherwise the icon of the bean that allocates the peripheral is displayed The same mouse commands are available as in the other view modes except the operations with pins pins are not visible in this mode Target CPU Cpu MC9S512DG256cP Mi Ea CG E MC9S12DG256_112 DA J AB Y ADO 2 ADI ADCO 9 ADCA HB 9 COPCounter E a des FE Y 8 IntFFPROM Figure 2 36 Target CPU Peripherals List Mode Pins The following information about each pin is displayed on the CPU picture all pins are displayed only in the CPU package view mode e pin name default or user defined e icon of a bean that uses allocates the pin e direction of the pin input output or input output symbolized by blue arrows if a bean is connected Pin names are shortened and written either from left to right or from up to down and are visible only if there is 56 Processor Expert User s manual User Interface enough space in the diagram Some signals and peripherals cannot be used by the user because they are allocated by special devices such as power signals external or data bus The special devices are indicate
61. Processor Expert CodeWarrior Plug in for Freescale HCS12 HCS12X User Manual version 2 96 2007 UNIS spol s r o ALL RIGHTS RESERVED All brands or trademarks are property of their respective holders CONTENTS 1 Introduction 4 1 1 Processor Expert Plug in Overview 0 0 0 ccc cece ee eee eee eee ee eee 4 1 2 Benefits of Embedded Beans and Processor Expert Technology 6 WO AA e A A 8 A ONCE DS a ad a eet 10 1 5 Terms and Definitions Used in Processor Expert o ococococcccccccccocccooos 13 2 User Interface 15 edo Main Menu reorientar de red aer dea ld e as 16 2 1 1 Processor Expert Options 2 ooo 19 P AAS o CEE T o AR AINETES SDA oe A Oe ae 20 2 1 2 1 Tools Setup Macros ___ 22 ee eee ee eee 22 22 Help and Manuals s 02d ol baaa 24 PEE PIOICCU PANG ls ook cute A A A 25 2 3 1 Configurations Pop up Menus _ 22 eee eee ee 30 2 3 2 Configurations Editor 22 ee es 30 2 3 3 CPUS Pop up Menus 2x2 e eee atte hee teh elu ite a e eee aa 31 2 3 4 Beans Pop up Menus _ 220 eee ee eee eee 32 2 3 5 User and Generated Modules Pop up Menus ooo 34 2 3 6 Documentations Pop up Menu _ 2 2 2 ee ee 36 2 4 Beall Selector A A O A ea le eam An 36 2 A BeamASsistant tec o a oe ere eh tac Slee 39 20s INSDECION A A aA e EE 40 2 94 INSPECtOr NEMS ii enol Eee let See ja Bode 42 2 5 2 tems Visibilty ace con ai E yal sh Soak 44 2 5 3 Bean INSpectol cee a a a a a Cee en 45 2 5 3 1 Dialog Box for Timing Set
62. The dialog button E switches the inspector to the shared bean that is used by the current bean The down arrow button Y allows to change the bean from the list of the available beans See chapter 3 3 7 Bean Inheritance and Bean Sharing for details gt Basic Fractional Math Library MFR1 y E e 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 The user may add remove items by clicking on the plus minus button The items in the list can be arranged using a related pop up menu commands B Pins 2 E Pin0 Y Pin GPIOCO_SCLK1_TE GPIOCO_SCLK1_ E Pint v Pin GPIOC1_MOSI1_TE GPIOC1_MOSI1_ e Peripheral selection The user can select a peripheral from the list of the available peripherals The 43 Processor Expert User s manual User Interface peripheral that are already allocated have the bean icon in the list The properties that conflicts with the bean settings have the red exclamation mark Capture register TC3 TC3 Timer counter TIM Capture input pin Y co PM4_ SDDATA2 SBSY Real Number the user can insert any real floating point number v Reall 1 35 e String Allows to enter any text or value Bean name Cpu e String list Clicking the dialog button E will open the simple text editor that allows to enter an array of text lines String list strin
63. The user can write his her own code that will be invoked from the PE_low_level_init function after Processor Expert internal initialization before the initialization of individual beans Thus the user should expect that peripherals are not completely initialized yet This event can be enabled disabled in the CPU bean inspector s events page 3 4 2 Version Specific Information for HCS12 and HCS12X All beans were tested with the CodeWarrior with the following compiler settings e Other parameters Onf The ROM and RAM ranges depend on the target CPU It is recommended to increase the stack size if some standard libraries are used Beans implementation details All the beans Interrupt priority and Event priority Please see the version specific information details in the chapter 3 3 1 2 Processor Expert Priority System e CPU Speed Mode selection CPU methods SetHighSpeed SetLowSpeed SetSlowSpeed if CPU clock dependent beans 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 via events BeforeNewSpeed and AfterNewSpeed Interrupt vectors table IVT is by default generated on the default addresses for of the current target CPU However Processor Expert offers additional configuration of the IVT 109 Processor Expert User s manual Application Design
64. abled e g 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 Bean Inspector Please see version specific information below The user 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 Warning Please note that Processor Expert does not allow the user decrease an event code priority with the exception of Interrupts enabled value on some platforms please see below This is because Processor Expert event routines are not generally reentrant so there is a risc that the interrupt would be able to interrupt itself during the processing If there is such functionality requested the user has to do it in his her event code manually e g by calling a appropriate CPU bean method setting a priority and carefully check possible problems Version specific information for HCS12X derivatives Processor Expert offers the following event priority options e 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 is not changed
65. ackage must be installed in a subdirectory named XPDF The PDF documents are being converted to the text form in the background and stored in your TEMP folder This conversion is executed only once for each PDF file The conversion may take a moment please wait until it is finished It is possible to find more information about XPDF on www foolabs com The configuration for the execution of the program PDFTOTEXT EXE must be included in the Processor Expert Tools The Acrobat Reader must be installed on your computer as well The PDF Search feature was tested with Acrobat Reader 6 0 and 7 0 Opening CPU Documentation in Default PDF Viewer To use a default PDF viewer instead of PDF search window for viewing the CPU documentation set the option Environment Options Use default PDF viewer 79 Processor Expert User s manual User Interface 2 16 1 Regular Expressions Regular Expressions are a widely used method of specifying patterns of text to search for Special metacharacters allow the user to specify for instance that a particular string the user is looking for occurs at the beginning or end of a line or contains n recurrences of a certain character Simple Matches Any single character matches itself unless it is a metacharacter with a special meaning as described below A series of characters matches that series of characters in the target string so the pattern bluh would match pluh in the target string You can cause
66. alog window and enter the name of the project LED 131 Processor Expert User s manual Processor Expert Tutorials fy HC12 Stationery D Documents and Settings Hre 7 Addto Project IA 3 Inthe New Project Wizard window Choose CPU MC9S12DP256 and click next button MC95124256B MC9S12432 MC95124512B MC9512464 MC9512D32 MC9512D64 MC9512DB1284 MC9512DG128B MC9512DG256B MC9512DI128B MC9512DI256B MC9512DJ64 MC9512DP256b MC9512DP512B MC9512DT128B MC9512DT256B 4 Choose C language and click next button 132 Processor Expert User s manual Processor Expert Tutorials Please choose the set of languages to be supported initially You can make multiple selections Assembl C This will set up your application with a ANSI C compliant startup code doing initialisation of global variables Choose yes in the Would you like to use Processor Expert dialog and click next button Choose no in the Do you want to creat a project set up fot PC lit dialog and click next button UN i Choose none in the floating point format support selection dialog click next button 8 Choose small memory model click next button Now the new empty project is created and ready for adding new beans Next step Goto Step 2 Adding beans to the project 4 2 2 Tutorial for Freescale HCS12 Project 2 Step 2 Adding Beans to the Project In t
67. and Hints removes all code generation errors warnings and hits listed in the Error window e Copy to Clipboard copies the whole content of the window as a text to the clipboard 53 Processor Expert User s manual User Interface Note This command can be very useful in the case of contacting our support personnel with a bean setup issue e Help display documentation 2 7 Target CPU Window Processor Expert View Target CPU Package Processor Expert View Target CPU Block Diagram Processor Expert View Target CPU Structure This window displays selected target CPU with its peripherals and pins possible data directions of single pins are indicated by blue arrows on the CPU package when a bean uses these pins Several display modes are supported It is possible to switch the display mode by pushing buttons in the left side menu of the window Control Buttons The meanings of the buttons on the left side are E Rotates CPU rotate the CPU 90 degrees to the right e Show user names on CPU package switches the pins and peripherals default names from catalog for user defined names A Zoom in increases the detail level of the view The whole picture might not fit the viewing area amp Zoom out decreases the detail level of the view Processor Expert tries to fit the whole picture to the viewing area E Show CPU package and peripheral switches to the CPU package view mode E Show BGA CPU
68. and it also depend on e selected CPU e selected peripheral e speed modes enabled for the bean 49 Processor Expert User s manual User Interface The table contains a speed mode tabs speed modes and related settings are supported only in EXPERT view mode that allow to filter the displayed intervals for a specific speed mode or show intersection of all Please note that the intersection contains only a values that can be set in all speed modes with absolute precision without any error so some values that are still valid due to non zero Error allowed value are not shown Clock path Note This table is available in Advanced or Expert view modes only This table is displayed on the right part of the timing dialog if the the button Clock path on the top is pressed Each row of the table represents a device influencing a clock on the path from the clock source on the first row e g the crystal to the peripheral or a part of it The last row contains total divider a total ratio between the source clock and the resulting peripheral clock in the form of mult div where mult is multiplier and div is divider or div if no multiplier is present When multiple speed modes are used it s possible to see the clock path in the individual speed modes by switching the tabs at the bottom The table contains the following columns e Clock device icon a symbol representing a type of the clock device See chapter 2 8 CPU Timing Model fo
69. and pins e Target CPU Block Diagram displays the Target CPU Window in Block Diagram view This window displays the target CPU CPU selected as destination block diagram with its peripherals e Error Window displays the Error window This window displays errors warnings and hints e Target CPUTiming Model displays the CPU timing hierarchy e Peripheral Initialization opens the Peripheral Initialization window for the Target CPU this command is available only if a target CPU is selected e Peripherals Usage shows the CPU Peripherals Usage window e Resource Meter displays the Resource Meter window The Resource Meter shows the current status of a Processor Expert User s manual User Interface chip resources usage or availability e Memory Map opens the Memory Map window This window shows the CPU address space and internal and external memory mapping e Installed Beans Overview displays a list of installed beans and CPUs with additional information about bean drivers and projects with typical settings e CPU Parameters Overview displays the CPU parameters overview table and the query dialog that provides help for the selection of the most adequate processor Tools Tool 1 Tool 2 optionally any other external tool can be added The tools can be added modified or deleted in the Tools Setup dialog Note Bean Wizard can be added also to the Tools menu Help for the Bean Wizard can be found in
70. appropriate CPU manual Each interrupt can have assigned an 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 See chapter 3 3 1 1 Interrupt Vector Table for details Most of the interrupts have a corresponding Processor Expert Events that allows to handle these interrupts Processor Expert also allows to configure interrupt priorities if they are supported by the CPU See chapter 3 3 1 2 Processor Expert Priority System for details Processor Expert Events are part of the Embedded bean interface and encapsulate the hardware or software events within the system Events are offered by the High and Low Level beans to help the user to service the events without a knowledge of the platform specific code needed 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 are for that case invoked from the generated ISR Moreover the event can also be a pure software event caused by a buffer overflow or improper method parameter 94 Processor Expert User s manual Application Design Interrupts Usage in Bean s Generated Code Some high level beans use interrupt service routines to provide their functionality Usage of interrupts can usually be enabled disabl
71. appropriate help page 35 Processor Expert User s manual User Interface 2 3 6 Documentations Pop up Menu Documentations Folder Pop up Menu This menu is opened by right clicking on the Documentation folder icon in the Project Panel Following commands are available e Add documentation file add a new documentation file into project New documentation Text file creates a new text documentation file HTML file creates a new HTML documentation file e Expand Collapse expands collapses one level of the folder s tree Expand all completely expands the folder s tree e Collapse all completely collapses the folder s tree e Delete all documentation deletes all the contents of the folder e Help displays documentation Documentation Pop up Menu This menu is opened by clicking right mouse button on the documentation file from the Documentations folder of the Project panel Following commands are available e View documentation shows the document in the File Editor Edit documentation edits the document in the File Editor Open in external viewer uses the default shell editor to open the document e Remove from project removes the document from the project e Help displays documentation 2 4 Bean Selector Processor Expert View Bean Selector Bean Selector shows supported embedded beans including CPU beans and bean templates It lets the user select a desired bean or template and
72. ards the end of the list This item is available only for the list type properties Help on the Item shows the appropriate help page for the selected item Copy Error Message to Clipboard copies the text of an error message for the selected inspector line to the clipboard 2 5 1 Inspector Items The following types of the items could be found in the Inspector Alphabetical list Descriptions 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 the sign will show hide the items in the group but doesn t influence value nor validity of the items E Receiver Enabled ol Boolean yes no The user can switch between two states of the property using a round icon al The Generate code Don t generate code settings of methods and events works the same way and determines whether the implementation code for the corresponding method or event will be generated or not you may thus generate only the methods and events used by your application PESL support Ino ol Enumeration Selection from a list of values If the user clicks the arrow icon Y a list of the possible 42 Processor Expert User s manual User Interface values for the property is offered Qualifier RWX j Enumeration Group A list of items Number of visible and valid items in the group depends on c
73. argetName Settings is not available when no project is open Where to find source code and user modules Processor Expert generates all drivers during the code design process The generated files are automatically inserted into the active default target in the Code Warrior project Generated files corresponding to Embedded Beans can be accessed in the Generated Code folder in the Files tab in the Code Warrior project window Other files intended to be modified by users are generated into the User modules folder in the Files tab in the Code Warrior Project window A user can also add his her own specific source code files into this folder If the linker setting of the default target does not match the CPU in the Processor Expert project the user is asked whether to automatically set the correct linker settings in the default target or to create a new target with correct linker settings In the latter case the files will be generated in the new target more information about the Code Warrior Project panel can be found in the Code Warrior documentation For more information on generated files please see the chapter 3 5 1 Code Generation Processor Expert User s manual Introduction al01x 0 sdm internal memory NES Y A e gt Files Link Order Targets Processor Expert e File Code Data Wwe support 0 0 p Sib 0 0 wf e AS MSL C 56800 lib 0 0 zi HE MSL C 56800 Im n a n a a g i Runt
74. art Properties parameters of the bean Property settings define which internal peripherals will be used by the bean and also initialization and behavior of the bean at runtime Target CPU the CPU derivative used in a given project Template Bean Template is a bean with preset parameters User defined Bean Template User defined bean template is a bean 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 a 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 Processor Expert User s manual User Interface 2 User Interface Menu Processor Expert menu is integrated in the Code Warrior IDE menu It contains a new item named Processor Expert See Processor Expert plug in Main menu page for description of individual items The user interface of Processor Expert consists of the following windows integrated in CodeWarrior IDE Project Editing Windows e Project panel with beans including CPU s external modules and documentation included in project Project Panel supports several configurations of one project e Inspector a window which allows the user to setup Beans and Configurations of the project e Bean Selector shows all supported beans in the appropriate version of the Processor Expert inclu
75. ast modification List of revisions of the driver Each revision contains a version number date and author of the revision The contents of the window can be configured using commands in menu View It is possible to view this window also in HTML format using command View As HTML Menu e View Bean Type all displays all beans Beans only hides CPU beans CPUs only displays CPU beans only Bean Info all displays information about the bean basic displays basic information about the bean only none hides information about the bean Driver Info all displays the most information about bean s drivers basic displays only a basic information about the bean s driver none hides information about bean s drivers Implementation display all shows all beans Hide beans without any selected driver shows only beans which contain the selected driver Hide beans with any selected driver shows only beans which do not contain any selected driver As HTML display this table in default HTML browser Temporary HTML file will be removed from the disk after closing Processor Expert e Help Help on Bean displays help for currently selected bean except CPU beans Help on this Window displays this page 66 Processor Expert User s manual User Interface Installed Beans Overview Al E View Help Init_DSPI_MPC5500 Deserial Serial Peripheral Interface MPC5500 Init_DSPI Status
76. avigation buttons gt allow the user to browse over the previously inspected beans e View regs button present in Bean Inspector Only Pressing this button opens the Peripheral initialization window 41 Processor Expert User s manual User Interface View mode buttons They are placed at the bottom of the window Basic Advanced Expert They allow users to switch complexity of the view of the bean s items See chapter 2 5 2 Items Visibility for details Pop up Menu This menu is invoked by a click of the right mouse button on the specific inspector item The menu contains the following commands 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 New Item Into List adds a new item before the currently selected one This item is available only for the list type properties Delete Item From List deletes a selected item from the list This item is available only for the list type properties Move List Item Up Moves the selected row towards the start of the list This item is available only for the list type properties Move List Item Down Moves the selected row tow
77. bled e Before or after the speed mode is changed the following event functions are called BeforeNewSpeed AfterNewSpeed 3 2 2 3 Changing Names of Peripheral Devices The editor window lists all peripherals names Initially on chip peripheral devices pins ports timers converters etc have default catalogue names You may change these names using this editor How to Open the Editor In order to open the CPU Peripherals Names Editor follow these steps e Move the mouse pointer to the selected CPU icon on the Project panel e Press the right mouse button a popup menu will appear e Click on CPU peripherals names Purpose of name changes Some beans are associated with on chip The link between a bean and a peripheral is done by names not by any internal identification Therefore if you change the name of a peripheral to which a bean was linked an error will occur The bean s link will no longer be valid Fortunately when you change a peripheral s name Processor Expert offers to update the name in all the project s beans Advantages of the option to change names e Peripheral names may express the reality of the CPU environment making the project more understandable e When working with several processors having different peripheral names one may assign a project specific name in order to facilitate the CPU changes in the project 92 Processor Expert User s manual Example Timer0 of CPUl and TmrA o
78. characters that normally function as metacharacters or escape sequences to be interpreted literally by escaping them by preceding them with a backslash for instance metacharacter matches the beginning of a string but V match character match and so on Examples foobar matches string foobar FooBarPtr matches FooBarPtr Escape Sequences Characters may be specified using an escape sequence syntax much like that used in C and Perl n matches a newline t a tab etc More generally xnn where nn is a string of hexadecimal digits matches the character whose ASCII value is nn If You need wide Unicode character code You can use x nnnn where nnnn one or more hexadecimal digits xnn char with hex code nn x nnnn char with hex code nnnn one byte for plain text and two bytes for Unicode t tab HT TAB same as x09 n newline NL same as x0a r car return CR same as x0d f form feed FF same as x0c a alarm bell BEL same as x07 e escape ESC same as xlb Examples foo x20bar matches foo bar note space in the middle t foobar matches foobar predefined by tab 80 Processor Expert User s manual User Interface Character Classes You can specify a character class by enclosing a list of characters in straight brackets which will match any one character from the list If the first character after the is the class
79. chieve optimized code 3 6 2 General Port I O Optimizations Notice These optimizations are not usable for the Peripheral Initialization Beans BytelO Bean Versus BitslO Bean BytelO bean instead of BitsIO bean should be used when whole port is accessed The BitsIO bean is intended for accessing only part of the port e g 4 bits of 8 bit port Using the BitsIO bean results more complex code because this bean provides more general code for the methods which allows access to only some of the bits of the port On the other side the BytelO bean provides access only to the whole port and thus the resulted code is optimized for such type of access BitsIO bean versus BitlO beans In the case of using only a part of the port the multiple BitlO beans could be used A better solution is to use the BitsIO bean replacing multiple calls of BitlO bean s methods The application code consist only of one method call and is smaller and faster 3 6 3 Timer Beans Optimizations Notice These optimizations are not usable for the Peripheral Initialization Beans For better code size performance it s recommended do not use a bigger counter reload compare register for timer than is necessary Otherwise the code size generated by a bean may be increased e g For 8 bit timer choose 8bit timer register In some cases several timing periods are required when using timers For example the TimerInt bean The Processor Expert allows changing the timer peri
80. corresponds to one interrupt vector VT may be e placed in ROM usually first level IVTs the jump to the right vector is done by hardware no interrupt vectors can be changed at runtime e placed in RAM usually second level IVTs the jump to the right vector is done by software first level interrupt handling subroutine This implementation can be slower due to this software redirection to users routine The interrupt vectors placed in RAM and not allocated by any bean can be changed at runtime using CPU bean methods GetIntVect and SetIntVect The type of the IVT ROM RAM can be setup using the option Application Options Interrupt Vector Table Each processor that can handle and process interrupts has a first level IVT in ROM The second level is used only when it is necessary i e IVT is placed in RAM Processor Expert generates content of the whole IVT into the file vectors c The content of the file depends on the compiler syntax of the interrupt declarations 3 3 1 2 Processor Expert Priority System Some CPUs support selectable interrupts priorities The user 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 priority of the event code Priority can be changed also in the user code The user may use a CPU bean method to adjust the priority to a
81. ctname c and events module events c cannot be removed from the project e Help displays an appropriate help page User Module Pop up Menu Edit Module opens the source code in the editor Edit Header File opens the header file with the same name as the module in the editor User Module Enabled The user module is enabled for the compilation e User Module Inspector The User Module Inspector window is shown It allows the user to customize the name and directory of the module e Remove User Module removes the user module from the project e Help displays an appropriate help page Generated Modules Pop up Menu e View Module opens the module source code in the editor e View Header File opens the header file with the same name the module e Code Generation enables disables overwriting of the module by Processor Expert This option is available only for common modules like vectors c or modules not related to a specific bean For bean modules generation control use the pop up menu of the bean instead See chapter 3 5 4 User Changes in Generated Code for details Always Write allows a module to be overwritten Don t Write disables any modification by Processor Expert e Help displays an appropriate help page External Modules Pop up Menu e View External Module opens the module source code in the editor e View Header File opens the header file with the same name the module e Help displays an
82. d Code command that allows to temporarily disable generation of all generated code without completely suspending PE e Open Processor Expert for will enable PE for the current project If the PE is opened for a project that had never had PE activated PE will popup a dialog that notifies the user that PE will add the files 1OMap c h containing declarations for the peripheral modules to the project The user should know how to adapt the project himself there might be other files e g linker parameter file that can cause conflicts as well In case that the command is applied for the project which has already been using Processor Expert previously even if it is disabled at the moment PE will automatically find an existing Processor Expert project file pe and will use data from that file This command is intended for experienced users only A new Processor Expert project should be created using the File New command and selecting the Processor Expert in the new project wizard Code Generation 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 Beans can be accessed in the Generated Code folder in the Files tab in the Code Warrior project window The other files intended to be modified by the user are generated into the User modules folder in the Files tab in the Code Warrior project
83. d by a special blue icons for example 9 The allocation of peripherals by special devices can be influenced by CPU properties Hints Pin hint contains e number of the pin on package both names default and user defined e owner of the pin bean that allocates it e short pin description from CPU database Bean icon hint contains e bean name e bean type e bean description Shared Pins If a pin is shared by multiple beans the line connecting the pin to the bean has a red color Figure 2 37 Shared pin connection On chip peripherals The following information about each on chip peripheral is displayed on the CPU package e peripheral device name default or user defined e icon of the bean that uses allocates the peripheral device Peripheral device hint contains e peripheral device name e owner of the pin bean that allocates it e short peripheral device description Hint on icon contains e bean name e bean type e bean description 57 Processor Expert User s manual User Interface If a peripheral is shared by several beans for example several beans may use single pins of the same port the 2 icon is displayed Note for peripherals working in several modes Some peripherals work in several modes and these peripherals can be represented by a several devices in the CPU databases For example the device TimerX_PPG and TimerX_PWM represents TimerX in PPG and in PWM mode These devices
84. dded peripherals It significantly reduces project development time The following are the primary reasons why users feel that way e PE has built in knowledge internal definition of the entire CPU with all its integrated peripherals e PE encapsulates functional capabilities of CPU elements into concepts of configurable beans e PE provides an intuitive graphical UI displays the CPU structure and allows the user to take advantage of predefined and already verified beans supporting all typically used functions of the CPU e Applications are designed by defining the desired behavior using the component settings drag amp drop selections utilizing the generated methods and events subroutines and combining the generated code with user code e PE verifies the design based on actual CPU resource and timing contentions e PE allows the efficient use of the CPU and its peripherals and building of portable solutions on a highly productive development platform Minimized time to learn the CPU 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 e The user is able to utilize the CPU immediately without studying the CPU s documentation e The user is able to implement simple applications even without deep knowledge of programming e PE presents all necessary information to the user using built in descriptions and hints e PE has built in
85. de ERR_VALUE neither ERR_RANGE If the method is called with incorrect parameter it may not work correctly e Ignore enable test This option can disable generation of the code that provides testing if the bean peripheral is internally enabled or not If the option is set to yes methods do not return error code ERR_DISABLED neither ERR_ENABLED If the method is called in unsupported mode it may not work correctly e Ignore speed mode test This option can disable generation of the code that provides a testing if the bean is internally supported in the selected speed mode If the option is set to yes methods do not return error code ERR_SPEED If the method is called in the speed mode when the bean is not supported it may not work correctly 592 Processor Expert User s manual User Interface e Use after reset values This option allows Processor Expert to use the values of peripheral registers which are declared by a chip manufacturer as the 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 Comment The Comment tab allows to enter a text that will be shown in the hint when the mouse cursor will be placed on the configuration It could be any text related to the configuration for example an e
86. debug it before the final burn in These are typical steps when working with Processor Expert Other beans help you to very quickly include pictures files sounds and string lists in your application The other beans can be obtained from www processorexpert com or created from existing sources for instance FFT Other beans can incorporate already existing beans They can inherit their properties methods and events Imagine that you want to share a bean with other developers For example a bean that can drive an LED segment display Because it is used often for different hardware configurations on different CPU pins then it must be portable and independent of CPU resources A lot of tasks and algorithms can be incorporated into a bean Such beans are called software SW beans SW beans can be pure SW beans FFT or can inherit even multiple beans that encapsulate HW resources The advantage is independence on a physical layer portability and sharing of once written and tested code For our example we simply choose as parents BitIO BitsIO or BytelO and TimerInt beans from the bean library The new LED display bean will provide the properties of a bean reference type for this bean In design time this allows the new bean access to its parents properties and defines the physical connection pins or timer resources Additionally the new bean will have its own properties and methods Methods and events can be constructed using the parent bean s
87. ding CPU beans and bean templates e Target CPU a window graphically showing CPU package structure and beans connected to internal peripherals Allows to easily add beans related to a specific peripheral to the project using a pop up menu of the peripheral Project Information Windows e Error window a window with errors warning messages and hints from project checking generation and from external tools e CPU Timing Model a window showing the target CPU s timing e Peripheral Initialization shows overview of peripheral initialization settings for the current CPU e Peripherals Usage Inspector a window showing which bean allocates which on chip peripheral e Resource Meter a window displaying the amount of the target CPU s resources already allocated e Memory Map a window showing the CPU address space and internal and external memory mapping Processor Expert Overview Windows e Installed Beans Overview this window contains information about installed beans in the current version of Processor Expert e CPU Parameters Overview a window providing access to the CPU s database e PDF Search a window allows the user to quickly browse in a PDF documentation for the CPU Processor Expert User s manual User Interface Dialogs There are the following dialogs for setting the Processor Expert environment e Environment Options Processor Expert plug in environment options e Tools Setup setup dialog box for the to
88. e displays the generated CPU module in the File editor View Edit Event Module displays the generated CPU events module in the File editor View Edit Main Module displays the generated main module in the File editor View Linker File displays the generated linker file if it exists in the File editor View Makefile displays the generated maker file if it exists in the File editor View MAP File displays the MPA file in the File editor View List of Methods displays the list of methods Restore Default Template Settings restores default setting of the template Customize this bean template saves the highlighted chosen CPU and its settings as a template Remove CPU From Project removes the highlighted chosen CPU from the project Help displays documentation 2 3 4 Beans Pop up Menus Beans Folder Pop up Menu This menu is opened by right clicking on the Beans folder icon in Project Panel Following commands are available Expand Collapse expands collapses one level of the folder s tree Expand all completely expands the folder s tree Collapse all completely collapses the folder s tree Change folder name edits the subfolder name Delete folder deletes the subfolder and all its contents Delete all beans deletes all beans from the project Add bean s invokes a dialog which allows the user to choose and add new beans to project Add subfolder creates a new subfolder Import Imports al
89. e Editor which allows to change the settings of the bean These settings will be saved as a template See the following section Customizing Bean Template Settings for details Short template description Type a short description e User gets on of the messages Setting of the bean template is not dependent on the target CPU or Warning Setting of the bean template is dependent on the target CPU The second one means that the template will be shown in bean selector only for the current target CPU e Associated peripheral Mode This setting is present only if it is meaningful If the user chooses a peripheral the template will be shown in OnChipPeripheral mode only for this peripheral e Existing templates Shows list of the existing templates for the bean Clicking on the item in the list will load the templates settings into the input fields After clicking the OK button the bean template is saved and automatically added to the Beans Selector tree 102 Processor Expert User s manual Application Design Customizing Bean Template Settings If you click Customize settings button in the Bean Template dialog the Template Editor dialog window is shown and you can make the following changes into the template set default values of properties set default values of methods or events whether it has be generated or not generated rename methods by double clicking on method name set feature of properties methods or even
90. e is no error reported in a bean settings If there is an error in a bean settings and no other bean is influencing the register the after reset values are shown 68 Processor Expert User s manual User Interface Menu e View Sort Registers by Address If this item is checked registers are sorted in list by their address Otherwise they are sorted by name Group Registers If this item is checked groups of numbered registers with the same name are shown as expandable folders The name of each folder is the same as the name of the registers with numbers replaced by xx Show Unused Bits This option enables disables displaying the registers bits unused by the manufacturer When it is enabled the unused bits are listed with the name unused Expand all expands the folder and all its subfolders Collapse all collapses the folder and all its subfolders e Help Help displays documentation Pop up menu for a register e Register Details opens a window containing a detailed information for the register e Search Register in PDF Documentation searches the register in the CPU documentation using PDF search See chapter 2 16 PDF Search for details This option is available only if PDF search is available and installed Peripheral schematic Notice Peripheral schematics view is not available in this version It is possible to switch peripheral initialization window style between register list per
91. e of the configured value The table allows the user to configure his her requirements on the prescalers Autoselect means that the value is configured automatically by Processor Expert to achieve the requested timing Otherwise if there are some values set manually only these values will be used and possible timing values are limited to the values that can be achieved with the manually set clock source and or prescaler values The table contains a row for each prescaler which is used by the device selected for the bean Each column contains a value corresponding to one speed mode except the last column which shows values of the prescalers that are really set It s possible to adjust the values only in the columns of the speed modes that are enabled The table can contain the following rows e Clock source the clock source is fixed for each speed mode Even if the runtime setting is used this value has to be the same for all values from the list in case of from a list of values or for the whole interval range in case of from interval See below for details on Runtime setting e Prescaler Pre prescaler the prescaler influencing the clock of the peripheral selected for the bean If the runtime setting from a list of values is used this value can be different for every item of the list Otherwise it has to be fixed In some cases it s necessary to select the clock source before adjusting this value 47 Processor Expert User s
92. e tides aera Soh wie 14 Quick stattes laa eee cee ieee eee ue ie 85 Renaming peripherals _ 2 92 Reserving CPU resources ooo 45 Reset scenario 200 2 ee ee eee 108 Resource meter 61 Review generated code ___ 115 Search regular expressions _ ooooooooooo o 80 Shared ancestor bean 105 106 Sharing pins with multiple beans _ 107 Signals mi a da 104 Slow speed mode _ 91 Speed modes _ _ eee 91 Target CRU 232i Oe a 14 54 Target switching o iaa ees eee 98 Template a ee ee ee he 14 MOMS eevee oo ee eek ad aden eet ee 13 MMMM 2B ope he a a oe Lo aint 100 46 Timing units a da cel 5 ae Be A a te 50 Wip Of the day oes os Sec cee es Sed an 24 Tool Setup it Geet etic cee aes Cee 20 Tracking changes in generated code __ 115 Index Processor Expert User s manual A A Sues aes eave 130 Update from package 18 Used CPU resources _ 45 User changes in a bean code __ 33 User Interface __ 15 User module Loco 14 User modules _ 34 85 Using mouse in Project Panel ooo 27 Version specific items occ ooo 52 EU AS A A 14 143 Index Processor Expert User s manual Index 144
93. e type of the timing e The field Error allowed 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 48 Processor Expert User s manual User Interface e The Min resolution field is used for setting interval or capture bean timing Allows the user to specify maximal acceptable length of one tick of the timer In the case of interval settings type the of low limit percentage of the low limit value can be used as the unit for this value Minimal timer ticks Note This item is available only for setting of period in beans where it s meaningful e g PWM PPG This item allows to set a minimal number of timer ticks in period It means that it will be possible to set a duty of the output signal to at least the specified number of distinct values for any period of the output signal at runtime Value 0 means no requirements for the timer settings Adjusted values This table displays a real values for each speed mode the currently 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 Status box The status box displays a status of the timing setting s If the timing requirements are impossible to meet a red err
94. e user can select which of them will be generated and which not Selected methods will be generated during the code generation process into the bean modules Module source code module Could be generated by Processor Expert Bean modules CPU Module events c or created by the user and included in the project user module 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 which is often used within this documentation Peripheral Initialization bean encapsulates the whole initialization of the appropriate peripheral Beans that have the lowest levels of abstraction and usage comfort See chapter 3 2 1 1 Bean Categories for details 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 See chapter 3 7 Low level Access to Peripherals for details Popup menu this menu is displayed when the right mouse button is pressed on some graphical object PLL Phase Locked Loop This circuit is often built in inside the CPU and can be used a main source of the clock within the CPU Prescaler A fixed or configurable device that allows to divide or multiply a clock signal for a peripheral CPU peripheral or its p
95. ean Categories The categories are related to the bean s functionality and allow to quickly find appropriate bean for a desired function There are the following four main categories containing many sub categories e CPU all available CPU beans The CPU folder in Bean Selector contains subfolders for the CPU families e CPU External Devices beans for devices externally controlled to the CPU For example sensors memories displays or EVM equipment e CPU Internal Peripherals beans using any of on chip peripherals offered by the CPU The Bean Selector folder with the same name contains sub folders for the specific groups of functionality i e Converters Timers PortlO etc Note It seems that beans especially in this category correspond to on chip peripherals Even this declaration is close to the true the main purpose of the bean is providing the same interface and functionality for all supported CPU derivatives This portability is the reason why the bean interface often doesn t copy all features of the specific peripheral e SW beans encapsulating a pure software algorithms or inheriting a hardware dependent beans for accessing peripherals These beans along with beans created by the user can be found in a bean selector folder SW Specific functionality of the CPU derivative may be supported as a version specific settings of the bean For more about this feature please refer to Version specific in the bean documentation or Bean
96. ecified type to the project The user can choose the file extension from the sub menu and select the file using a standard windows file selection dialog Please note that when a c module is added Processor Expert automatically finds a header file h with the same name for it if it exists The header file is not visible as a separate item in the list of user files but it s accessible using the View header file command of the c module pop up menu Such header file is automatically treated as a part of the project so it cannot be explicitly added into the user files list e New User Module The user can choose a new file type and specify a file name and path The new file is added to the project Please note that when a c module is created Processor Expert creates automatically a header file h with the same name for it Such header file is not visible as a separate item in the list of user files but it s accessible using the View Header File command of the c module pop up menu It also cannot 34 Processor Expert User s manual User Interface be explicitly added into the user files list Expand Collapse expands collapses one level of the folder s tree Expand All completely expands the folder s tree e Collapse All completely collapses the folder s tree e Delete All User Modules removes all previously added user modules from the project The user is asked for a permission on removing the modules The main user module proje
97. ector displays documentation for the Bean Selector A Bean pop up menu is available by clicking the right mouse button on a bean It contains the commands Add the bean to the current project adds the bean to the current project e Delete selected template removes the selected template from the Bean Selector Help on Bean displays bean documentation Help on Bean Selector displays documentation for the Bean Selector Bean Selector pop up menu is available by clicking right mouse button on the area inside the Bean Selector window It contains the commands e Update updates new beans and templates to the tree according to the appropriate category in the Bean Selector window e Help on Bean Selector displays documentation for the Bean Selector The target CPU folder pop up menu is available by clicking the right mouse button on the Target CPU folder in the On Chip Peripheral mode This menu is the same as the pop up menu for the target CPU in the project panel See chapter 2 3 Project Panel for details for details Peripheral folder pop up menu is available by clicking right mouse button on the peripheral in the On Chip Peripheral mode It contains the commands Expand Collapse expands or collapses the folder Expand All expands the folder and all of its subfolders 38 Processor Expert User s manual User Interface Collapse All collapses the folder and all of its subfolders Show Peripheral Structure ope
98. ed by the user for low level interrupt processing For items whose ISR names have been specified within a bean settings a user specified name of an ISR and name of the interrupt vector is shown If an ISR name was not specified interrupt 25 Processor Expert User s manual User Interface has to be disabled in this case only the interrupt vector name is present All bean s items has its status icon that signalizes the enabled E or disabled 1H state If this state cannot be directly changed the background of the icon is gray For more details please see chapter 3 2 1 Embedded Beans e User modules included in the project main module event module external user modules e Generated Modules This folder contains the modules generated by Processor Expert There is a special subfolder for the generated Bean Modules For the bean module description please see chapter 3 5 1 Code Generation e External Modules This folder contains the modules that are not generated by Processor Expert but are required for the application such as libraries or system modules These files are not influenced by Processor Expert but they are linked to the final application Note about user generated and external modules The header file h of a module is not shown if its name without extension corresponds to an already displayed c file To access such header file there is possible to use the View Header File command of the module c file pop up
99. ed via property Interrupt service event If the interrupt service is used complete interrupt service routine is generated into bean s driver and the generated code contains configuration of the corresponding peripheral to invoke the interrupts The user should be careful in disabling an interrupt If he she expects a bean to operate it is necessary to allow the interrupt invocation by enabling interrupts and if the CPU contains priority system setting a corresponding interrupt priority level This can be done using the appropriate method of the CPU bean Note It is a common bug in user code if there is a waiting for a result of the bean action while the interrupts are disabled In this situation the result of the bean method will not change until the interrupt service routine is handled See description of the property Interrupt service event for detailed information about the particular bean Enabling Event Functionality of each event can be enabled or disabled The user can easily enable the event and define its name within the Bean Inspector of the appropriate bean Another possibility is to double click an event icon in the bean s subtree or use a pop up menu in the Project Panel window Properties M Methods Events Build options Used Comment Event module name en E OnReset generate code Event procedure name Cpu_OnResel laNnCulNTN ldar t manarsta nada Figure 3 3 Event Example in the Bea
100. encrypted compressed MPCS5500 Init_DSPI_ Author Processor Expert PKa Current version 01 073 Init_EBI_MPC5500 External Bus Interface EBI MPCSS00 Init_EBI_W Ore oi 1 faamerracnio emi tb Figure 2 45 List of Installed Beans 2 13 Peripheral Initialization Processor Expert View Peripheral Initialization The Peripheral Initialization window shows overview of peripheral initialization settings for the current CPU It displays initialization values of all control status and data registers of selected peripheral including single bits The user can also see peripheral schematic diagram Peripheral Initialization can be invoked from the View menu or from Target CPU window or using a Peripheral Initialization button in the Bean Inspector If the Peripheral Initialization window is docked with the Bean Inspector window the peripheral is automatically changed according to the peripheral selection in the bean selector Automatic changes of the peripheral can be disabled using the lock icon a Notice The Peripheral Initialization and Peripheral Usage are both only one window in two different modes These windows could not be displayed both at once The initialization information reflects e CPU default settings when the peripheral is not utilized by Embedded Bean e Embedded Bean settings when the peripheral is utilized by the Embedded Bean and the bean settings are correct Peripheral Initialization Inspector shows initialization a
101. ent item you may open the File Editor at the position of the corresponding method or event e Selected settings the settings of the items are made in the third column See chapter 2 5 1 Inspector Items for list of item types e Setting status the current setting or an error status may be reflected on the same line in the rightmost column of the inspector Read only items Any item can be presented as read only so the user could not change its content Read only values are gray Width 3 bits 3 bits Menu The following items are available e Bean enabled in Bean Inspector Only Template Restore default template settings restores settings of the template Save bean settings as template invokes template editor See details on Bean Templates here Active template Shows list of currently available templates for the bean with currently active template selected Change bean icon allows the user change the bean icon Autoconnect auto connects the bean to the CPU Disconnect disconnects the bean from the CPU e Items Visibility see the chapter Items Visibility for more information about view modes e Help Help on Selected tab displays documentation for the current tab Help on Inspector displays Bean Inspector documentation Help on Bean enabled in Bean Inspector Only displays documentation for the selected bean Embedded Beans Page displays Embedded Beans documentation e N
102. er there is still implemented a comfortable settings of devices features and effective set of methods and events e Peripheral Initialization Beans These beans are on the lowest level of abstraction An interface of such beans is based on the set of peripheral control registers These beans cover all features of the peripherals and were designed for initialization of these peripherals Usually contain only Init method see 3 5 3 1 Typical 88 Processor Expert User s manual Application Design Usage of Peripheral Initialization Beans for further details The rest of the function has to be implemented using a low level access to the peripheral This kind of beans could be found in the CPU Internal Peripherals Peripheral Initialization Beans folder of the Bean selector and they are available only for some CPU families The interface of these beans might be different for a different CPU The name of these beans starts with the prefix Init_ Table of the features of the different levels beans Feature High level Peripheral Init High level settings portable between yes partially no different CPU families es Portable method interface for all CPU y partially Init method only families usually direct access to control registers CPU specific peripheral features support partially no Events support Software emulation of a bean function y 1f the specific hardware is not present Low level peripheral initialization setting
103. ersion Toggle break Set breakpoints on actual cursor position Add watch Add watch to watches list in Watches window Evaluate Modify Open watch editor and enable to edit value of any variable Run Runs application in target system 73 Processor Expert User s manual User Interface Go to cursor Runs application and it stops on actually selected row and breakpoint Stop Stops running application Reset Resets application in target system Step into Steps program including subprogram call Step over Steps program without subprogram call Step into in assembler Steps program including subprogram call After one assembler instruction execution actual program position is displayed in window Step over in assembler Steps program without subprogram call After one assembler instruction execution actual program position is displayed in window Go to Source Line Opens window and goes to actual program position Modules Shows modules list into ABS file Disassembler Opens Disassembler for the current module Disassembler Whole Code Opens Disassembler for the whole program memory e Options Editor Options setting of the File Editor see Editor Options below Change Font change font of File Editor Disassembler Op codes These commands in this submenu are not supported in this version of Processor Expert e Editor Toolbar Visible show or hide toolbar
104. ert The user can specify which files will be saved and will replace the old ones using a check marks and a buttons All and None The user can also visually compare the changes in the currently selected file by pressing a button DIFF Pressing the OK button will save all selected modules and replace the current ones lox List of files modified during code generation Press DIFF button to compare selected file with the modified version It s also possible to select which of them will be saved to disk WA CODE S Vectors c Y CODESCpu C Y CODENnhr3 C M CODENnhr3 H All None DIFF Figure 3 17 List of modyfied files If the user presses the DIFF button a file editor in a comparison mode is shown It contains highlighted parts that had been changed during the code generation See chapter 2 15 File Editor for details 115 Processor Expert User s manual Application Design Editor E test sdsd test CODE Inhr3 C READ ONLY oid Inhr3_ Init void oid Inhr3_ Init void panies O ita 0 SCIi SCICR LOOP 0 SW SCIL SCICR LOOP 0 SWA setReg SCI1 SCICR 0 setReg SCI1 SCICR 0 243 1 Read Only ls Syntax highlighting For Metrowerks DSP C Compiler Figure 3 18 A file before and after the generation After the Modified Files dialog user can also review a list of automatically deleted unused files The Environment Options Delete unused files environment option has to be e
105. es during last successful code generation SGENDIRRELBIN same as SGENDIRBIN during last successful code generation only relative path GENDIRRELEVENT EVENTTOBIN GENDRVTOEVENT relative path from drivers directory to main and event modules directory during last code generation GENEVENTTODRYV relative path from main and event modules directory to drivers directory during last code generation e GENEVENTTOBIN relative path from main and event modules directory to binary files directory during last code generation GENPRJNAME name of the project during last successful code generation Macros in format List of macros that can be used for definition of tool output messages format ERRPTH name of file where errors were found ERRMSG full partial error message FIRROW first row position FIRCOL first column position e LASROW last row position e LASCOL last column position MSGSKP skip next string MSGEND end continuation of error message MSGSTR string1 string2 stringl is written to error message and then string2 is skipped as in command MSGSKP 23 Processor Expert User s manual User Interface Backward compatibility The following macros are supported only for backward compatibility There is no warranty that they will be supported in the next version of Processor Expert REDDIR full path name of project directory for redirection REDINP full path name of
106. et shows alphabetical list of available beans The user can speed up searching the right bean typing the start of the bean name on the keyboard Filters can be used here like on the other Bean Selector tabs Please see below for menu and control details e Assistant guides the user during the bean selection process The user answers a series of questions that finally lead to a selection of a bean that suits best for a required function See chapter 2 4 1 Bean Assistant for details Bean names are colored black and the bean template names are colored blue The beans that are not supported for the currently selected target CPU are gray By double clicking on the bean it is possible to insert the bean into the current project The description of the bean is shown in a hint Quick Help The button Quick Help shows short information about function of the bean The Quick Help is displayed as a part of the Bean Selector window and is updated when the user selects another bean in the tree Bean Selector A x Categories On Chip Prph Alphabet Assistant lt Quick help 6 Communication Bean BitlO E Converter amp ADC HS Interrupts G Measurement H amp S Peripheral Initialization Beans amp Port 1 0 con om Version specific a information for MOEDUCANOTV A Filter for MCSSO8GB6OCFU only Licensed Figure 2 7 Bean Selector with Quck Help panel This bean implements an one bit input output It uses one bit
107. expands the folder s tree e Collapse all completely collapses the folder s tree e Delete all configurations deletes all the content of the folder e Help displays documentation Configuration pop up menu This menu is opened by clicking on the icon of one of the configurations in the configurations folder of the Project panel Following commands are available e Configuration Inspector invokes Configuration Inspector default on double click e Select Configuration as Active selects this configuration as active e Delete Configuration removes this configuration from the project Add New Configuration adds a new configuration to the project e Rename Configuration renames this configuration e Help displays documentation For more information about configurations see chapter 3 3 2 Configurations 2 3 2 Configurations Editor Project panel Configurations pop up menu Configurations Editor Configurations editor shows a table of all configurations and currently selected target CPUs and Embedded Beans state in the configurations The leftmost gray column contains a name of one configuration in each row and the header of the table contains the names of the beans For details on configurations please see the chapter 3 3 2 Configurations The first column of the table data contains the name of the currently selected target CPU for each configuration To choose a different target CPU use the pop up menu available a
108. f CPU2 have the same function in the project They are both associated with Bean1 TimerOut Every time you change the Target CPU from CPU1 to CPU2 and vice versa you need to modify in the Bean Inspector the name of the peripheral linked to the TimerOut bean To avoid this you can rename Timer0 and TmrA to one common name MyTimer and link the bean Bean1 to the MyTimer peripheral Now when CPU1 will be set active selected as target CPU Bean1 will be Application Design linked to Timer0 and when CPU2 will be set active Bean will be linked to TmrA How to Edit CPU Peripheral Names Follow these steps e Select a peripheral type in order to display all the CPU peripherals of this type e Inthe Name edit box insert a new name for the selected CPU peripheral Note If you want to get back the default catalogue name press the left arrow button Press the OK button e Answer the confirmation request of the dialog box Peripheral names editor of DEMOCPU11 Cpu Name ADC _ lt aoc Hint JAD converter device encapsulation CPU peripherals Combined 6bitPort01 Combined 6bitPort23 Peripheral type vIr OSOS Meare ec I gt gt I gt I gt I gt I gt I gt I gt 22229222W wD N e wN al OO P10_4D8_48 P11_AD9 49 P17_4D15_415 C 10 Pins C 10 Ports Timers Watchdogs C Converters Communication Ester Interrupts Restore default a Cancel x E T a
109. following chapter Speed Modes e and all other functions which are not directly encapsulated by beans 3 2 2 2 Speed Modes Support The CPU bean supports up to three different speed modes The three speed modes are a Processor Expert specific concept which among all the other PE features and concepts ensures the portability of the PE projects between different CPU models In fact the 3 speed modes are a generalization of all the possible CPU clock speed modes used for power saving that can be found in most of modern microcontrollers In the area of embedded systems power saving and power management functions are so important that we could not neglect the proper HW independent software implementation of these functions Therefore for keeping the portability HW independence of PE projects we recommend not to program the CPU speed functions manually but use these 3 CPU Bean speed modes instead e 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 CPU clock e Low speed mode this mode is usually used for another PLL or main prescaler settings of the main CPU clock Slow speed mode this mode is usually used for the slowest possible mode of the main CPU clock Switching Speed Modes at Runtime The modes can be switched in the runtime by the following CPU bean methods SetHighSpeed SetLowSpeed and SetSlowSpeed If a speed mode is enabled
110. fter the right mouse button click on the appropriate cell Next columns represent the beans in the project Each field in the beans columns contains a Y if the bean is enabled or N if the bean is disabled in the specific configuration To change the value of the field from Y to N or vice versa double click the field with the left button 30 Processor Expert User s manual User Interface P Taget CPU Prin ADC PIZini TMA PISin PWM ADTADG Cpu 56F8346 N N CpuseFe34e Cpu 56F8346 Cpu 56F8346 Cpu 56F8346 Cpu 56F8346 lt lt lt lt lt lt lt lt lt x lt lt lt lt lt lt lt lt lt q x lt x lt x lt Y Configurations Editor Use double click to Lv ox _ 2 Heb enable disable selected bean Use right i x Cancel 2 3 3 CPUs Pop up Menus CPUs Folder Pop up Menu This menu is opened by right clicking on the CPUs folder icon in the Project panel It proposes a set of commands to manage CPUs folder Following commands are available e Expand Collapse expands collapses one level of the folder s tree Expand all completely expands the folder s tree e Collapse all completely collapses the folder s tree Change folder name edit the subfolder name e Delete folder deletes the subfolder and all its contents e Delete all beans deletes all the contents of the folder e Add subfolder creates a new subfolder e Help Displays re
111. g list sj e Time Date Allows to setup the Time Date in a format according to the operating system settings v Time 0 00 00 v Date 1 1 2001 e Timing settings Allows a comfortable setting of the bean s timing The timing dialog box gets opened when clicking on E See chapter 2 5 3 1 Dialog Box for Timing Settings for details Interrupt period 1100 ms sa high 100 ms 2 5 2 Items Visibility Processor Expert supports selectable visibility of bean 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 Bean 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 key items that have no default value and must be set for each bean for example peripherals To view these items select command Inspector Items Visibility Basic view e Advanced view key items that should be set or that are usually set including necessary items To view these items select command Inspector Items Visibility Advanced view e Expert view maximum visibility level All items that can be changed including rarely used items To view these items select command Inspector Items Visibility Ex
112. ge 136 Processor Expert User s manual Processor Expert Tutorials Bean Inspector Button ExtInt 0 x lt Bean Items Visibility Help Z Beannane Baton Pin PRO KWHO MISO1 y PHO KWHO_MISO1 Pinson AAA AAA Interrupt priority medium priority El Initialization O OO Enabledininit code yes 9 BASIC l ADVANCED EXPERT da 15 Click on the Methods TAB and set all methods to don t generate 16 Click the Change bean icon item of the Bean menu in order to choose a new icon in the list Select the KEY icon and click the OK button You can see in the Target CPU window which pins of the chip are handled by the beans You can easily identify LED beans by their specific icons If the Target CPU window is not opened use menu command Processor Expert View Target CPU package Target CPU Cpu MC9512DP256BCPY A TARAP fora OPCounter COPCounter none watchdog counter YA After adding all beans click Processor Expert View Resource Meter in order to open the Resource Meter window and see remaining available resources of the chip 137 Processor Expert User s manual Processor Expert Tutorials PET Pinsusage MM ts S Port usage WE i a Compare regs Captureregs P i7 i A D channels 0 Next step Go to Step 3 Code Generation 4 2 3 Tutorial for Freescale HCS12 Project 2 Step 3 Code Generation 1 Click on the command Processor expert Generate C
113. he Timing Dialog that specifies the allowed difference between the required value and possible value that can be produced by the hardware e Settings for the device are mutually incompatible or can t be used with another device In this case the problem is reported by all beans that share some timing hardware Due to dependencies between used parts of the timer there might be necessary to adjust the values of the shared elements like prescalers to the same value For example if two TimerInt beans 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 beans to the same value switch to Expert view mode and adjust the property in the Bean Inspector window Structure of the current target CPU timing model can be viewed by using the CPU Timing Model window e The Runtime setting from interval is selected and it is not possible to set the values The required run time settings are outside the range of one prescaler This is a limitation of this mode of 100 Processor Expert User s manual Application Design runtime setting Please see the text below in this chapter Run time Timing Settings Limitation Some beans allow to change the timing at run time by switching among several predefined values or by setting a value from given interval
114. he context of the LED controller you will add two BitIO beans for the Red LED and the Green LED and an ExtInt bean for the Button 1 Tf the Bean Selector window is not already opened open it using menu Processor Expert View Bean Selector 2 Double click the BitIO bean in the folder Portl O subfolder of CPU Internal Peripherals folder in the Bean selector window 133 Processor Expert User s manual Processor Expert Tutorials lox Bean Categories On Chip Peripherals Quick help gt 5 CPU extemal devices E amp CPU intemal peripherals amp Communication amp Converter amp Interrupts Measurement amp Memory E Port 140 s0 Bisio S M Byte210 A os Filter all CPU Licensed 3 If you will be asked whether to enable the bean in all configurations Choose Yes This dialog box could be enabled or disabled in environment options 4 New bean is added to the project Switch to Processor Expert project tab in codewarrior s project panel See picture below Don t worry about red exclamation mark beside a new bean It means that error is present bean has not been set up properly yet xx LED mcp l 0 Simulator B Y A A gt Files Link Order Targets Processor Expert EL Configurations lt amp 112pin ES CPUs MIES ES Beans z Bir Bito 2 Documentation x E gt PESL 2DP256BCP 5 Open the Bean Inspector window by double click on the new bean Bit
115. he inactive branches have the gray cross icons for an inactive branch example please see the RTIJoin prescaler on the figure below join of multiple clock sources The values of all prescalers are for high speed mode For details on speed modes please see the chapter 3 2 2 2 Speed Modes Support More details on individual items are available as hints after the mouse cursor is placed on the item s name The displayed prescaler values are automatically set after the reset for enabled devices The values are influenced by the beans configuration For details on the bean timing principles please see the chapter 3 3 4 Timing Settings Some nodes contain a frequency information It is a clock frequency on the node output 59 Processor Expert User s manual User Interface Clock Path Direction It is possible to change the direction of the timing path This can be set by switching the CLOCK field value From CPU clock source to individual peripherals The prescalers and clock driven CPU devices are ordered in a tree structure starting with the main branch which represents the main clock source PLL X tal etc Cpu Timing Model Cpu MC9508GB60CFU xi CLOCK from CPU clock source y er yCPU BSOCFU E CPU Source Clock 1 gt 8MHz Ei ClockDiv1 XtalCk gt 4MHz E RTlJoin clock xtalClk E Y ATI presc not set Y counter overflow ATlfree E IntOsc gt 0 032MHz E RTWoin clock XtalCik E RTI presc not set x cou
116. his option is also supported for devices working in several modes in the CPU block diagram A list of represented devices for these modes is displayed e Show Peripheral Usage shows which part of the peripheral is used by the application visible after code generation This option is supported for I O ports and pins timers A D converters and A D channels CAN serial ports watchdog internal memories EEPROM and FLASH See chapter 2 14 Peripherals Usage for details e Rename Peripheral allows you to rename the selected peripheral It is supported for I O ports and pins watchdog and timers counters compare and capture registers free running devices A D converters and A D channels CAN serial ports e Search Related Info In CPU PDF Documentation displays PDF Search window and finds the information about the peripheral in the appropriate CPU documentation It is also possible to search for any keyword in the CPU documentation based on the original manufacturer s CPU manual This item is available on the package and on the CPU block only See chapter 2 16 PDF Search for details e Add Bean Template adds a bean or template for the appropriate peripheral all available beans and templates suitable for the selected peripheral are listed The beans and templates in the list are divided by a horizontal line It is possible to add only beans or templates which are applicable for the peripheral It means that is possible to add the bean or tem
117. hosen value Clicking the arrow icon 1 will show a list of the possible values of the property Clicking the sign will show hide the items in the group but doesn t influence value nor validity of the items El Initialize unused 120 pins linput y Pull resistor no initialization y Open drain no initialization v Dutput value no initialization E e File Directory Selection allows to specify a file or directory Clicking the E icon will open a system dialog window allowing to choose a file directory File name D text dat external file e Group A list of items which 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 El Initialization Integer Number The user can insert a number of a selected radix Radix of the number could be switched using the icons Bl HB 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 v Size FF5C Hj Link to inherited bean The arrow icon 21 switches the inspector to the ancestor bean that is inherited by the current bean The down arrow button Yl allows to change the ancestor from the list of possible ancestor See chapter 3 3 7 Bean Inheritance and Bean Sharing for details gt As AsynchroForl gt e Link to shared bean
118. how the memory allocated by a bean or compiler The address axis within one memory block goes from the left side to the right i e the left side means start of the block the right side means the end OO1FFF 001000 Figure 2 41 Sample Of Used Part Of The Memory Area Mouse Actions If you move the mouse pointer to any part of the CPU address space a detailed description of the chosen part will be displayed in the hint Double click on the used line crossed memory area will open the CPU bean inspector window with the selected definition for this area same as the Edit Usage pop up menu command Pop up Menu e Edit Usage opens a Bean Inspector window that allows to customize the memory setup for the selected area This command is available only for used areas line crossed e Display Mode Full displays all items Only Memory displays only Flash RAM and ROM e Summary displays window with summary of memory usage percentage and absolute view e Help shows this page 62 Processor Expert User s manual User Interface Memory Map DEMOCPU11 3 FFFE 8000 OFFF 0300 D2FF 0100 OOFF 0000 Figure 2 42 Sample Memory Map Window 2 11 CPU Parameters Overview Processor Expert View CPU Parameters Overview You may get the technical features of a CPU by selecting the CPU Parameters Overview command of the View menu The complete database then appears together with a query wind
119. iew mode This documentation can be found in the Documentation folder of the Project Panel See chapter 3 3 6 Signal Names for details e XML documentation containing the project information and settings of all beans in XML format The generated file projectname _Settings xml can be found in the Documentation folder of the Project Panel It is updated after each successful code generation e Shared modules with shared code the code which is called from several beans Complete list of generated shared modules depends on selected CPU 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 10_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 PE_Const h Definition of the constants speed modes reset reasons This file is included in every driver of the bean PE_Types h Definition of the C types bool byte word This file is included in every driver of the bean PE_Error h Common error codes This file contains definition of return error codes of bean s methods See the generated module for detailed description of the error codes This file is included in every driver of the bean PE_Timer This file contains shared procedures for runtime support of ca
120. ile generated by the bean with a previously generated one The user can use this function to easily track his her changes made in the generated code The both commands are available only when the Preserve User Changes option is switched See chapter 2 1 1 Processor Expert Options for details The bean has to be setup to Preserve User Changed in Generated Bean Modules or Don t Write Generated Bean Modules mode in this pop up menu An internal file editor in read only comparison mode is used to show the files differences See chapter 2 15 File Editor for details e Rename Bean allows you to give a project specific name to the selected bean e View Source displays the generated module of the bean in File editor e View Edit Event Module displays the generated events module of the bean in the File editor e Restore Default Template Settings restores default template settings All old settings will be lost e Customize this bean template saves the selected bean as a template e Disconnect Bean From CPU removes the link s between the bean and the associated CPU peripheral s it clears the corresponding properties of the bean e Remove Bean From Project removes the selected bean from the current project e Copy to Clipboard bean with its settings is copied to the clipboard e Help displays documentation 33 Processor Expert User s manual User Interface Methods and Events This menu is opened by right clicking on
121. ime 56800E Lib 0 0 a AS Runtime 568006 n a n a a e EE Startup Code 0 0 ai Ye A DSP5E5F836_ init asm 0 0 e aj Y E Generated Code 0 O a Y 7 0 0 m Y M Cap1 C 0 Oe a Y MM Capture CMD n a nia a Y MM Vectors c 0 0 mz 14 files 0 0 Lo Figure 1 2 CodeWarrior project panel 1 2 Benefits of Embedded Beans and Processor Expert Technology The key benefit of Embedded Beans is the same as using components in software design environments like Microsoft Visual Basic or Borland Delphi In comparison with components used within these products Embedded Beans provide hardware encapsulation in the form of a platform independent standard Different players in the embedded market should benefit from such a standardization approach Microprocessor producers Each year microprocessor producers introduce many new microprocessor families or derivatives As the complexity of microprocessors increases programmers must handle more and more registers to get the required functionality Classical development tools usually do not support the rapid prototyping phase of design and classical programming languages are not able to efficiently describe the on chip peripherals structure On the other hand microprocessor producers need to speed up the learning design and coding processes for their customers For the designer Processor Expert and its configuration and code generation features completely eliminate the necessity to be otherwise preoccupied wi
122. in the CPU Bean properties the corresponding method will be enabled automatically 91 Processor Expert User s manual Application Design Speed Modes Support in Beans Using the bean property CPU clock speed selection it is possible to define the speed modes supported by the bean Some beans allow to set two values of the CPU clock speed selection property e Supported the CPU clock speed selection group contains properties defining which speed modes are supported for the bean e Ignored the speed mode settings are ignored and there are no operations done when a speed mode is changed i e the peripheral continues to run with the same configuration for all speed modes No speed mode handling code is generated for this bean The bean timing values are valid for for high speed mode only The following feature are are available for high level beans if the CPU clock speed selection is not set to ignored e During the design all the timing related settings for such a bean are checked to be correct in all the speed modes that the bean supports and is enabled in e If the speed mode is changed the current timing beans will be preserved recalculated to be the same in the new speed mode except the timing which is set at runtime from interval If the CPU speed mode is changed to a mode which the bean does not support for any reason the bean will be disabled right after the CPU speed mode is changed Otherwise the bean will be ena
123. ing of input pin signal without any previous pin initialization The feature can be used only if the pin port contains RAW DATA register which allows reading the input pin signal in any settings of related peripherals See the bean documentation for more details Sharing Pins Among Peripherals Notice This feature is not available in this version Some CPUs allows some pins to be used by multiple peripherals This may lead to a need of sharing pin s by multiple beans Normally if the user selects one pin in more than one bean there is a conflict reported However is possible to setup a sharing for such pin in the bean inspector One of the beans sharing a pin has to be chosen as a main bean This bean will initialize the pin In the properties of other beans that use the pin the pin has to be marked as shared by pressing the sharing icon on the right side see the picture below Pin sharing can be set in the bean inspector The bean inspector must be switched into EXPERT view mode and then the pin sharing button must be pressed down See picture button at the right side of the second column IT He RxD GPIOBE_AXDO_5DA_CLKIN PX IGPIOBE AXDO 5DA_CLKIN Figure 3 13 Pin Sharing Button Pin sharing is advanced usage of the CPU peripherals and should be done only by skilled users Pin sharing allows advanced usage of the pins even on small CPU packages and allows application specific usage of the pins ConnectPin Method
124. input file for redirection REDOUT full path name of output file for redirection REDERR full path name of error file for redirection IN DIR directory of input file is a number of input file from interval 0 9 IN NAM name of input file is a number of input file from interval 0 9 IN EXT extension of input file is a number of input file from interval 0 9 IN PTH full path name of input file is a number of input file from interval 0 9 OUTDIR directory of output file OUTNAM name of output file OUTEXT extension of output file OUTPTH full path name of output file DRIVERS FORMAT list of the all generated drivers EVENTS FORMAT list of all generated event modules SHARED FORMAT list of all generated shared modules 2 2 Help and Manuals Help Processor Expert gt The following items are available within this menu Processor Expert Help the start page of the Processor Expert plug in help Concepts introduction to Processor Expert concepts Benefits who Processor Expert may benefit User Interface description of Processor Expert plug in environment Tutorial tutorial course Quick Start how to start with Processor Expert plug in Embedded Beans index page of the Embedded Beans documentation Bean Categories index page of the Embedded Beans Categories Supported CPUs Compilers and Debuggers list of CPUs Compilers Debuggers supported in the current version of Pr
125. ion If you create a new configuration the current project state is memorized Configurations of the current project are listed in the Project Panel configurations folder They can be managed using a pop up menu of the specific configuration or the whole Configurations folder Configuration properties and a user comment can be changed in the configuration inspector See chapter 2 5 4 Configuration Inspector for details The symbol for conditional compilation is defined if it is supported by selected language compiler The symbol PEcfg_ ConfigurationName is defined in the CPU interface The user can switch using this symbol between variants of code according to the active configuration see example in this chapter Configuration also stores which CPU is selected as the target CPU If the name of the configuration matches the name of one of the CodeWarrior s targets this target is automatically selected as an active target when the user runs code generation Note It is possible to have two beans with the same name in Project Each of the beans could be enabled in different configuration This way the user can have different setup of a bean a bean with the same name in multiple configurations Example Let s have a configuration named Testing case We would like to use a bean and part of our code using the bean only in the Testing case configuration We make the Testing case configuration active After the successful code generatio
126. ion of an Interrupt Service Routine ISR name using the JSR name property is required This name is generated to Interrupt Vector table during the code generation process See chapter 3 3 1 1 Interrupt Vector Table for details Please notice that if the ISR name is filled it is generated into the Interrupt Vector Table even if the interrupt property is disabled El Interrupts El Reload PWM Interrupt INT_PwmM_Reload INT_PWM_Reload Reload interrupt Enabled Reload interrupt priority medium priority 1 ISR name Figure 3 20 Example Of The Interrupt Setup 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 Beans 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 Declarations of the ISRs that already do not exist can be generated automatically by PE during the code generation process into the Event module of the CPU bean name of the CPU event module could be changed in the Advanced view mode of the Bean Inspector if the project option Project Options Generate ISR is enabled this option is visible in the Advanced level of view 3 5 4 User Changes in Generated Code It s necessary to say at the beginning of the chapter that modifica
127. ipheral schematic and both of them using registers schematic and both buttons Schematic and both buttons are present only when the schematic for the current peripheral is provided Schematic diagram of the peripheral contains names of the control registers Highlighting of changes of a related bean settings works also in the schematic mode e If the user places mouse cursor on the register name the hint containing register description and address is shown e When the user clicks the register name with the left mouse button new dialog window containing detailed information including initialization value for the register is shown The register bits affected by a changes are highlighted 69 Processor Expert User s manual User Interface Peripheral Initialization GPIOA x View Help Test GPIO_4_DR Peripheral Data Cut Peripheral Data In Jeripheral Figure 2 49 Schematic Diagram of the Peripheral 2 14 Peripherals Usage Processor Expert View Peripherals Usage The Peripheral Usage window shows the current status of on chip peripherals usage in detail The names of the beans using peripherals appear in the third column next to the corresponding peripheral names When the mouse is placed over a peripheral name a short description of the peripheral appears as a hint Note that if a peripheral is allocated all its parts are reserved For example if you use the 8 bit I O port all the T O pins
128. ker dialog is invoked during the code generation allowing the user to switch the linker settings How to Change CPU Settings The only way to modify CPU settings properties methods events chip selects timing user reserved peripherals also compiler and debugger settings etc is to invoke the Bean Inspector for the selected CPU You can do that with the following steps assuming that the CPU is included in the project Command in CPU pop up menu a Move the mouse pointer to the CPU icon in the Project panel b Click with the right mouse button a popup menu will appear c Click CPU inspector the CPU Bean Inspector will appear e Or use double click on the CPU icon in the Project panel 90 Processor Expert User s manual Application Design Look at the given CPU help page to learn about what each feature and setting means For a detailed description of the current CPU properties methods and events select Bean Inspector Help Help on Bean in Bean Inspector 3 2 2 1 CPU Properties Overview CPU Properties can be set in CPU Bean Inspector The complete list of CPU properties and its description is available in the help page for the CPU Bean Inspector Help Help on Bean Settings of these properties define the basic settings of the CPU e CPU type e external Xtal frequency and sub clock xtal frequency e PLL settings e initialization interrupt priority e external bus and signals e speed modes See the
129. kward compatibility value of the IN PTH macro See chapter 2 1 2 1 Tools Setup Macros for details There is no warranty that these items will be supported in the next version of Processor Expert 20 Processor Expert User s manual e Comment any text describing the tool User Interface e Wait for application termination Processor Expert waits for application termination before executing any other operation it has the advantage of reserving the error window for the application Redirection of application output Processor Expert captures the standard output of the application and displays errors in the Message Window Input file name of the input file for the application If you don t specify any a temporary file will be created Output file name of the file for the redirection of the application output If you don t specify any a temporary file will be created Error output name of the file for the redirection of the application error output If you don t specify any a temporary file will be created Hint format format of the hint messages Warning format format of the warning messages Error format format of the error messages Fatal error format format of the fatal error messages Exitcode lt gt 0 defines the action that will be done when the exit code of the application will not be zero The following actions are possible Ignore no action Display error
130. l items from a pe file containing exported objects or whole project Export Exports selected objects in the project panel to the file Help displays documentation 32 Processor Expert User s manual User Interface Bean Pop up Menu This menu is opened by clicking right mouse button on the icon of the bean from the beans folder of the Project panel Following commands are available e Bean inspector opens the Bean inspector of the bean Detailed help concerning the Bean Inspector items can be found in the bean s page of Processor Expert help e Bean enabled if checked the selected bean is enabled included in project e Code generation allows to individually specify how the and user changes and code generation for the bean are handled by Processor Expert See chapter 3 5 4 User Changes in Generated Code for details Always Write Generated Bean Modules default generated bean modules are always written to disk and any existing previous module is overwritten Preserve User Changed in Generated Bean Modules smart detection of user changes Notice Smart user changes preservation is not available in this version Don t Write Generated Bean Modules the code from bean is not generated Any initialization code of the bean which resides in the CPU bean interrupt vector table and shared modules are updated Compare with Previously Generated Module Compare with Previously Generated Header Module compares a f
131. lated information for currently selected bean or method If there is nothing selected this help page for Project Panel is displayed CPU Pop up Menu This menu is opened by right clicking on a CPU icon in the CPUs folder in the Project Panel Following commands are available e CPU inspector opens the CPU s Bean inspector Detailed help concerning the Bean Inspector items can be found in the CPU s page of Processor Expert help see Processor Expert Help Supported CPUs and Compilers page e Select CPU as Target if several CPUs are in the current project it sets the CPU as target the CPU will appear on the Target CPU window and the code will be generated with the Project options of active target 31 Processor Expert User s manual User Interface Rename CPU allows you to give a project specific name to the selected CPU CPU Peripherals Names opens the CPU peripherals names editor View Target CPU Package opens the Target CPU window in Package view View Target CPU Block Diagram opens the Target CPU window in Block Diagram view View CPU Timing Model displays the CPU Timing Model window View Memory Map displays the Memory map window This window shows the CPU address Space and internal and external memory mapping Search in PDF Documentation displays the PDF Search window The window allows a full text search in the original CPU manufacturer s documentation See chapter 2 16 PDF Search for details View Sourc
132. lculations of timing constants startupfile c This external module visible in the External Modules folder of the Project Panel 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 datils on the use of the startupfile during the reset see chapter 3 4 1 Reset Scenario with PE See also chapter Predefined types macros and constants 113 Processor Expert User s manual Application Design 3 5 1 1 Linker Dialog The code generation process checks the setting of the selected target If the selected CPU doesn t match a valid setting of the linker for the current Code Warrior target the code generation process displays the following dialog Processor Expert Question x The Processor Expert CPU doesn t match the project linker setting What do you want to do with the target linker Leave the current setting Set the linker as Linker for HCOS Create new target ProcessorE xpertT arget Help See help for details Figure 3 15 Linker Dialog Following options are available e Leave the current setting generate files to the current selected target without a change of the linker e Second option automatically sets the linker setting according to the selected CPU including linker settings e Create new target creates a new target and sets the linker and linker settings according to the selected CPU
133. lders Collapse all collapses the folder and all its subfolders e Help Help displays documentation Peripheral Usage xi View Help i Timers Channels Pin2 ADDR12_GPI08 Pin3 ADDR13_GPIO9 Pind ADDR14_GPIO10 Pin5 ADDR15_GPIO11 Pin6 ADDR16_GPIO12 Pin ADDR17_GPIO13 Ping E Pin ADDR11_GPIO7 Figure 2 50 Peripheral Usage Window 2 15 File Editor About File Editor File editor is the Processor Expert internal editor allowing to Edit files All common text editor functions are available for comfortable work with the source code View files Editor is opened in a read only mode it s shown in the title of the window Compare files A visual file comparison mode with two panels showing a differences between two files Notice The Edit and View modes of the internal editor are not used in the Code Warrior plugin Internal editor is for these operations fully replaced by the native Code Warrior source code editor 71 Processor Expert User s manual User Interface Meaning of Buttons a Switches between module Extensions switch between assembler implementation of the driver and header file of the module or implementation body file of the module Note it is available only if it is allowed in the Editor Options S Open file opens a file CJ Save file saves the currently displayed file e 5 Save all saves all opened files if they were edited e E Close file closes
134. led after initialization of the CPU from the CPU module By default this function is generated empty without any reasonable code It is designed so that the user will write his her own particular 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 The event module contains all events selected in the beans By default these event handler routines are generated empty without any meaningful code It is considered that user will write his her own particular code here Event module can also contain the generated ISRs for the beans that require a direct interrupt handling Peripheral Initialization Beans Generation of the ISRs is controlled by the project option Project Options Generate ISR Note It is possible to change a name of the event module in ADVANCED view mode of the Bean Inspector e Method list file with description of all beans methods and events generated from your project The name of the file is projectname txt or 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 or projectname _SIGNALS doc with a list of all used 112 Processor Expert User s manual Application Design signal names The signal name can be assigned to an allocated pin in the bean properties available in ADVANCED v
135. licking on numbers in this listing invokes the appropriate page in the Adobe Acrobat Reader panel Unfortunately Acrobat Reader does not permit highlighting of any text results found on the page You may find on the page using the Acrobat Reader Find function see Acrobat Reader toolbar e The Acrobat Reader or Adobe Reader panel shows PDF file content This panel has it s own toolbar which allows you to browse within the PDF file This panel has also an internal Find function which is useful for locating searched phrase on the page Using the toolbar you can print move and zoom in or out on the document More documentation about controlling the Acrobat Reader plug in can be found in Adobe Acrobat Reader documentation Additional Switches e Case sensitive If this switch is enabled all letters of searched text must exactly match the text in the document including its case If the switch is disabled the case of the letters is ignored e Regular expressions If this switch is enabled the text entered as a searched phrase is treated as a regular expression Users can use a power of regular expressions For example it allows using a logical or set operators etc The syntax of regular expressions is a subset of commonly used Perl regular expressions You can find more information on regular expressions and their syntax in chapter 2 16 1 Regular Expressions Our search technology uses the PdfToText program included in XPDF package This p
136. located on chip peripherals and pins Processor Expert generates a ready to use source code initializing all on chip peripherals used by the bean according to the bean setup 1 5 Terms and Definitions Used in Processor Expert Bean An Embedded Bean is a component that can be used in Processor Expert Embedded Beans encapsulate the functionality of basic elements of embedded systems like CPU core CPU on chip peripherals standalone peripherals virtual devices and pure software algorithms and wrap these facilities to properties methods and events like objects in OOP Beans can support several languages ASM ANSI C Modula and others and the code is generated for the selected language Bean Inspector window with all parameters of a selected bean properties methods events Bus clock A main internal clock of the CPU Most of the CPU timing is derived from this value CPU Bean bean which encapsulates the CPU core initialization and control This bean also holds a group of settings related to the compilation and linking Stack size Memory mapping linker settings etc Only one CPU bean can be set active as the target CPU See chapter 3 2 2 CPU Beans for details Bean Driver Bean 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 bean settings A Bean can use one or more drivers Counte
137. manual User Interface Runtime setting configuration Note Runtime setting cannot be selected in the BASIC view mode Runtime setting type selection determines how the timing setting can be modified at runtime The following options are available e fixed value the timing cannot be changed at runtime e from a list of values allows to change the timing by selecting one of predefined values from the list using bean method SetXXXMode This method sets the values s corresponding to the selected timing into 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 means that there must be possible to set all values within the interval by using the same prescaler Please 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 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
138. more beans 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 beans 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 CPU bean for special settings BitIO BitsIO ByteIO Byte2IO Byte3IO Byte4IO 110 Processor Expert User s manual Application Design The GetVal and GetDir methods are always implemented as macros LongloO This bean could not be implemented on Freescale HCS12 this CPU 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 SetWord 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 bean and SPI device automatically inside interrupt service if interrupt service is enabled
139. n 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 3 5 3 Typical Usage of the Bean in the User Code This chapter describes usage of methods and events that are defined in most hardware beans Usage of other bean specific methods is described in the bean documentation in the section Typical Usage if supported In the following examples please assume a bean named B1 Peripheral Initialization Beans Peripheral Initialization Beans are the beans of the lowest level of peripheral abstraction These beans contain only one method Init providing the initialization of the used peripheral See chapter 3 5 3 1 Typical Usage of Peripheral Initialization Beans for details Methods Enable Disable Most of the hardware beans support the methods Enable and Disable These methods enable or disable peripheral functionality which causes disabling of functionality of the bean as well Hint Disabling of the peripheral functionality may save CPU resources Overview of the method behavior according to the bean type Timer beans timer counter is stopped if it is not shared with another bean If the timer is shared the interrupt may
140. n Inspector Events Tab Writing an Event Handler Event handler is a subroutine that is assigned to a specific event After the event is enabled Processor Expert generates the empty function of the specified name to the Event module See chapter 3 5 1 Code Generation for details The user can directly open the Event code when it already exists using a Bean pop up menu View Edit event module or a double click on the event within a Project Panel It is an ordinary function and the user needs not to provide the interrupt handling specific code in his her event code Interrupt Service Routines When High or Low level beans are used the interrupts functionality is covered by the events of the beans The interrupt subroutines calling the user s event handlers are generated to the bean modules and PE provides parts of the background code necessary to correctly handle the interrupt requests The Peripheral Initialization beans can only provide the initialization of the interrupt and generate a record to the Interrupt Vector Table The user has to provide a full implementation of the interrupt subroutine See chapter 3 5 3 1 Typical Usage of Peripheral Initialization Beans for details 95 Processor Expert User s manual Application Design 3 3 1 1 Interrupt Vector Table An interrupt vector is a pointer to an interrupt handling subroutine An Interrupt Vector Table IVT is a table list which contains single interrupt vectors Each interrupt
141. n by this dialog Selecting an update package will show a window with detailed update description The dialog is for information only and no action is done with the selected file 2 3 Project Panel Processor Expert View Project Panel Processor Expert Project Panel is a tab in CodeWarrior s project window panel When the Project Panel is noticed in Processor Expert documentation the Processor Expert Project Panel is understood xx test mcp 0 sdm external memory B Y lt B gt Files Link Order Targets Processor Expert Figure 2 4 Processor Expert tab The Project panel shows the application components e Configurations of the project e Operating System Beans related to operating system used by the application if there is some operating system present e CPUs CPU beans included in the project Embedded Beans included in the project Every bean inserted in the project is displayed in the project panel and has a subtree showing Methods Methods allow runtime control of the bean s functionality Event routines Events allow handling of the hardware or software events related to the bean If the event is disabled the name of the event is shown For enabled events the name of the handling function 1s shown Initialization code items Part of the initialization code that can must be modified by the user ISRs represent bean related interrupt routines that can be creat
142. n that inherits uses another bean s e Shared Ancestor is a bean that can be used and shared by multiple beans Inheritance Inheritance means that an ancestor bean is used only by the descendant bean Inheritance is supported in order to allow beans to access peripherals by hardware independent interface of the ancestor beans For example a bean that emulates a simple I2C transmitter may inherit two BitIO beans for generation of an output signal On several complex beans for example some MPC5500 Peripheral Initialization beans inheritance is used to separate bean settings into several logical parts for example settings of channel is inherited in the bean with settings of the main peripheral module Settings in Processor Expert The Descendant bean contains a property which allows selecting an ancestor bean from a predefined list of templates The bean is created after selection of an appropriate template name or bean name from the list of the templates fitting the specified interface Any previously used ancestor bean is discarded gt Communication interface FPGAI2CMasterPolling y gt Memory type FPGA amp I2CM aster nterrupt n FPGA 2CM asterPolline i Voltage operation Y xj gt Saree eerie Figure 3 9 Example of selecting from available ancestor beans Press the 2 button to edit properties methods or events of a selected ancestor bean in the Bean Inspector Processor Expert allows
143. n the CPU H file contains the following definition Active configuration define symbol define PEcfg_Testingcase 1 We will surround the part of the code used only in this configuration the following way ifdef PEcfg_TestingCase Bean_MethodCall endif 98 Processor Expert User s manual Application Design 3 3 3 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 Error Window or directly in the third column of the Bean Inspector on the faulty items line Sometimes it may happen that only one small change in the project causes several general error messages The most common reasons for this behavior are stated below On Chip Peripherals Some beans use on chip peripherals In the Bean Inspector you can choose from all possible peripherals that can be used for implementation of the function of the current bean 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 beans If the peripheral is allocated for one bean then the settings of this peripheral cannot be changed by any other bean The state of an allocated peripheral should never be changed directly in the user code Using special registers I O
144. nabled 15 x The following files will be deleted because they are not used These files were generated during previous code generation Y CODESBit H Y CODE Bt21 C Y CODE Bt21 H AN None ZER X Conca Figure 3 19 List of unused files 116 Processor Expert User s manual Application Design 3 5 2 Predefined Types Macros and Constants Processor Expert generates definitions of all hardware register structures to the file IO_Map h The Processor Expert type definitions are generated to the file PE_Types h containing also definitions of macros used for a peripheral register access See chapter 3 7 2 Direct Access to Peripheral Registers for details Boolean value unsigned char TRUE any non zero value all FALSE 0 16 bit unsigned integer unsigned int all 32 bit unsigned integer unsigned long all array of two 32 bit unsigned integers unsigned long all Structure for images typedef struct Black amp White Image word width Image width word height Image height byte pixmap Image pixel bitmap word size Image size y char name Image name TIMAGE typedef TIMAGE PIMAGE Pointer to image Structure for 16 bit register 16 bit register big endian format typedef union word w struct byte high low b TWREG 117 Processor Expert User s manual Macros DI F a EnterCritical ExitCri
145. nges in the behavior of the application with an instant rebuild e Supports interfacing of CodeWarrior 1 4 Concepts The main task of Processor Expert is to manage CPU and other hardware resources and to allow virtual prototyping and design Code generation from beans the ability to maintain user and generated code and an event based structure significantly reduce the programming effort in comparison with classic tools Embedded Beans Component bean is the essential encapsulation of functionality For instance the TimerInt bean encapsulates all CPU resources that provide timing and hardware interrupts on the CPU Processor Expert User s manual Timing Interrupt period Eg Bean Inspector TI1 TimerInt zigiz Bean Items Visibility Help lt gt Peripheral Initialization gt Properties Methods Events Comment v Bean name TI Timer TMR40_Compare w TMR40_Compare TMRAD El Interrupt service event Enabled Intemupt INT_TMRAO _ INT_TMRAO 1 not set Y Interuptperiod Unassigned timing Beanusesentiretimer no Y El Initialization Oooo Enabledininit code pes Y Events enabled in init yes y BASIC l ADVANCED EXPERT Prescalers Req value High speed mode Low speed mode Slow speed mode Adjusted values Prescaler Auto select f Auto select Auto select high 16 Runtime setting type fired value Value type Value Unit Tnit value ms Possible settings
146. not possible to enter an address in internal RAM The bits can also allocate memory Therefore you can be sure that only one bean uses an allocated bit of a register in external address space Timing The settings of all timed high level beans are checked using the internal timing model See chapter 3 3 4 Timing Settings 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 beans so the settings shall work according to the configuration 99 Processor Expert User s manual Application Design 3 3 4 Timing Settings Many high level beans contain a timing configuration e g speed of the serial communication period of the interrupt conversion time of the ADC etc Processor Expert allows to configure such timing using user friendly units and it also contains a model of the complete MCU timing which allows to calculate the required values of control registers and it also allows a continuous validation of the timing settings Timing Model A bean timing can be viewed like a chain of elements dividers multipliers etc between the main clock source and the device configured by the bean The user sets the desired timing value using the Timing Dialog see chapter 2 5 3 1 Dialog Box for Timing Settings or directly by specifying the value in Bean Inspector see chapter 2 5 3 2 Syntax for the Timing Setup in the Bean Inspector Processor
147. ns the peripheral s structure view it is supported for I O ports timer s counters serial ports It is also supported for devices working in several modes in the CPU block diagram A list of represented devices for these modes is displayed Rename Peripheral allows the user to rename the selected peripheral It is supported for I O ports and pins watchdog and timers counters compare and capture registers free running devices A D converters and A D channels CAN serial ports See details for renaming peripherals Show Peripheral Usage shows which part of the peripheral is used by the application visible after code generation It is supported for I O ports and pins timers A D converters and A D channels CAN serial ports watchdog internal memories EEPROM and FLASH See chapter 2 14 Peripherals Usage for details Show Peripheral Initialization shows initialization values of all control status and data registers It is supported for all devices displayed on CPU package See chapter 2 13 Peripheral Initialization for details Search Related Info in CPU PDF Documentation displays the PDF Search window and finds information about the peripheral in the appropriate CPU documentation It is for possible to search for any keyword in the CPU documentation based on the original manufacturer s CPU manual This item is available on the package and on the CPU block only See chapter 2 16 PDF Search for details View CPU Block Diagram di
148. nter overflow RTIfree EE Clkdiv 1 gt 8MHz E BusClockPresc 2 gt 4MHz menam nal Figure 2 38 CPU Timing Model Window e From selected peripheral to CPU clock source The selected peripheral is the root of a tree showing the current sequence of the prescalers form the device to the main clock source Each sub node represents a source of the clock used for its parent E BusClockPresc 2 gt 4MHz EY Cikdiv 1 gt 8MHz CPU Source Clock 1 gt 8MHz Figure 2 39 CPU Timing Of Selected Peripheral 60 Processor Expert User s manual User Interface 2 9 Resource Meter Processor Expert View Resource Meter The Resource Meter shows the current status of a chip resource usage or availability Note that if a peripheral is allocated all its parts are reserved For example if you use the 8 bit I O port all the T O pins of the port are allocated and it is not possible to use them in other beans e Pins usage meter shows pins usage In general there are always some pins used such as the power supply pin e Port usage meter shows ports usage A port is considered allocated if a part of it is used or if its pins are allocated to another device e Compare Reload meter shows the allocation of the timer compare registers depending on CPU type If it is possible to combine several smaller registers into one large then the allocation of one of the smaller ones means allocation of the large one and the allocati
149. nual User Interface Figure 2 54 The comparison mode of editor 2 16 PDF Search Processor Expert Help Search in PDF Documentation of the Target CPU The PDF Search window allows the user to quickly browse PDF documentation for an CPU It can also be invoked directly from the pop up menu of the CPU bean PDF Search MC68HC908AP64 pdf 13 1 Introduction The MC68HC908AP64 has two SCI modules SCH is a standard SCI module and SCI2 is an infrared SCI module This section describes SCI1 the serial communications interface S module which allows high speed asynchronous communications wi peripheral devices and other MCUs When the SCI is enabled the TxD pin is an open drain output and requires a pullup resistor to be connected for proper SCI operation _ Figure 2 55 PDF Search Window Notice for Acrobat Reader 6 0 users The Acrobat Reader can show the following dialog box while the PDF files are switched within the PDF search window Adobe Reader For a proper function of the PDF search the user should press the Cancel button 78 Processor Expert User s manual User Interface Three Panels Of The Window e The top panel allows the user to specify the searched text expression and enable disable additional switches influencing the search process e On the left side of the widow is a narrow panel containing as a result of search a list of the pages containing the required information C
150. o 0 e invertReg w Bit RegName BitName Inverts the bit Access To Named Groups of Bits e testReg w BitGroup RegName GroupName Test a group of the bit for non zero value e getReg w BitGroupVal RegName GroupName Read a value of the bits in group e setReg w BitGroupVal RegName GroupName GroupVal Sets the group of the bits to the specified value RegName Register name BitName Name of the bit GroupName Name of the group BitMask Mask of the bit BitsMask Mask specifying one or more bits 128 Processor Expert User s manual Application Design 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 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 Example Assume that we have a CPU which has a PWMA channel and it is required to set three bits 0 1 5 in the PWMA_PMCTL to 1 We use the following line setRegBits PWMA_PMCTL 35 Run counter 129 Processor Expert User s manual Processor Expert Tutorials 4 Processor Expert Tutorials This tutorial is provided for embedded system designers who wish to learn quickly how to use the exclusive features of Processor Expert
151. occurrence of the searched text is searched and if found it is replaced by the replacement text e Replace All All occurrences of the text within the current file are replaced by the searched text Comparison Mode File editor in this mode has two panels showing a differences between the compared files The different lines are highlighted with the light yellow color and the different characters are red The lines added to the file have a green background To speed up navigation between changes the editor offer the arrow buttons on the toolbar Pressing the right left arrow button will move the cursor to the next previous difference in the file This mode can be invoked automatically by Processor Expert in a case of comparing a bean modules with previously generated ones See chapter 2 3 4 Beans Pop up Menus for details or by a DIFF button when a changes tracking is enabled See chapter 3 5 1 2 Tracking Changes in Generated Code for details Editor Ex test sdsd test CODE Inhr3 C READ ONLY 143 009xx8 0A o Q gt 10 x oid Inhr3 Init void oid Inhr3 Init void eeEr tag 0 SerFlag 0 IP 0 SW S5 SCICR LOOP 0 S 2 d SCIi SCIi SCIL SCICR LOC setReg SCI1_ SCICR 0 setReg SCI1 SCICR 0 setReg SCI1 SCIBR 391 setReg SCI1 SCIBR 1562 HWEnDi HWEnDi 243 1 Read Only Syntax artis For Metrowerks DSP C Compiler 77 Processor Expert User s ma
152. ocessor Expert plug in View Readme and Revision History Displays information about used Processor Expert plugin version basic installation instructions content of installation FAQ history of the signifiacnt changes from previous versions known problems and limitations and other related information User Guide Opens a brief user s guide delivered with Processor Expert Search in PDF Documentation of the Target CPU displays PDF documentation of the current CPU in 24 Processor Expert User s manual User Interface the PDF Search window It is possible to search any keyword in the CPU documentation based on the original manufacturer s CPU manual See chapter 2 16 PDF Search for details e Go to Processor Expert Home page display Processor Expert home page in default Internet browser e Processor Expert On line Support opens the web pages related to the customer support for the currently run Processor Expert version e About Processor Expert amp Tip Of The Day displays the About dialog containing information about the Processor Expert product version for the target CPU family and current version of Processor Expert IDE The Tip of the day is displayed along with this dialog Next tips can be viewed with using the button Next tip The Installed updates button opens the dialog containing all already installed update packages After each update Processor Expert automatically copies installed update package to the folder show
153. ocessor Expert s settings within one dialog window Processor Expert Options E xi Application options CPU specific Project options Customize Processor Expert environment A _ Feme E Encode desktop file En Autosave desktop Gl New bean ig Auto open Bean Inspector Auto connect bean Enable new bean El Inspector Assign bean name to peripheral Ask to rename peripheral G Code generation BASIC II ADVANCED EXPERT Help Figure 2 2 Environment Options Example The options are organized within three pages 19 Processor Expert User s manual User Interface e Application Options options for the Processor Expert code generation for one target CPU They are local i e they are valid only for the current application an application is the subset of the project that concerns a given target processor Environment Options options related to Processor Expert s environment behavior e Project Options options concerning the current project all target CPUs The item description for an item is provided as a hint when the user places mouse cursor on the item Press Help button to open the options description pages Basic Advanced and Expert buttons allow to customize the amount of options shown along to the user s experience level This window uses a limited version of Processor Expert Inspector to show the options information Thus the way of changing options is very
154. od during run time using several ways note that this is an advanced option and the Bean Inspector Items visibility must be set to at least ADVANCED These ways of changing the run time period of timer requires various amount of code and 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 chapter 2 5 3 1 Dialog Box for Timing Settings for details 125 Processor Expert User s manual Application Design e 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 e 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 bean during run time This code re calculates the time period to the CPU 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 Beans Notice These optimizations are not usable for the Pe
155. ode Led mcp in the CodeWarrior main menu in order to run the code generation process The code generation window shows the current state of code generation Note There shouldn t be any errors in the Error window before code generation Module IQ Map SS Errors 0 Waings 0 Hits0 2 The code generation process generated all source files from beans to the Generated Code folder in the CodeWarrior project window The other modules can be found in the User modules folder in the CodeWarrior project window The generated code is inserted only into the selected target in the CodeWarrior project window See the picture below 138 Processor Expert User s manual Processor Expert Tutorials LED mcp l 2 Simulator Y B gt lo E Files Link Order Targets Processor Expert AB readme txt a e H Startup Code 0 0 x g FQ Pim 0 0 g H Libs 0 0 x Debugger Project File 0 Oo x H Debugger Cmd Files 0 0 x Y EE Generated Code 0 O xf Y M Cpu C 0 0e x Y M RedLED C 0 0e sf Y M GreenLED C 0 0e Y Y AB Button C 0 0 x MA 10_Map C 0 0 x Y AA Vectors c 0 0e x g 2 User Modules 0 O xf Y AB Events C 0 O x M LED C 0 0 Y Doc 0 D x Next Step Go to Step 4 Adding On Event Code 4 2 4 Tutorial for Freescale HCS12 Project 2 Step 4 Adding the On Event Code 1 Switch to the Project panel Processor expert tab in the CodeWarrior project panel All
156. ode generation All Methods and Events of each bean inserted into the project are visible as a subtree of beans in the Project panel Interrupt Subroutines Some beans especially the Low level beans and Peripheral Initialization beans please see more details in chapter 3 2 1 1 Bean Categories allow to assign an interrupt service routine name to a specific interrupt vector setup The name of the Interrupt service is generated directly to the interrupt vector table and the user has to do all necessary control registers handling within his her code See chapter 3 5 3 1 Typical Usage of Peripheral Initialization Beans for details ISRs items are listed in subtree of a bean in the Project panel E Yi ADCTInit ADC E M Init TO E onvComplete SR name of INT_ADCA Complete WW ZeroCross SR name of INT_ADCA ZC LE Figure 3 1 Example Of a Bean With Two ISRs Highly Configurable and Extensible Library Embedded Beans can be created and edited manually or with the help of Bean Wizard CPU Beans are a special category of beans More information about Embedded beans can be found in the Processor Expert Help Processor Expert Embedded Beans Help Processor Expert Supported CPUs 87 Processor Expert User s manual Application Design 3 2 1 1 Bean Categories Bean Selector Categories Complete list of bean categories and corresponding beans can be found in the Bean Selector main menu View Bean Selector at the page B
157. odes depending on the type of inspected object Bean Inspector provides access to Properties Methods Events and Comments for the beans arranged in switchable pages See chapter 2 5 3 Bean Inspector for details Bean Inspector for CPU bean offers additional Build options if a target compiler is selected and Used peripherals pages e Configuration Inspector Provides access to settings of a configuration See details in chapter Configuration Inspector e User module inspector Provides access to settings of a user module AD resolution Autoselect w 12 bits T Conversion time Unassigned timing Figure 2 9 Example of the Inspector Window content Window Columns Inspector window contains the four columns e Item status 4 green checkmark item setting is correct H red exclamation item setting is not correct Items that cause errors or warnings are written in magenta color See description in the last column or the Error Window plus or minus item is a group of settings that can be expanded collapsed z light background item is version specific See chapter 2 5 3 4 Version Specific Items for details 40 Processor Expert User s manual User Interface e Item names items that are to be set are listed in the second column of the inspector Groups of items describing certain features may be collapsed expanded by double clicking on the first line of the group By double clicking on a method or ev
158. odule of an application communicates with another device i e it sends several characters at one time and receives characters from the device Thus the interrupt mode of the SCI the AsynchroSerial bean 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 bean is switched on by disabling of the Interrupt service of the bean AsynchroSerial AsynchroMaster AsynchroSlave 126 Processor Expert User s manual Application Design 3 7 Low level Access to Peripherals In some cases a non standard use of the peripheral could be required and it might be more efficient to write a custom peripheral driver from scratch than to use the bean In addition there are special features present only on a particular chip derivative not supported by the bean that could make the user routines more effective however the portability of such code is reduced Peripheral Initialization It is possible to use Processor Expert to generate only the initialization code function for a peripheral using a Peripheral initialization beans The user can choose a suitable Peripheral initialization bean for the given
159. of the module in the Project Panel Current enable disable state of this option is signalled by the icon near the bean module name in the Project Panel A enabled X disabled Code Generation e Always Write default generated bean modules are always written to disk and any existing previous module is overwritten e Don t Write the content of the module is not overwritten Please notice that this can lead to malfunction of beans dependent on the module when the module update is required due to bean s settings change 123 Processor Expert User s manual Application Design Viewing User Changes in a Bean Module The user changes done in a bean module or bean header module can be viewed using a bean pop up menu commands Compare With Previously Generated Module and Compare With Previously Generated Header Module See chapter 2 3 4 Beans Pop up Menus for details The user can also enable reviewing all changes done into the generated code after each code generation See chapter 3 5 1 2 Tracking Changes in Generated Code for details 3 6 Embedded Bean Optimizations This chapter describes how the size and speed of the code could be optimized by choosing right bean for the specific task It should also give an advice how to setup beans to produce optimized code The optimizations that will be described regard only the High or Low level beans not the Peripheral Initialization beans Please follow to sub chapters for more details on
160. of the port are allocated and it is not possible to use them in other beans The list can be filtered for only the used peripherals interrupts channels to be shown by using the menu command View Show Used Peripherals Only Notice The Peripheral Initialization and Peripheral Usage are both only one window in two different modes These windows could not be displayed both at once The following items are available e I O page shows I O pins and ports usage If a pin port is allocated to a bean the I O properties of the bean are displayed below the pin port s name unless all the pins of a port are used by one bean in which case the properties appear under the name of the allocated pins e Interrupts page shows interrupt vectors usage Each item of the list contains a number of the interrupt vector and its name If an interrupt vector is allocated to a bean the bean s name and the interrupt priorities are displayed as a sub items in the vector s group e Timers page shows the allocation of the timers Channels page shows A D CAN and serial channels usage 70 Processor Expert User s manual User Interface Menu e View Sort registers by address Group registers Show Unused Bits In this mode of the window these commands have no use and are not available Show Used Peripherals Only After this option is enabled only the peripherals allocated by Processor Expert are shown Expand all expands the folder and all its subfo
161. oftware can significantly reduce the overall design cost Processor Expert Code Warrior plug in is designed for rapid application development of embedded applications for a wide range of microcontrollers and microprocessor systems Processor Expert Main features e The application is created from components called Embedded Beans e Embedded Beans encapsulate functionality of basic elements of embedded systems like CPU core CPU 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 e Processor Expert suggests connects and generates the drivers for an embedded system hardware peripherals or used algorithms This allows the user to concentrate on the creative part of the whole design process e Processor Expert allows true top down style of application design the user starts the design directly by defining the application behavior instead of spending days just trying to make the chip work e Processor Expert works with an extensible beans library of supported microprocessors peripherals and virtual devices e Processor Expert Peripheral Initialization beans generate effective initialization code for all on chip devices and support all their features e Processor Expert allows to easily examine the details of the architecture and the relationship between the Embedded Bean setup and CPU control registers initialization
162. ols and the tools menu There are the following dialog for setting the Processor Expert project e Project Options project options are options concerning the current project and options for the current CPU 2 1 Main Menu The Processor Expert Plug in is integrated into the Code Warrior IDE application The Code Warrior IDE main menu contains a new menu item named Processor Expert Debug Tools Processor Expert Device Initialization Window Help By a A Suspend Processor Expert for Project 1 mcp Generate Code Project 1 mecp Freeze Generated Gode View Tools Options Update Undo Redo Bring PE Windows to Front Arrange PE Windows Figure 2 1 Processor Expert s Integrated Menu The Processor Expert s plug in menu consists of the following items Suspend Open Processor Expert e Generate Code ProjectName mcp e Freeze Generated Code e View e Tools Options Update Undo e Redo Bring PE Windows to Front e Arrange PE Windows Note Processor expert s help is placed in the Codewarrior s Help menu Suspend Open Processor Expert 16 Processor Expert User s manual User Interface e Suspend Processor Expert for will disable the usage of Processor Expert for the currently opened project The Processor Expert tab disappears from the project panel and the generated code of the project will stay in the project in the state it is after the last code generation in See also the Freeze Generate
163. ome items of the bean are displayed as mirrored items from the CPU bean or global settings The global setting means that it is possible to set the item in any bean where the item is available and the setting is used for all appropriate beans The items are visible if they have any relation to the bean settings The information about the mirroring is visible in the hint of the item Aa sti tar ESET nll eno wi TA Port P settings JR Wersion specific item This property is mirror of target CPU bean property Figure 2 31 Hint With Version Specific Info 2 5 4 Configuration Inspector Configuration Inspector is a variant of an Inspector Window It shows the settings that belong to one configuration It could be invoked from configurations pop up menu in the Project Panel Click on a configuration with the right button and choose the Configuration Inspector For details on configurations please see the chapter 3 3 2 Configurations Properties The Properties tab contains optimization settings related to the configuration These setting should be used when the code is already well debugged They could increase speed of the code but the generated code is less protected for the unexpected situations and finding errors could be more difficult e 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 co
164. omplete initialization of the peripheral according to the bean s settings In the following examples let s assume a bean named Init1 has been added into the project The Init method of the Peripheral Initialization bean can be used in two ways The Init method is called by Processor Expert e The Init method is called by the user in his her module Automatic calling of Init The user can let Processor Expert call the Init method automatically by selecting yes for the Call Init method in the Initialization group of the Bean 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 CPU c module 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 Intel nit Put the Init method right below the PE_low_level_init call void main void Processor Expert internal initialization PE_low_level_init End of Processor Expert internal initialization Initl_Init for 121 Processor Expert User s manual Application Design Interrupt Handling Some Peripheral Initialization beans allow the initialization of an interrupt service routine Interrupt s can be enabled in initialization code using appropriate properties that can be usually found within a group Interrupts After enabling the specificat
165. on of the large one means allocation of the two smaller ones e Capture regs shows timer capture registers usage Communication shows the allocation of the serial communication channels including also CAN A D channels shows the allocation of the A D converter channels By placing the mouse over a resource meter field you may get a hint that provides details about which resources are used concerning this field lolxi Pins usage PANDIDIODINITII Port usage MEM A Compare teload Capture regs fe wy Communication 777777777777773 AAD channels ea a Tah Figure 2 40 Resource Meter Window 2 10 Memory Map Window Processor Expert View Memory Map This window shows the CPU address space and internal and external memory mapping Detailed information for an individual memory area is provided as a hint when the user moves cursor over it Legend 61 Processor Expert User s manual User Interface white non usable space dark blue 1 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 memory The address in the diagram is increasing upwards The sizes of individual memory areas blocks drawn in the window are different from the ratio of their real sizes to improve readability of the information Small blocks are larger and large blocks are smaller The black line crossed areas s
166. on the text area of the File Editor window Meanings of items e File Open opens a file Save saves the currently displayed file Save As saves the currently displayed file under a new name Save All saves all opened files if files were edited Close closes the currently displayed file Close all closes all files Delete closes and deletes the currently displayed file Reopen opens a list of used files Print prints the currently displayed file on a printer Print Preview opens a print preview dialog The dialog allows the user to enter printer options set zoom size for preview display document margins and print the page e Edit Undo Restores the state of a file before the last change Redo Resumes the last change Cut Cuts the selected text to the clipboard Copy Copies the selected text to the clipboard Paste Pastes the text from the clipboard Clear Clears the selected text Select All Selects all text Delete Line Removes the current line Delete word Removes characters from the current cursor position to the end of the word including space e Search Find Displays SearchReplace dialog Find Next Finds next position of a string in the currently displayed file Replace Displays SearchReplace dialog Go to Line Moves the cursor to a line determined by its number Debug Notice Internal debugger is not available in this v
167. or message is displayed otherwise it s blank and gray Possible settings table This table is displayed on the right part of the timing dialog if the the button Possible settings on the top is pressed The table shows values supported by the target CPU 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 displayed may be dependent on e Runtime setting type if it s fixed value or from list of values the values present in more rows overlapping intervals are shown only once If the from time interval runtime setting type is used no values are hidden and whole intervals are shown even if they are overlapped e Timing unit if a frequency unit is used e g Hz kHz the step column is not visible By clicking on the table header there is possible to order the rows by the selected column By clicking the same column again the user can switch between 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 e prescalers e minimal timer ticks
168. or this property e use always default value for this item during project loading permanent settings do not display this dialog and always use the default value during project loading and template creation Note This item is accessible only during project loading Permanent settings or default values can be removed in Environment Options Default value e There is diferent value of item Tool directory than you usualy use fin the bean Cpu project Untilled C use new value as default value ESAS E use my default value D Program Files PE 2 53 BETA F use new value and do not change default value C do not use default value for this item C use allways default value for this item during project template loading 7 Heo Figure 2 29 Changing the Default Value 51 Processor Expert User s manual User Interface 2 5 3 4 Version Specific Items The Version specific items properties methods and events are displayed only for CPU derivatives that support it These items cover the special capabilities of the CPU and they are not present for all CPUs The version specific item is displayed as a highlighted field in the first column of the Bean Inspector See the following picture There are two items with this feature Wakeup condition Idle line wakeup El Stop in mait made lan Y Break y Select condition of wake up the SCI SCI o Version specific item Settings for HCS12 derivatives S
169. ow By specifying requirements on technical features you may filter the database in order to display only relevant CPUs If you press OK you will get the list of CPUs that meet your requirements If you press All all the CPUs supported by your version of Processor Expert will be listed 63 Processor Expert User s manual User Interface x Producer Number of pins Minimal RAM size all se to Family Minimal number of 10 ports Minimal ROM size all Clock MHz Minimal number of timers Minimal EPROM size Dual clock kHz Min num of compare capture regs Minimal FLASH size Operating temperature C Minimal number of 4 D channels Minimal OTP size x po pe Power supply Y Minimal number of serial channels Note Memory sizes are in minimal AAA addressable units bytes words Minimal number of CAN channels TF Watchdog required Fal X Cancel 7 Help Figure 2 43 CPU Query Dialog Description The CPU Parameters Overview windows displays the list of CPUs including their technical features e CPU type CPU type e Producer CPU producer e Family CPU family e Clock CPU xtal clock e Dual clock if CPU does have a dual clock e Operating Temperature CPU operating temperature e pins number of pins on CPU package e IO ports number of I O ports and I O pins e timers number of timers compares and captures e A D number of A D channels and converters For example 12 1 means 12
170. package switches to the CPU BGA package view mode iy Show CPU block diagram switches to the CPU block diagram view mode S Show CPU peripherals in a list switches to the CPU peripherals list view mode View Modes e CPU package mode a realistic view of the CPU package with pins and peripherals Each allocated peripheral contain an icon of the bean that allocates it For allocated pins also the bean icon with the connection is shown 54 Processor Expert User s manual User Interface 56F8011 S p 3 A 12 GPIOA6_FAULTO GPIOA6_FAULTO nonej Port A GPIO Disable Selected PWM Outputs Figure 2 33 Target CPU CPU package view mode e CPU BGA package mode This mode is available only for CPUs with grid array pins layout It is similar to the package mode but the pins hidden by package are shown and the peripherals are hidden Target CPU Cpu MPC5554 Q I ER P26 PCS_B2_SOUT_C PCS_B2 SOUT_C ia Z Figure 2 34 Target CPU BGA CPU package view mode e CPU block diagram mode a view of the CPU block diagram based on the documentation of the CPU manufacturer Every part of the CPU is represented by a block Every block that contains a resources that can be allocated by Processor Expert contains the slots for every resource e g pin or channel If the resource is allocated the slot contains the icon of the allocating bean 55 Processor Expert User s manual User Interface Target C
171. pert view See also the main page of the Bean Inspector chapter for more information how to switch view modes Note If an error occurred in a property with a higher visibility level than the level currently selected this error nevertheless will be displayed 44 Processor Expert User s manual User Interface 2 5 3 Bean Inspector Bean inspector is one of the Inspector window variants It allows to setup Properties Methods and Events of a bean Use command Help Help on Bean from Bean Inspector menu to see documentation for currently opened bean Note Property settings influencing the hardware can often be better presented by the CPU package view using Target CPU window See chapter 2 7 Target CPU Window for details Bean Inspector TI1 TimerInt al xi Bean Items Visibility Help lt gt View Regs gt Properties Methods Events Comment TPM10 E Interrupt service event ables Ele Interupt o Vtpmi1chO Vtpm1 chO v El Prescaler Autoselect x T Interrupt period af Unassigned timing Bean uses entire timer E Initialization Enabled in init code BASIC ADVANCED EXPERT Bean Level High Level Bean 7 Figure 2 27 Bean Inspector Window The Comments page allows the user to write any comment about the bean or setting used This comment will be displayed in the hint when the mouse cursor will be placed on the bean The Build options page is present only in the CPU bean and it p
172. pheral registers Peripheral E 0 PTGSE 00 H 80 q PTGDD5 0 PTGDD4 0 PTRANa Figure 2 46 Register List in the Peripheral Initialization window Register details command from pop up menu of a register invoked by the right button click opens a window containing a detailed information for the register Control Register SCIO_SCICR at address OxF281 15 14 13 12 11 10 9 8 5 LOOP SWAI RSRC M fWAKE POL PE PT RFIE REIE TE 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 RAW RAW Rew RAW RAW RAW RAW RAW AZW RAW BZW RAW RA Figure 2 47 Register Content Details Bit num Name After reset Init value Access Additionally modified registers A list of additionally modified registers is displayed at the bottom of the registers list It contains registers that are influenced by the bean but are not listed for the peripheral currently selected in this window The list is displayed only if such registers exist DDRP bo o Changes Highlighting The user can watch reflections of user settings to Embedded Bean Properties directly in CPU peripheral registers and bits The registers influenced by a last bean settings change are highlighted with a green color see the previous two pictures for example The highlighting works only in the case that the bean was set up correctly before the change was made and the new setup is correct as well and ther
173. pin of an I O 37 Processor Expert User s manual User Interface Filtering The following filters can be applied on the bean list They could be switched on off by clicking on two buttons on the bottom bar e for XXXXX only If this filter is active only the beans that could be used with the current target CPU derivative are shown the XXX is the currently selected target CPU If the filter is inactive Processor Expert also shows beans that are not available for the current CPU but in the gray color e Licensed If active only the beans with valid license are shown The icon in Bean categories On Chip peripherals or Alphabet tab means that there is an available license for the bean If the icon is displayed as a greyed 3 icon it means that for the selected bean a valid license 1s not available e All questions This button appears only in Assistant mode of the Bean Selector If it s active all questions are shown If it s not the questions with only one available answer are automatically skipped Bean Categories On chip periherals and Alphabet Modes In these modes the workspace contains the following controls A folder pop up menu is available by clicking the right mouse button on a folder It contains the commands e Expand Collapse expands or collapses the folder Expand all expands the folder and all its subfolders e Collapse all collapses the folder and all its subfolders Help on Bean Sel
174. plate only if the peripheral is not already allocated to another bean or 58 Processor Expert User s manual User Interface beans The beans 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 CPU package e Help on Target CPU Window displays help for the current window 2 8 CPU Timing Model Project Panel CPU pop up menu View CPU Timing Model This window presents the schematic structure of the target CPU timing stored in the database of Processor Expert The information can be displayed in two levels of complexity e Simple view In this mode only the active prescalers are shown Unimportant tree nodes like inactive branches divider by one etc are hidden Every clock source is shown as a node of the tree at the topmost level This is the default mode Normal view All nodes of the timing model are shown The complexity can be switched by checking un checking the Simple View item of the pop up menu of the window Click plus or minus signs to expand or collapse the branches of the tree Icons Description Y active endpoint a device using the clock Inactive device or unused branch clock source 7 adjustable prescaler constant prescaler x adjustable multiplier X constant multiplier E clock distribution to multiple branches 2 element selecting one of the connected branches T
175. ports etc We recommend to always use methods generated by Processor Expert Note that if a peripheral is allocated to any bean 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 beans In some timer beans 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 best work with the timer it can for example invoke reset of the timer whenever is it needed by the bean function Interrupt Priority If the target CPU shares interrupt priority between several interrupt vectors or shares interrupt vectors Processor Expert provides checking of interrupt priority settings If you would like to have more detailed information about Interrupt Priority see the Priorities page Memory Processor Expert always checks the usage of internal and external memories accessible via CPU address and data bus Position and size of internal memory is defined by the CPU type and can be configured in the CPU Properties if supported External memories must be defined in CPU Properties Any bean can allocate a specified type of memory See bean descriptions for detailed information about requirements for types of memory Processor Expert provides checking of memory and protects you from making a poor choice For example if a bean requires external Flash it is
176. pt 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 beans and their methods and events For example it is possible to use the RTIshared bean for sharing periodic interrupt from timers 86 Processor Expert User s manual Application Design Methods Methods are interfacing bean functionality to user s code All enabled methods are generated into appropriate bean modules during code generation process All Methods of each bean inserted into the project are visible as a subtree of the beans in the Project panel 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 project panel into the editor The complexity and number of methods depend on the bean s level of abstraction Events Some beans allow handling the hardware or software events related to the bean The user can specify 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 The user can write event handling code into this procedure and this code will not be changed during the next c
177. r in Processor Expert usually represents the whole timer with its internal counter Events are used for processing events related to the bean s function errors interrupts buffer overflow etc by user written code See chapter 3 2 1 Embedded Beans for details 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 H Free running device is a virtual device that represents a source of the overflow interrupt of the timer in the free running mode High level bean is a bean with the highest level of abstraction and usage comfort An application built from these beans can be easily ported to another microcontroller supported by the Processor Expert They provide methods and events for runtime control See chapter 3 2 1 1 Bean Categories for details Internal peripherals internal devices of the CPU ports timers A D converters etc usually controlled by the CPU core using special registers ISR Interrupt Service Routine code which is called when an interrupt occurs Low level bean a bean dependent on the peripheral structure to allow the user to benefit from non standard Processor Expert User s manual Introduction features of a peripheral The level of portability is decreased because of this peripheral dependency See chapter 3 2 1 1 Bean Categories for details Methods user callable functions or sub routines Th
178. r details Name name of the clock source prescaler or other timing device e Presc value a number that means a divider for the clock signal e Frequency a clock frequency on the output from the clock device Note Some devices shown in the clock path are not physically present on the CPU but are only a necessary part of a virtual model that allows to represent a real timing behavior The prescaler values in rows may not match the values exactly written into the control registers e g compare reload but they are clock divisor values used by the timing model Also if the bean uses virtual clock device as a clock source RTIShared there is a device named SW extension that represent a divisor provided by software counter For more information on the CPU timing and list of clock device icons with descriptions please see the chapter 2 8 CPU Timing Model 2 5 3 2 Syntax for the Timing Setup in the Bean Inspector The properties that contain timing settings can be configure using the timing dialog For details please see the chapter 2 5 3 1 Dialog Box for Timing Settings or directly by entering the timing value If the timing values are specified directly it s necessary to type not only a value integer or real number but also the unit of that value The following units are supported e microseconds a value must be followed by us e milliseconds a value must be followed by ms e seconds a value must be followed by s e Xtal tick
179. ripheral Initialization Beans Communication beans 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 bean which gets current size of a used buffer can be used after each calling of the SendBlock RecvBlock method Use interrupts if you require faster application response The interrupt routine is performed only at the event time i e the code does not check if a character is sent or received Thus the saved CPU time can be used by another process and application is faster Use polling mode instead 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 of the data only 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 1 e when the interrupt is used an interrupt subroutine is needed and code size is increased 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 bean should be used in this case A m
180. rovides access to the settings of the compiler or debugger selected in Project Options These settings are different for each compiler or debugger and are reset every time the compiler or debugger is changed The Used page shows list of the CPU bean resources The user can also manually block individual resources for using them in Processor Expert The page consists of the three columns e First shows the name of the resource Resources are in groups according to which device they belong to e Second column allows the user to reserve resource for example pin for external module Click on ol icon to reserve free a resource Reserved resource could not be use in Processor expert any more e Third column shows the current status of the resource and the name of the bean which uses it if the resource 1s already used For menu and view mode description and other common Inspector window features see chapter 2 5 Inspector and 2 5 1 Inspector Items 45 Processor Expert User s manual User Interface Pin sharing Some beans allow sharing of the pins This ability is indicated by a presence of the pin sharing A button in the pin selection property line Notice This feature is not available in this version Bean level The Bean Level is displayed at the bottom of the window besides the view mode buttons It describes the amount of the peripheral abstraction and a cross platform portability e High Level Beans highest level of
181. rt features Producers of programmable logic FPGA When a customer designs his own FPGA based peripheral it is possible to bean it to include its standard form into the Processor Expert Embedded Beans palette Then the design could be reused in software and supplied to the customers of the FPGA designer with a full software support Producers of OS Processor Expert can be used to build an OS kernel or OS drivers Also thanks to Processor Expert open component architecture and support of pure software beans Processor Expert can be used to build applications benefiting from underlying operating system services Educational institutes Microprocessor oriented courses can benefit from the concentration of knowledge of microprocessor structures and hardware independence delivered by Processor Expert Design of applications starts from a definition of functionality which is then obtained very quickly by building the application from Embedded Beans Students can get the results very fast without struggling with problems that are not related to the subject of the course e g compiler bugs errors in the documentation and so on Hardware and software developers Shortening of the design and learning phase speeding up the deployment of new components full use of hardware using tested software components reducing time and cost of design all these are keys to success provided by Processor Expert Processor Expert User s manual In
182. s n Speed mode independent timing yes ye e S yes no direct interrupt handling 3 2 2 CPU Beans Processor Expert Help Supported CPUs Compilers and Debuggers A CPU bean is an Embedded Bean encapsulating one CPU type As with all other beans CPU Beans have properties methods and events A Processor Expert project may contain several CPU beans The project generated for one CPU is called an Application CPUs included in a project are displayed in the upper part of the Project panel depending on the Project panel settings just one of them must be active selected as the Target CPU before starting the code generation The Build options accessible in the Bean Inspector of the CPU bean allow to set properties of the Compiler and Debugger if it is supported In the CPU Bean Inspector page Used it is also possible to select the peripherals which cannot be used by Processor Expert These peripherals will not be available for the beans in the project and may be freely used by any external module 89 Processor Expert User s manual Application Design Portability e Itis possible to change the target CPU during the development of an application and even to switch between multiple CPUs This can be done simply by adding another CPU to the project and selecting it as the target CPU e To connect the new CPU peripherals to the application beans correctly it is possible to specify CPU on chip peripheral names See chapter
183. s CPU crystal ticks In case that the CPU doesn t have a crystal internal oscillator or a sub clock is used A value must be followed by ticks Hertz a value must be followed by Hz e kilohertz a value must be followed by kHz megahertz a value must be followed by MHz e bit second a value must be followed by bits 50 Processor Expert User s manual User Interface e kbit second a value must be followed by kbits Example If you want to specify 100 milliseconds enter 100 ms For more details on timing configuration please see the chapter 3 3 4 Timing Settings 2 5 3 3 Defaut Values for Properties Some properties can have a global default value Once you enter the value for the property and you confirm that it will be the default value for the property then it will be used automatically in the future If you open a project with different settings or change the value of the property in the Bean Inspector a Processor Expert automatically offers the following options e use new value as default value remember the newly entered or just loaded value as the new default value change default value e use my default value cancel changes discard loaded value and use previous default value e use new value and do not change default value use the newly entered or just loaded value and do not change the default value do not use default value for this item permanent settings never use default value f
184. s Implementation help chapter Levels of Abstraction Processor Expert provides beans with a different level of abstraction and settings comfort High Level Beans The beans that are the basic set of beans designed carefully to provide functionality of most microcontrollers on the market An application built from these beans can be easily ported to another microcontroller supported by the Processor Expert This basic set contains beans 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 etc This group of beans allows comfortable settings of a desired functionality such as time in ms or frequency in Hz the user doesn t have to know the details about hardware registers CPU specific features are supported only as CPU specific settings or methods and are not portable See chapter 2 5 3 4 Version Specific Items for details The beans inheriting or sharing a high level bean s to access hardware are also high level beans Low Level Beans The beans that are dependent on the peripheral structure to allow the user to benefit from non standard features of a peripheral The level of portability is decreased due to a different bean interface and the bean is usually implemented only for a CPU family offering the appropriate peripheral Howev
185. s create a shared ancestor bean through a descendant bean Press the 7 button to select an existing shared ancestor bean from the current project Press the El button to select an existing or create a new ancestor bean using the Bean Wizard see below gt 12C bus El201 Figure 3 11 Example of popup menu for creating a new shared ancestor bean Selection Creation Wizard When a bean with a link to a shared ancestor bean is added to the project the following Selecting Creating Wizard appears This wizard helps you to select or create the shared ancestor bean quickly Processor Expert helps you to select or create a shared bean f E x The bean 12C12C12C12C uses shared bean for item 12C bus You may choose existing or create new appropriate bean just now Use existing bean El201 Create new bean from template External_I2C Jf DK X Cancel Help Figure 3 12 Example of popup menu for creating new shared ancestor bean Run time Resources Allocation Processor Expert generated code does not check the usage of shared resources code It s up to the user to use the correct run time resources allocation of a shared ancestor bean Usually it is not possible for a shared ancestor bean to be used simultaneously by several beans 106 Processor Expert User s manual Application Design 3 3 8 Pin Sharing Reading a Pin Value Without Its Initialization The InputPin bean supports read
186. s required by Beans settings Registers There is a value displayed in the middle column which will be written into the register or bit by the generated code during the initialization process of the application It is the last value that will be written by the initialization function to the register Note For some registers the value read from the register afterwards can be different than the last written value For example some interrupt flags are cleared by writing 1 Please see the CPU manual for details on registers behavior In case the peripheral is allocated by a bean and the setting of the bean is incorrect then the initialization values are not displayed in the Peripheral Initialization window Instead a value of the register or bit after reset is displayed in the right column The after reset values can contain also a characters with special meaning The list and description of these characters is displayed as a hint when the mouse cursor is placed on the header of the registers table The values of the registers can be displayed in hexadecimal decimal or in binary form In case the value of the register or bit is not defined an interrogation mark is displayed instead of the value In this case it is possible to display the value of the register in binary form only 67 Processor Expert User s manual User Interface Peripheral Initialization PTG View Help alero y z Regname init value After reset Peri
187. setup was found in project or in bean s settings The warnings are displayed in Error Icons 4 P AA near the bean s icon mean the bean is individually setup for preserving user changes in generated code See chapter 3 5 4 User Changes in Generated Code for details The Project panel window allows quick access to supported methods and events using mouse See paragraph 26 Processor Expert User s manual User Interface Other mouse actions Pop up menu Project panel pop up menu is accessible by right click on the empty white area of the Project Panel Contains basic operations related to the project and beans e Open Project allows the user to open Processor Expert project from disk e Save Project saves the current state of the project e g all the bean and processor expert settings Project is also automatically saved when Code Warrior or project is closed e Copy Project to copies the Processor Expert project file PE containing settings of all beans and the user modules into another directory It is useful for backing up the state of the project The stored file could be opened again using Open project command from this menu e Reload Project Reloads project from the last saved state on the disk e Add Bean s allows to add beans from the project Shows bean selector dialog e Import imports the content of the file containing exported objects e g beans configurations or whole project All items from
188. similar to the way of configuring a bean or configuration See chapter 2 5 1 Inspector Items for details 2 1 2 Tools Setup Processor Expert Tools Tools Setup Tools Setup allows to include other tools in the Processor Expert environment The tools may then be accessed via the Tools menu Options Notice Most of the options allow to use macros allowing an access to various Processor Expert and system values See chapter 2 1 2 1 Tools Setup Macros for details The following options are available for every tool e Tool name name of the tool as it appears in the Tools menu e Visible in Tools menu whether the tool is available in the Tool menu it may not be necessary to let it appear in the menu if the settings are meant only for internal make e Application the full name name and path name of the application executable file EXE or COM extension e Working dir working directory of the application e Application type MS DOS real MS DOS real mode application MS DOS protected MS DOS protected mode application Windows 16 bit 16 bit MS Windows application Windows 32 bit 32 bit MS Windows application Autodetect auto detection enabled under the Windows NT Windows 2000 and newer Hot Key Hot Key for launching the tool e Parameters parameters of the application Input file s only for backward compatibility value of the SOUTPTH macro see macros e Output file s only for bac
189. splays the CPU block diagram in the Target CPU window Help on Bean Selector displays documentation on the Bean Selector 2 4 1 Bean Assistant The Bean Assistant is a mode of Bean Selector window It guides the user during the selection of beans basic application building blocks The user answers a series of questions that finally lead to a selection of a bean that suits best for a required function In this mode the Bean Selector window has the following parts Control bar with the history navigation buttons and the history line showing answers for already answered questions The user can walk through the history using the arrow buttons and 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 single bean it has an icon of the bean and there is a bean name at the end of the list line and user double clicks it its added into the project Also a pop up menu of the bean allowing to add it into the project or show it s documentation is available on right mouse button click on the line for details see 2 4 Bean Selector help page If more questions are necessary for the bean selection the line with the answer contains a group icon Banda in a brackets a number of beans that still can possibly be selected After clicking on such line a next question is displayed Please note that a bean filtering controlled by the button s on the
190. sters Loco 128 CPU BE MS acii o noe Sits Se eed ee Ge 89 CPU block diagram _ _ _ 54 CPU package coco 54 CPU parameters overview _ 63 CPU peripherals _ 92 CPU Properties overview Loco 91 CPU timing model Loco 59 CPUS Sois acces ao nthe eee 31 Creating own beans 2 eee ee ee ee ee eee 141 Default values for properties 2 51 Design time checking _ _ 99 Documentations menu 2 ww wee ee eee 36 Drag and drop misas cara naa 27 Driver 2 coa cats cz 13 Embedded Beans 0 86 Enabling bean 020 Sica tas ell es 119 Environment options ccoo 19 Eror codes tencia ara 118 ETTOrWINdOWE uma ais tes Boe ee 53 Events 2d ra a a a 13 94 ES ct ci 8 File edilon a a is e sE 71 Freeze generated code occ no 17 General optimizations _ ooccoooooooo oo 124 Generated code optimizations _ 52 Generated modules _ _ 34 HCS12 implementation details 109 Help menu Loc 24 High level beans coco 88 High speed mode Zoco 91 Icons in Project Panel _ 26 Implementation details Loco 108 142 Inheritance mecrcacmaranial aa cee ens 105 Init Bean usage coco 121 Init Method usage occ 121 Initializing bean Loco 121 INSPector e a a e N o de 40 Inspector items 1 1 42 Installed beans _ 24 Installed updates ooo 25 Internal peripherals 00 eee eee ee ee ee eee 13
191. ter See chapter 3 6 1 General Optimizations for details Events if used can be raised by interrupt from the hardware resource timer SIO or by pure software reason overflow in application runtime You can enable or disable interrupts using bean methods and define priority for event occurrence and for executing its Interrupt Service Routine ISR The hardware ISR provided by the bean handles the reason for the interrupt If the interrupt vector is shared by two or more resources then this ISR provides the resource identification Then the user is notified by calling the user event handling code Creating Applications Creation of an application with Processor Expert on any microcontroller is very fast First choose and set up a CPU bean add other beans modify their properties define events and select Generate Code Processor Expert generates all code well commented from beans according to your settings See chapter 3 5 Code Generation for details This is of course a only part of the application code that was created by the virtual application engineer Processor Expert CPU 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 desired events provide main code add existing source code and build the application using classic tools compiler assembler and
192. terNewSpeed is invoked after the speed mode change Speed mode may be changed using CPU bean methods SetHigh SetLow or SetSlow EVENT C int changing_speed_mode 0 void B1_BeforeNewSpeed void changing_speed_mode void B1_AfterNewSpeed void changing_speed_mode Note If the speed mode is not supported by the bean the bean functionality is disabled as if the method Disable is used If the supported speed mode is selected again the bean status is restored 120 Processor Expert User s manual Application Design TRUE and FALSE values of the 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 e True is any non zero value It follows from this definition that the bool value cannot be tested using the expressions like if value TRUE Processor Expert methods returning bool value often benefit from this definition and they return any 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 3 5 3 1 Typical Usage of Peripheral Initialization Beans Init method Init method that is defined in all Peripheral Initialization Beans Init method contains a c
193. th hardware dependencies Processor Expert could even suggest the right member of a microprocessor family for the specific application Producers of intelligent peripheral I Os and other devices Complex and feature rich peripherals and controllers require a big effort to use them efficiently even if device drivers are supplied by the factory But imagine the possibility of supporting customers with components providing a standard software interface that allows building applications and easily uses new hardware device features And yes the Processor Expert environment allows this customers can easily download new components from the internet and install them into Processor Expert Processor Expert User s manual Introduction Producers of hardware of microprocessor systems Microprocessor boards that are to be programmed by a customer must be well supported by software Processor Expert can handle software configuration and generation of drivers for microprocessor devices and off chip peripheral devices Creating an application using Processor Expert takes usually 70 less time than with standard Integrated Development Environments IDEs containing only a source code editor compiler debugger Producers of compilers hardware emulators and simulators Processor Expert is able to cooperate with other tools and IDEs because it works on a higher level of abstraction Tools suppliers can increase the attractiveness of their tools with Processor Expe
194. the source code will create an include command include 27 Processor Expert User s manual User Interface user_module_name h at the place of the cursor e The user can drag n drop components within the Project Panel to reorganize component trees CPUs Beans Documentation e The user can drag n drop bean folders within the Project Panel to reorganize them By default the folder is placed after the folder where it is dropped onto on the same level as that folder If the SHIFT key is pressed when the mouse button is released the dragged folder is placed inside the folder it is dropped into Multiselect Using the Ctrl and Shift key together with cursor key or left mouse button allows to select multiple items Double click e Double clicking the bean icon in the Project panel opens the Bean Inspector e Clicking on the selected bean name in the Project Panel allows you to edit the name of the selected bean e Double clicking on any event method initialization enable disable icon changes its enable disable state you can do it also via the bean inspector e Double clicking on any event method name after code generation opens the file editor viewer at the position of the event method s code e Double clicking on any ISR opens the source code editor at the interrupt routine if its name has been specified within the bean properties Automatic Hints e Placing the cursor on any event method icon name displays the event method s
195. the user to select from several ancestors that implement a required interface and are registered by the descendant bean The ancestor bean is displayed under its descendant in the project structure tree in the project panel E Y Q ExEE1 DevKitl6_EEPROM_FPGAP Y Inhr Inbr FPGAI2C Figure 3 10 Example of ancestor and descendant beans in the project panel tree 105 Processor Expert User s manual Application Design An ancestor bean requires a list of methods and events interface which must be implemented by an ancestor bean The error is shown if the ancestor bean does not implement any of them for example if the settings of the descendant bean do not allow it to generate this method Bean Sharing Bean sharing allows the user to cause several beans to use capability of one bean with the way similar to inheritance This feature allows sharing of its resources and its drivers with other beans For example beans may share an I2C bean for communication with peripherals connected to the I2C bus Settings in Processor Expert A shared ancestor bean contains a property which allows the user to select existing or create a new shared ancestor bean The ancestor bean is included in the project tree as are the other beans The ancestor bean may be used with the descendant bean only if it was created from a template registered in the descendant bean or if the bean type is registered in the descendant bean It s recommended that you alway
196. tical Application Design Disable global interrupts Enable global interrupts It saves CCR register and disable global interrupts It restores CCR register saved in EnterCritical For the list of macros available for Peripheral registers access please see the chapter 3 7 2 Direct Access to Peripheral Registers3 7 2 Direct Access to Peripheral Registers of the Processor Expert main help Constants Methods Error Codes The error codes are defined in PE_Error module Error code value is 8bit unsigned byte Range O 127 is reserved for PE 128 255 for user ERR_OK ERR_SPEED ERR_RANGE ERR_VALUE ERR_OVERFLOW ERR_MATH ERR_ENABLED ERR_DISABLED ERR_BUSY ERR_NOTAVAIL ERR_RXEMPTY ERR_TXFULL ERR_BUSOFF ERR_OVERRUN ERR_FRAMING ERR_PARITY ERR_NOISE ERR_IDLE ERR_FAULT ERR_BREAK ERR_CRC 0 OK 1 This device does not work in the active speed mode 2 Parameter out of range 3 Parameter of incorrect value 4 Timer overflow 5 Overflow during evaluation 6 Device is enabled 7 Device is disabled 8 Device is busy 9 Requested value not available 10 No data in receiver 11 Transmitter is full 12 Bus not available 13 Overrun is present 14 Framing error is detected 15 Parity error is detected 16 Noise error is detected 17 Idle error is detected 18 Fault error is detected 19 Break char is received during communication 20 CRC error is detected 118 Processor Expert User s manual Application Desig
197. tings 222 2 22 eee eee eee eee eee 46 2 5 3 2 Syntax for the Timing Setup in the Bean Inspector ccoo 50 2 5 3 3 Defaut Values for Properties _ _ _ 2 2 ee enn ee eee 51 2 5 3 4 Version Specific Items ccoo coc 52 2 5 4 Configuration Inspector occ 52 2 6 Error WINDOW A ar p e ea a a E aa a a a a kaa 53 2 7 Target GPU VMI OW AAA A tage hose aaa 54 28 Ge Timing Model 2 e is es i o a e 59 2 9 Resource Meter coccion 61 2 10 Memory Map Window uscuisrrasciar la lineas add e 61 2 11 CPU Parameters Overview e Sl 63 2 12 List of Installed Beans with Additional Information 2 0 65 2 13 Peripheral Initialization o ad Aone 67 2 14 Peripherals Usage e tt ti EE 70 20 Al EA a e e at dd a a ld 71 216 PDF Searchin soc esas a aereas lisas 78 2 16 1 Regular Expressions __ 22 eee eee eee ee eee 80 3 Application Design 85 3 1 Quick Start in Processor Expert 2 2 222222 cece eee ee ee eee eee eee ence cece 85 3 2 BASIC Principles osii a e daria cede 86 3 2 kiEmb dded Beans sto da e a da a e dnd 86 321A Bean CateGOnieS cs Santen co ot ra e A e Pale pe a 88 32 26 PU BEANS aaa Me be ta naaa ia 89 3 2 2 1 CPU Properties Overview ccoo 91 3 2 2 2 Speed Modes Support 222 22 eee ee ees 91 Processor Expert User s manual 3 2 2 3 Changing Names of Peripheral Devices _ _ _ eeee ee eee eee eens 92 9 9 COMUN SONS rn a Sth Peto ts ot et li es eat la Des
198. tion 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 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 chapter Code Generation To support user changes in the bean modules Processor Expert supports the following features 1 CH file manifest constants Processor Expert automatically produce list of manifest constants for all beans which encapsulate any CPU peripheral and modifies any of the CPU control registers The name of each manifest constant is in the following format C_ bean method _reg_ register name additional info where e bean method is name of bean and optionally also bean s method e register name is name of the control register e additional info is additional information about usage of the value modification of one bit bits mask or 122 Processor Expert User s manual Application Design whole value These constants may be used to write user code which reflects the bean settings Once the constant is generated into the CH file it is preserved there even it is already not used in the bean module The most important advantage of these constants is that small changes in the bean settings for example timing does not cause change of the bean module but the only CH file is changed The name
199. to 0 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 Bean Inspector Note See the Internal peripheral property group of the CPU bean 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 Bean Inspector Note See the Internal peripheral property group of the CPU bean for special settings e EventCntr8 16 32 Functionality of this bean is a subset of the pulse accumulator For work with hold registers gated time mode use the PulseAccumulator bean instead of the EventCounter bean PulseAccumulator Method Latch This method causes capture of the counter in the hold registers of all capture and pulse accumulator beans in PE project because this method is invoked for all ECT modules Note See Internal peripheral property group of the CPU bean for special settings e Capture Method Reset If the counter can t be reset is not allowed by HW or the counter is shared by more beans 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
200. to the project and disable these useless beans in the new configuration only the previous configuration will be used when the application is tested again Moreover if it is required to use the same bean with different setting in several configurations its possible to add one bean for each configuration with same name and different setting 194 Processor Expert User s manual Application Design Speed modes Notice These optimizations are not usable for the Peripheral Initialization Beans Timed beans which depends on the CPU clock such as timer communication and conversion beans may support speed modes defined in the CPU bean in EXPERT view level The Processor Expert allows the user to set closest values for the bean timing in all speed modes if possible If the requested timing is not supported by the bean for example if the CPU clock is too low for the correct function of the bean the bean can be disabled for the appropriate speed mode The mode can be switched in the runtime by a CPU method The bean timing is then automatically configured for the appropriate speed mode or the bean 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 Configuration Inspector for more optimization settings See chapter Embedded Beans Optimizations for details on choosing and setting the beans to a
201. troduction 1 3 Features Processor Expert has built in knowledge internal definitions of the entire CPU with all of its units and integrated peripherals The CPU units and peripherals are encapsulated into configurable components called Embedded Beans each of which provides a set of useful properties methods and events An intuitive and powerful User Interface UI allows the user to define the system behavior in several steps A simple system can be created just by selecting the necessary beans setting their properties to the required values and maybe also dragging and dropping some of their methods to the user part of the project source code PE key components e Graphical IDE e Built in detailed design specifications of Freescale devices e Code generator PE key features e Design time verifications e CPU selection from multiple CPU derivatives available e CPU pin detailed description and structure viewing e Configuration of functions and settings for the selected CPU and its peripherals e Definition of system behavior during initialization and at runtime e Design of application from pre built functional components called BEANS e Design of application using bean methods user callable functions and events templates for user written code to process events e g interrupts e Customization of beans and definition of new beans e Tested drivers e Library of components beans for typical functions including virtual SW beans
202. ts Comment Bean name Bytel Port PTB v Port signal x Y Led Led2 Led3 Figure 3 8 Signal names list for a port Generated Documenation Processor Expert automatically generates a document fprojectname _SIGNALS txt or projectname _SIGNALS doc containing a list of relationship between defined signals and corresponding pins and vice versa There is an additional signal direction information added next to each signal name and pin number information next to each pin name This document can be found in the Documentation folder of the Project Panel Sample of generated signals documentation SIGNAL LIST SIGNAL NAME DIR gt PIN NAME PIN NUMBER ED1 Output gt GPIOA8_A0 138 LED2 Output gt GPIOA9_Al 10 Sensor Input gt GPIOC5_TA1_PHASEBO 140 TestPin 1 0 gt GPIOEO_TxDO 4 Timer Output gt GPIOC4_TAO_PHASEAO 139 PIN LIST 104 Processor Expert User s manual Application Design T PIN NAME PIN NUM gt SIGNAL NAME DIRECTION GPIOA8_AO 138 gt LED1 Output GPIOA9_A1 10 gt LED2 Output GPIOC4_TAO_PHASEAO 139 gt Timer Output GPIOC5_TA1_PHASEBO Sensor Input GPIOEO_TxDO 4 gt TestPin 1 0 E ll Vv 3 3 7 Bean Inheritance and Bean Sharing Basic Terms e Ancestor is a bean that is inherited used by another bean e Descendant is a new bea
203. ts as Read Only the user cannot edit the default values for properties or change features like whether to generate or not to generate methods or events or Changeable user can edit default values of properties or change features generate not generate of methods or events by double clicking in the first column in Bean Inspector The icon shows the status _ feature is ReadOnly G feature is Changeable set level of visibility of properties methods or events by repeatedly double clicking in last column in Bean Inspector When you use the template you may change the level of visibility in the View menu in the Bean Inspector See chapter 2 5 3 Bean Inspector for details Possible values Type BASIC property method event will always be visible Type ADVANCED property method event will be visible if it is selected in Advanced view Type EXPERT property method event will be visible if it is selected in Expert view Type HIDDEN property method event will never be visible TEMPLATE EDITOR TI2 TimerInt x lt Bean Items Visibility Help TEMPLATE EDITOR For each property method and event select default value and toggle runtime status read only or editable using left mouse button click Gi Timer ST MRAT_Compare y e Counter TMT gt Interrupt service event gt Intemupt INT_ZTMRA1 Ei Interrupt priority medium priority v E Prescaler Auto selected presca y x Interrupt period 4 Same period
204. u to open the corresponding page in a default Internet browser Processor Expert User s manual User Interface Undo actionname Restores the state of the project before a last operation This command affects only changes in the project i e adding or removing beans disabling beans etc It doesn t work on the source code editor actions Functionality of this command is influenced by the option Environment Options Number of UNDO operations The 0 value of this option will disable the functionality of this command Redo actionname Applies again the change previously discarded by a use of the Undo command This command affects only changes in the project i e adding or removing beans disabling beans etc It doesn t work on the source code editor actions Functionality of this command is influenced by the option Environment Options Number of UNDO operations The 0 value of this option will disable the functionality of this command Bring PE Windows to Front Sets the main Processor Expert s windows to the front on the screen Arrange PE Windows Arranges all open windows to the default placement on the screen Project Panel Bean Selector Cpu Panel Error Window Resource Meter Bean Inspector 2 1 1 Processor Expert Options Processor Expert Options Environment Options Processor Expert Options Project Options Processor Expert Options Application Options Processor Expert options allows to customize all Pr
205. w and the event and main source modules will be inserted into the User Modules folder in the CodeWarrior project window Generated source code can be displayed in editor by the left mouse button double click on selected module in the project window Step 3 More Complicated Example Once you have learned the basic skills you may open a more complicated example in order to get to more advanced level of code generation Creating New Projects See the chapter 4 Processor Expert Tutorials for step by step tutorials on creating Processor Expert projects from the beginning 85 Processor Expert User s manual Application Design 3 2 Basic Principles The application created in Processor Expert is built from the building blocks called Embedded Beans The following sub chapters describe the features of Embedded Beans and the CPU beans special type of Embedded Beans and what they offer to the user Embedded Beans e CPU Beans 3 2 1 Embedded Beans Embedded beans encapsulate the initialization and functionality of embedded systems basic elements such as CPU core CPU on chip peripherals for details on categories of beans delivered with Processor Expert see chapter 3 2 1 1 Bean Categories FPGAs standalone peripherals virtual devices and pure software algorithms These facilities are interfaced to the user via properties methods and events It is very similar to objects in Object Oriented Programming OOP concept Easy Initiali
206. window A user can also add specific source code files into this folder If the linker setting of the default target does not match the CPU in the Processor Expert project the user is asked whether to automatically correct linker settings in the default target or to create a new target with correct linker settings In the latter case the files will be generated in the new target see also chapters 3 5 1 Code Generation and 3 5 1 1 Linker Dialog Freeze Generated Code This option will freeze the state of the generated code and the code generation will be disabled until the user will un check this option All beans and project settings will became read only and it won t be possible to add or remove any beans Processor Expert won t make any changes to the source code Processor expert if it detects any changes since last code generation will offer code generation before switching to the frozen mode View e Project Panel displays the Processor Expert plug in Project panel e Inspector displays inspector window for the currently selected item of the project Bean CPU bean Peripheral Initialization bean Configuration e Bean Selector shows the Bean Selector Bean Selector shows all supported beans in the appropriate version of the Processor Expert plug in including CPU beans e Target CPU Package displays the Target CPU Window in CPU Package view This window displays the target CPU CPU selected as destination with its peripherals
207. xplanation of the configuration purpose or some necessary hardware settings 2 6 Error Window Processor Expert View Error window This window displays errors warnings and hints that are found during e project checking e code generation e running of an external tool Some errors are found right after inconsistent or incorrect data have been entered others during the code generation of a project The single messages mention the bean where the error was found If an error concerns two beans where conflict results for example from using the same on chip peripheral the error will be attributed to both beans If the user clicks the right mouse button a pop up menu is shown allowing user to delete either tools or code generation errors warnings and hints in order to improve the readability of the Error window Errors 2 warnings 2 hints 1 a Y E gt ey Y ERROR There are errors in this bean it is impossible to code design a Y E Button Y ERROR Error in bean setting More details provides Bean Inspector for this bean a Cpu Hint Program must be linked from address 8000H a Smart event code linker Figure 2 32 Processor Expert Error window Pop up Menu The pop up menu invoked by a right mouse button click contains the following items e Delete All Tool Errors Warnings and Hits removes all tool errors warnings and hints listed in the error window e Delete All code generation errors warnings
208. xpression matches is the one that is chosen This means that alternatives are not necessarily greedy For example when matching foolfoot against barefoot only the foo part will match as that is the first alternative tried and it successfully matches the target string This might not seem important but it is important when you are capturing matched text using parentheses wji Also remember that l is interpreted as a literal within square brackets so if you write feelfielfoe You re really only matching feiol Examples foo bar foo matches strings foobar or foofoo 83 Processor Expert User s manual User Interface Metacharacters Subexpressions The bracketing construct may also be used for defining regular expression subexpressions Subexpressions are numbered based on the left to right order of their opening parenthesis The first subexpression has the number 1 Examples foobar 8 10 matches strings which contain 8 9 or 10 instances of the foobar foob 0 9 a r matches foob0r fooblr foobar foobaar foobaar etc Metacharacters Backreferences Metacharacters 11 through 19 are interpreted as backreferences lt n gt matches previously matched subexpression lt n gt Examples 1 matches aaaa and cc 1 also match abab and 123123 2 d 1 matches 13 in double quotes or 4 in single quotes or 77 without quotes etc
209. zation A user can initialize beans by setting their initialization properties in the Bean Inspector Processor Expert generates the initialization code for the peripherals according to the properties of the appropriate beans User can decide whether the bean will be initialized automatically at startup or manually by calling the bean s Init method Easy On chip Peripherals Management Processor Expert knows exactly the relation between allocated peripherals and selected beans When the user chooses a peripheral in the bean properties Processor Expert proposes all the possible candidates but signals which peripherals are allocated already with the icon of the bean allocating the peripheral and also signalizes peripherals that are not compatible with current bean settings with a red exclamation mark In the case of an unrealizable allocation an error is generated Unlike common libraries Embedded Beans are implemented for all possible peripherals with optimal code The most important advantages of the generated modules for driving peripherals are that you can e Select any peripheral which supports bean function and change it whenever you want during design time e Be sure that the bean setting conforms to peripheral parameters e Choose the initialization state of the bean e Choose which methods you want to use in your code and which event you want to handle e Use several beans of the same type with optimal code for each bean The conce

Download Pdf Manuals

image

Related Search

Related Contents

MANUAL DE INSTRUÇÕES PORTUGUÊS  Mr. Coffee AD SERIES Coffeemaker User Manual  

Copyright © All rights reserved.
Failed to retrieve file