Download
processor expert tips and tricks n.
Skip this Video
Loading SlideShow in 5 Seconds..
Processor Expert™ Tips and Tricks PowerPoint Presentation
Download Presentation
Processor Expert™ Tips and Tricks

Processor Expert™ Tips and Tricks

306 Views Download Presentation
Download Presentation

Processor Expert™ Tips and Tricks

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

  1. Processor Expert™ Tips and Tricks Ruth Rhoades Sr. Product Manager

  2. Agenda • Processor Expert Overview • What is Processor Expert? • CodeWarrior / Processor Expert Support • Processor Expert Terminology/Windows • LAB1—Blinking LED (Timer and I/O) • LAB2— Keyboard Interrupt (KBI) • LAB3— Analog (ADC) and Pulse Width Modulation (PWM) • Managing Code Generation • Using External Libraries • Embedded Bean Store

  3. What is Processor Expert? A rapid application design tool with … • Graphical User Interface which allows an application to be specified by the functionality needed • Automatic code generator which creates tested, optimized C code tuned to the application needs and selected Freescale MCU • Built-in knowledgebase, which immediately flags resource conflicts and incorrect settings Creating… • Hardware Abstraction Layer (HAL) – hardware-dependent, low-level drivers with a known application programming interface (API) Benefits • Eases migration between Freescale devices • Designers don’t have to be intimately familiar with every page of a specification • Errors are caught early in design cycle; therefore, designers get to market faster with higher quality product

  4. Unique in the Market • Processor Expert delivers functionality that is unique in the market. * Software support for ARM competitors

  5. Processor Expert Tools Several approaches • Low level • Use ASM/C (Assembler Support Routines) • Code is specialized • Classical approach • Use primarily C • Reuse of existing code • Use SDK (Software Development Kit) and libraries • Components • Abstraction • Formal description of the algorithm • Modeling (State charts) Device Initialization Processor Expert State Builder

  6. CodeWarrior / Processor Expert Support Processor Expert is integrated into the following CodeWarrior tool suites with support for the indicated Freescale silicon families. • CodeWarrior Development Studio for Microcontrollers • RS08:KA, SA • HC08:AB, AP, AS, AZ, BD, EY, GP, GR, GT, GZ, JB, JG, JK, JL, KX, LB, LD, LJ, LK, LT, LV, MR, QB, QC, QL, QT, QY, RF, SR • HCS08:MC1321x, AC, AW, DE, DN, DV, DZ, EL, EN, GB, GT, JM, JR, JS, LA, LC, LL, QA, QB, QD, QE, QG, RC, RD, RE, RG, SG, SH, SL • ColdFire V1:AC, JM, QE • CodeWarrior Development Studio for HCS12(X) • HCS12: A, B, C, D, DB, DG, DJ, DP, DT, E, GC, H, KG, KT, NE, Q, P, UF • HCS12X: A, D, DG, DP, DQ, DT, EA, EG, EP, EQ, ES, ET, F, HZ, S

  7. CodeWarrior / Processor Expert Support Processor Expert is integrated into the following CodeWarrior tool suites with support for the indicated Freescale silicon families. • CodeWarrior Development Studio for 56800e Digital Signal Controllers • 56800: 5680x, 5682x, 5685x • 56800e:56801x, 56802x, 56803x, 5681xx, 5683xx • CodeWarrior Development Studio for ColdFire Architectures • V2: MCF520x, MCF521x, MCF5221x, MCF5222x, MCF5223x, MCF5225x • V3: MCF532x, MCF5301x, • V4: MCF545x

  8. Terminology and Windows

  9. Processor Expert Terminology What is an Embedded Bean? • Embedded Beans encapsulate the initialization and functionality of an embedded system’s basic elements, such as CPU core, CPU on-chip peripherals, FPGAs, stand-alone peripherals, virtual devices and pure software algorithms. • Embedded Beans provide a hardware abstraction layer (HAL), which eases migration between devices. What is a template? • Templates are Embedded Beans, which have already been either partially or completely configured • Templates can be used to share pre-defined settings with a team of designers

  10. Processor Expert™ Windows Processor Expert is integrated into the HC(S)08/RS08, HCS12(X) and DSC CodeWarrior tool suites. It adds the following windows to those tool suites: • Processor Expert Panel in Project Manager • Target CPU • Bean Selector • Bean Inspector

  11. Processor Expert™ Windows • Target CPU Window: • Displays selected target microcontroller with its peripherals and pins • Displays current resource usage by selected beans (i.e. peripherals, pins) • Data directions of single pins are indicated by blue arrows when configured by a bean • Pins associated with a peripheral are highlighted when mouse hovers over a peripheral • Help is available for pins and peripherals by moving the mouse over the item • Several display modes are supported. To change mode - push a button in the left side menu.

  12. Processor Expert™ Windows • Bean Selector Window: • Shows supported Embedded Beans including CPU beans and bean templates. • Allows an Embedded Bean or template to be added to the project. • Embedded Beans can be listed by categories, alphabetically or on-chip peripherals. • Right-click on a bean to add it to the project or to get help. • An assistant is also available to guide bean selection

  13. Processor Expert™ Windows • Bean Inspector Window – Properties Tab: • Double-clicking on an Embedded Bean opens the Bean Inspector window • A red exclamation point means one of the bean’s properties is either blank or in conflict with another. • Help is available for the fields by moving the mouse over them. • The Basic, Advanced and Expert buttons at the bottom of the window control the level of detail visible.

  14. Processor Expert™ Windows • Bean Inspector Window – Methods Tab: • Shows functions available for the Embedded Bean • Allows designer to select functions to be included in his application • Code is only generated for • selectedfunctions • The code will appear in the .c file • for this Embedded Bean in the “Generated Code” folder • Holding the mouse over a • “method” causes a description • of the function’s parameters and return values to be displayed

  15. Processor Expert™ Windows • Bean Inspector Window – Events Tab: • Shows the events for the current Embedded Bean • Allows events to be renamed • Events are usually called by interrupts • Events are defined in Events.c in the “User Modules” folder

  16. Lab 1 Blinking LED (Timer and I/O)

  17. LAB 1 – Blinking LED • This demonstration shows how to create a project with Processor Expert. It shows how to… • Add and configure Embedded Beans to support selected peripherals • Generate the code • Test the functionality on a simple application • The demonstration uses a DEMOQE128 board. • The application uses a timer to blink a LED every 250 ms. • Set Timer (TPM10) to generate an interrupt every 250ms • Configure output on LED1 (PTC0)

  18. Processor Expert Project Design Workflow Select Embedded Beans from library and add them to project Configure it Create a new project Build and debug Write application code … and verify settings Generate source code

  19. LAB 1 - Blinking LED • Click “Create New Project”

  20. LAB 1 - Blinking LED • Select “MC9S08QE128” • Select “P&E Multilink/Cyclone Pro • Click “Next” • Type “Lab1.mcp” in the Project name box • Set the Sub-Directory in the Location box • Click “Next”

  21. LAB 1 - Blinking LED • Select “Processor Expert” • Click “Next” • Leave everything as default • Click “Next”

  22. LAB 1 - Blinking LED • Leave as default • Click “Finish” • Wait for CW to bring up the Project Windows • Check all the boxes as shown • Click “OK”

  23. LAB 1 - Blinking LED • You should have a screen that looks like this at this time

  24. LAB 1 - Blinking LED • Select the “TimerInt” bean in the Bean Selector Window • Select “TPM10” for the Period interrupt source

  25. LAB 1 - Blinking LED • Select the pre-calculated value of 250ms • Click “OK” • In the Bean Inspector window, you should see Interrupt period has been updated with 250ms

  26. LAB 1 - Blinking LED • Select “BitIO” bean in the Bean Selector window • Configure as shown: PTC0_TPM3CH0 No Pull-up Drive Strength = High Direction = Output • Select “Methods” tab • Select “Generate code” for the “NegVal” function

  27. LAB 1 - Blinking LED • Click “Generate Code” from the Processor Expert tab

  28. LAB 1 - Blinking LED • Select “Files” tab • Open the “Event.c” file • Scroll down to function TI1_OnInterrupt

  29. LAB 1 - Blinking LED • Select “Processor Expert ” tab • Expand the “Bit1:BitIO” bean • Drag and Drop the “NegVal” function over to here

  30. LAB 1 - Blinking LED • Click the “Debug” button This will launch the Debugger • Click “Connect” to connect to the P&E Multilink BDM

  31. LAB 1 - Blinking LED • Click “Yes” to load image • Click green “Run” button • Is your Demo Board light blinking?

  32. LAB 2 Keyboard Interrupt (KBI)

  33. LAB 2 – KBI • This demonstration shows how to create a project with Processor Expert. It shows how to… • Add and configure Embedded Beans to support selected peripherals • Generate the code • Test the functionality on a simple application • The demonstration uses a DEMOQE128 board. • The application uses a switch to toggle the LED. • Configure keyboard interrupt on PTA2 • Configure output on LED2 (PTC2)

  34. LAB 2 – KBI • Select “KBI” bean in the Bean Selector window • Enable Pin 2 (PTA2) • Enable Pull-up • Interrupt Polarity set for Low level/Falling Edge • Enable KBI request

  35. LAB 2 – KBI • Select “BitIO” bean in the Bean Selector window • Configure as shown: PTC2_TPM3CH2 No Pull-up Drive Strength = High Direction = Output • Select “Methods” tab • Select “Generate code” for the “NegVal” method

  36. LAB 2 – KBI • Select CPU bean in the Project window • Select the Methods Tab • Select generate code for Delay100US

  37. LAB 2 – KBI • Click “Generate Code” in the Processor Expert menu

  38. LAB 3 – ADC & PWM • Select “Files” tab • Open “Event.c” • Scroll to “KBI_OnInterrupt”

  39. LAB 2 – KBI • Select Processor Expert Tab • Expand CPU bean • Drag and drop Delay100US • Enter 30 as the delay parameter Cpu_Delay100uS(30); • Expand the BitIO bean • Drag and drop NegVal

  40. LAB 2- KBI • Click the “Debug” button. This will launch the Debugger • Click “Connect” to connect to the P&E Multilink BDM

  41. LAB 2 – KBI • Click “Yes” to load image • Click green “Run” button • Press the SW (PTA2) to see LED (PTC2) toggle

  42. LAB 3 Analog (ADC) and Pulse Width Modulation (PWM)

  43. LAB 3 – ADC & PWM • This demonstration shows how to create a project with Processor Expert. It shows how to… • Add and configure Embedded Beans to support selected peripherals • Generate the code • Test the functionality on a simple application • The demonstration uses a DEMOQE128 board. • The application uses apotentiometer to dim/brighten an LED. • Configure ADC input to Port A0 (Blue POT). • Configure the PWM to LED (Port C1). • Use the ACD value to configure the duty cycle of the PWM.

  44. LAB 3 – ADC & PWM • Select “ADC” Bean from Bean Selector Window.

  45. LAB 3 – ADC & PWM • Select Port A0 • Use 5.7uSec for Conversion time.

  46. LAB 3 – ADC & PWM • Select the “Method” Tab • Toggle to “Generated Code” to “Start” (Continuous Mode)

  47. LAB 3 – ADC & PWM • Select Port C1 • Use “1ms” for Period. • Use “1uSec” for Starting Pulse width

  48. LAB 3 – ADC & PWM • Click “Generate Code” in the Processor Expert menu

  49. LAB 3 – ADC & PWM • Select “Files” tab • Open “Event.c” • Scroll to “AD1_OnEnd”

  50. LAB 3 – ADC & PWM • Select “Processor Expert” tab • Add code to “AD1_OnEnd” • Drag n Drop AD1_GetValue16(&x)