Differences Between FTF and FAE/DFAE Training Sessions

advertisement
Processor Expert™ Tips and Tricks
Ruth Rhoades
Sr. Product Manager
TM
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
Agenda
►Processor
•
•
Expert Overview
What is Processor Expert?
CodeWarrior / Processor Expert Support
►Processor
Expert Terminology/Windows
►LAB1—Blinking
►LAB2—
LED (Timer and I/O)
Keyboard Interrupt (KBI)
►LAB3— Analog
►Managing
(ADC) and Pulse Width Modulation (PWM)
Code Generation
►Using
External Libraries
►Embedded Bean Store
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
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…
Layer (HAL) – hardware-dependent, low-level drivers
with a known application programming interface (API)
► Hardware Abstraction
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
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
Unique in the Market
► Processor
Expert delivers functionality that is unique in the market.
CodeWarrior Processor
Expert
RealView Tools
Suite
Green Hills
IAR
(VisualSTATE
6.1)
HITEX
(startEasy)
Keil
Yes
Yes
Yes
Yes
Yes
Yes
Configurable
Application Notes
Yes
No
No
Yes
Yes
No
Integrated
Knowledgebase
Yes
No
No
No
No
No
Generates Initialization
Code
Yes
No
No
Yes
Yes
No
Generates Low Level
Drivers
Yes
No
No
Yes
No
No
Tools to Add Higher
Level Drivers
Yes
No
No
No
No
No
Integration with UML
Modeling Tools
Yes
Yes
Yes
Yes
No
Yes
Graphical Interface
* Software support for ARM competitors
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
Processor Expert Tools
Several approaches
•
Low level
Device
Initialization

Use ASM/C (Assembler Support
Routines)
 Code is specialized
•
Classical approach
Processor
Expert

Use primarily C
 Reuse of existing code
 Use SDK (Software Development Kit) and
libraries
–
•
Components
Abstraction
State
Builder

Formal description of the algorithm
 Modeling (State charts)
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
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
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
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
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
Terminology and Windows
TM
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
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
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
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
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
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.
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
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
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
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.
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
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
selected functions
• 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
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
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
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
Lab 1
Blinking LED (Timer and I/O)
TM
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
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)
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
Processor Expert Project Design Workflow
Create a new project
Build and debug
Select Embedded Beans
from library and add them
to project
Write application code
Generate source code
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
Configure it
… and verify settings
TM
LAB 1 - Blinking LED
►Click
“Create New Project”
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
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”
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
LAB 1 - Blinking LED
►Select
►Click
“Next”
►Leave
►Click
“Processor Expert”
everything as default
“Next”
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
LAB 1 - Blinking LED
► Leave
► Click
as default
“Finish”
► Wait
for CW to bring up the
Project Windows
► Check
all the boxes as
shown
► Click
“OK”
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
LAB 1 - Blinking LED
►You
should have a screen that looks like this at this time
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
LAB 1 - Blinking LED
►Select
the “TimerInt” bean in the Bean Selector Window
►Select “TPM10” for the Period interrupt source
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
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
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
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
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
LAB 1 - Blinking LED
► Click
“Generate Code” from the
Processor Expert tab
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
LAB 1 - Blinking LED
► Select
► Open
“Files” tab
the “Event.c” file
► Scroll
down to function
TI1_OnInterrupt
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
LAB 1 - Blinking LED
► Select
“Processor
Expert ” tab
► Expand
the “Bit1:BitIO” bean
► Drag
and Drop the “NegVal”
function over to here
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
LAB 1 - Blinking LED
► Click
the “Debug” button
This will launch the
Debugger
► Click
“Connect” to
connect to the P&E
Multilink BDM
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
LAB 1 - Blinking LED
► Click
“Yes” to load image
► Click
green “Run” button
► Is
your Demo Board light
blinking?
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
LAB 2
Keyboard Interrupt (KBI)
TM
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
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)
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
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
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
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
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
LAB 2 – KBI
► Select
CPU bean in the
Project window
► Select
the Methods Tab
► Select
generate code
for Delay100US
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
LAB 2 – KBI
► Click
“Generate Code” in
the Processor Expert menu
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
LAB 3 – ADC & PWM
► Select
► Open
“Files” tab
“Event.c”
► Scroll
to
“KBI_OnInterrupt”
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
LAB 2 – KBI
► Select
Processor Expert Tab
► Expand
CPU bean
► Drag
and drop Delay100US
► Enter
30 as the delay parameter
Cpu_Delay100uS(30);
► Expand
► Drag
the BitIO bean
and drop NegVal
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
LAB 2- KBI
► Click
the “Debug”
button. This will launch
the Debugger
► Click
“Connect” to
connect to the P&E
Multilink BDM
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
LAB 2 – KBI
► Click
“Yes” to load image
► Click
green “Run” button
► Press
the SW (PTA2)
to see LED (PTC2) toggle
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
LAB 3
Analog (ADC) and Pulse Width Modulation (PWM)
TM
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
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 a potentiometer 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.
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
LAB 3 – ADC & PWM
► Select
“ADC” Bean from Bean
Selector Window.
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
LAB 3 – ADC & PWM
► Select
Port A0
► Use
5.7uSec for
Conversion time.
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
LAB 3 – ADC & PWM
► Select
the “Method” Tab
► Toggle
to “Generated Code”
to “Start” (Continuous Mode)
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
LAB 3 – ADC & PWM
► Select
► Use
Port C1
“1ms” for Period.
► Use
“1uSec” for
Starting Pulse width
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
LAB 3 – ADC & PWM
► Click
“Generate Code” in
the Processor Expert menu
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
LAB 3 – ADC & PWM
► Select
► Open
“Files” tab
“Event.c”
► Scroll
to
“AD1_OnEnd”
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
LAB 3 – ADC & PWM
► Select
“Processor
Expert” tab
► Add
code to
“AD1_OnEnd”
► Drag
n Drop
AD1_GetValue16(&x)
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
LAB 3 – ADC & PWM
► Drag
and Drop
PWM1_SetRatio16(x)
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
LAB 3 – ADC & PWM
► Select
“Files” tab
► Open
“Lab3.c”
► Scroll
to “main”
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
LAB 3 – ADC & PWM
► Select
“Processor
Expert” tab
► Add
code to “main”
► Drag
n Drop
AD1_Start()
► Uncomment
the
example “for loop”
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
LAB 3 – ADC & PWM
► Click
the “Debug”
button. This will launch
the Debugger
► Click
“Connect” to
connect to the P&E
Multilink BDM
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
LAB 3 – ADC & PWM
► Click
“Yes” to load image
► Click
green “Run” button
► Turn
the Blue Knob on
the Demo Board to dim
LED2
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
Managing Code Generation
TM
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
Code Generation
►C
code is generated when…
“Generate Code” is selected in the
Processor Expert menu, or
• MAKE is selected, or
• DEBUG is selected
•
► Code
in “Generated Code” folder
CANNOT be modified and includes…
•
C module for every Embedded Bean in
the project
• IO_map.c file containing register
definitions
• Vectors.c, containing the constant
interrupt vector table
► Code
in “User Modules” folder CAN
be modified and includes…
•
C module containing the main( )
function
• Events.c and Events.h for interrupt
service routines
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
Managing Code Generation
►Processor
•
•
•
•
For one module
For one Embedded Bean
For whole project
Completely disable Processor Expert
►Allows
•
•
Expert has the ability to stop code generation
you to control code generation
Generate initial code with Process Expert
Disable code generation

Allows you to modify the generated code

Processor Expert will NOT overwrite changes
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
Disabling Code Generation
►Disable
►Click
code generation for one module
the right button on module and select
•
Code Generation -> Don’t Write
•
The bean module can’t be disabled

Disable code generation for Embedded Bean instead
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
Disabling Code Generation
►Disable
►Click
•
code generation for one bean
the right button on Embedded Bean and select
Code Generation -> Don’t Write Generated Bean Modules
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
Disabling Code Generation
►Disable
►Use
code generation for whole project
the command Processor Expert -> Freeze Generated Code
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
Disabling Code Generation
► “Freeze
generated code” freezes the Processor Expert settings and
disables code generation
•
•
•
It is still possible to see the settings
Settings cannot be changed or manipulated (IDE items are grayed)
It’s recommended to
re-generate the code
when un-freezing
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
Disabling Code Generation
► Disable
Processor Expert completely
► Use
command Processor Expert -> Suspend Processor Expert for
<project>.mcp
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
Disabling Code Generation
►This
•
•
command:
Stops code generation
Uninstalls the Processor Expert tab from project
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
Using External Libraries
TM
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
Add External Library
► Copy
the library and header files
into the <project directory>/CODE
► Right
click on the “User Modules”
folder in the Processor Expert Tab.
► Select Add
Files…
► When
the Add Files dialog
appears, choose the files and they
will be added to the project.
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
Configure Processor Expert
►Double
click on the CPU bean
to open the Bean Inspector
►Select
the Used tab
►Expand
►Select
I/O Ports
port PORTTA
►Double
click on the item.
“Used by external device” will
appear
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
Summary
►Advantages
•
Existing library code can be used with applications developed with
Processor Expert.

•
For example: driver for a specific external device can be used.
Libraries written in assembly can be easily used in C applications.
►Disadvantages
•
If the source code is not available (only object file is available), then the
application must be developed with the same compiler.
►Conclusions
•
•
Combining existing library code with code generated by Processor
Expert will rapidly decrease cycle time.
Existing solutions can be quickly enhanced
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
Embedded Bean Store
TM
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
Embedded Bean Store
► Processor
Expert provides Freescale with an infrastructure to
deliver additional software capability
•
•
Software can be encapsulated using Bean Wizard
Additional Embedded Beans can easily be integrated into CodeWarrior
Development environment
► Embedded
•
•
Bean Store is now available
URL is http://www.freescale.com/BeanStore
Embedded Beans available for following architectures

HC08, HCS08, RS08
 ColdFire V1, V2, V3, V4
 HCS12(X)
•
Prices start at $125 per bean
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
Embedded Bean Store
Bean Categories
•
•
•
•
•
•
•
•
•
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
Analog
Communictions
Data Files
Display
Interrupts
Memory
Operating System
Port I/O
Timer
TM
Embedded Bean Store
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
Embedded Bean Store
Freescale Semiconductor Confidential and Proprietary Information. Freescale™ and the Freescale logo are trademarks
of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © Freescale Semiconductor, Inc. 2006.
TM
Download