id 021l: model based control design and auto-code generation using the r8c christopher myers...
DESCRIPTION
3 Renesas Technology and Solution Portfolio Microcontrollers & Microprocessors #1 Market share worldwide * Analog and Power Devices #1 Market share in low-voltage MOSFET** Solutions for Innovation ASIC, ASSP & Memory Advanced and proven technologies * MCU: 31% revenue basis from Gartner "Semiconductor Applications Worldwide Annual Market Share: Database" 25 March 2010 **Power MOSFET: 17.1% on unit basis from Marketing Eye 2009 (17.1% on unit basis).TRANSCRIPT
ID 021L: Model Based Control Design and Auto-Code Generation using the R8C
Christopher Myers
Director of Software Development
12 October 2010
Version: 1.2
2
Christopher Myers [email protected]
Director of Software Development Responsible for designing and managing development
of SimuQuest product lines Lead Developer of QuantiPhi, a line of code generation
tools that bring a hardware interface into the Simulink modeling environment.
PREVIOUS EXPERIENCE: Working in the area of model-based development
using MATLAB / Simulink since 2003. Production automotive and consumer electronics
experience at Motorola since 2000 Designed high-performance network appliances
designed to provide unparalleled visibility into network usage at Arbor Networks, Inc.
MS, BS from the University of Michigan
3
Renesas Technology and Solution Portfolio
Microcontrollers& Microprocessors
#1 Market shareworldwide *
Analog andPower Devices#1 Market share
in low-voltageMOSFET**
Solutionsfor
InnovationASIC, ASSP& Memory
Advanced and proven technologies
* MCU: 31% revenue basis from Gartner "Semiconductor Applications Worldwide Annual Market Share: Database" 25 March 2010
** Power MOSFET: 17.1% on unit basis from Marketing Eye 2009 (17.1% on unit basis).
44
Renesas Technology and Solution Portfolio
Microcontrollers& Microprocessors
#1 Market shareworldwide *
Analog andPower Devices#1 Market share
in low-voltageMOSFET**
ASIC, ASSP& Memory
Advanced and proven technologies
* MCU: 31% revenue basis from Gartner "Semiconductor Applications Worldwide Annual Market Share: Database" 25 March 2010
** Power MOSFET: 17.1% on unit basis from Marketing Eye 2009 (17.1% on unit basis).
Solutionsfor
Innovation
55
Microcontroller and Microprocessor Line-up
Superscalar, MMU, Multimedia Up to 1200 DMIPS, 45, 65 & 90nm process Video and audio processing on Linux Server, Industrial & Automotive
Up to 500 DMIPS, 150 & 90nm process 600uA/MHz, 1.5 uA standby Medical, Automotive & Industrial
Legacy Cores Next-generation migration to RX
High Performance CPU, FPU, DSC
Embedded Security
Up to 10 DMIPS, 130nm process350 uA/MHz, 1uA standbyCapacitive touch
Up to 25 DMIPS, 150nm process190 uA/MHz, 0.3uA standbyApplication-specific integration
Up to 25 DMIPS, 180, 90nm process 1mA/MHz, 100uA standby Crypto engine, Hardware security
Up to 165 DMIPS, 90nm process 500uA/MHz, 2.5 uA standby Ethernet, CAN, USB, Motor Control, TFT Display
High Performance CPU, Low Power
Ultra Low PowerGeneral Purpose
66
Microcontroller and Microprocessor Line-up
Superscalar, MMU, Multimedia Up to 1200 DMIPS, 45, 65 & 90nm process Video and audio processing on Linux Server, Industrial & Automotive
Up to 500 DMIPS, 150 & 90nm process 600uA/MHz, 1.5 uA standby Medical, Automotive & Industrial
Legacy Cores Next-generation migration to RX
High Performance CPU, FPU, DSC
Embedded Security
Up to 10 DMIPS, 130nm process350 uA/MHz, 1uA standbyCapacitive touch
Up to 25 DMIPS, 150nm process190 uA/MHz, 0.3uA standbyApplication-specific integration
Up to 25 DMIPS, 180, 90nm process 1mA/MHz, 100uA standby Crypto engine, Hardware security
Up to 165 DMIPS, 90nm process 500uA/MHz, 2.5 uA standby Ethernet, CAN, USB, Motor Control, TFT Display
High Performance CPU, Low Power
Ultra Low PowerGeneral Purpose
R8C
16 Bit CISC Superb Noise PerformanceLow Power Consumption
Higher FunctionalityASSP Lineup
Low Pin Count Lineup
7
Innovation: Innovate Faster
8
Model-Based Design
Model-Based Design and Automatic Code Generation is the future of embedded controls. SimuQuest believes that as companies across all industries realize the innovation advantage that it provides, it will play a part in the design of nearly all embedded systems worldwide.
9
Agenda
Introduction to modeling and auto-code generation Introduction to MATLAB / Simulink / Stateflow Lab: Modeling controls in Simulink / Stateflow Discussion of auto-code generation for a target Lab: Generating code for an R8C controller Q&A
10
Key Takeaways
Models helps define requirements Models can be simulated Models can be auto-coded Auto-coding saves you time Auto-coding is powerful!
11
Idea #1
12
Idea #2
QuantiPhi REfor R8C/3X
Model C Code Target
13
What is a Model?
Model = Abstraction
Real World
Outside
Software
Inside
Plant
Controller
14
PlantPlantModelModel
ControlControlModelModel
plant outputcontrol outputcontrol input
15
ControlControlModelModel
16
Example: Engine Controller
17
Plant
Our Ambient Lighting System
Tri-Color LEDs
E8a
Controller
18
PlantPlantModelModel
ControlControlModelModel
plant output• momentary switch + noise • LED colors
control outputPWMs x6
control inputinput switch state
• Process input switches• LED Color? Intensity?• What frequency? Duty cycle?
• Model the input switches• Model PWM to RGB
19
Lab Procedure - Phase 1
InputInputSwitchesSwitches DebounceDebounce LogicLogicNoiseNoise LEDsLEDs
20
Lab Procedure - Phase 2
DebounceDebounce LogicLogicQuantiPhiQuantiPhi
PWMPWMOutputOutput
QuantiPhiQuantiPhiScheduling, Clock Configuration + BuildScheduling, Clock Configuration + Build
QuantiPhiQuantiPhiDigital Digital InputsInputs
21
Our Auto-Coding Toolbox
MATLAB
QuantiPhiRTW Embedded Coder
Simulink & Stateflow
Base computing platform
Modeling platform
Auto-code generation Provides MCU configuration and device drivers.
22
Questions?
23
Start the Lab
Keep your dice turned to the section of the lab you are on. (Instructionsare provided in the lab handout)
Please refer to the Lab Handout and let’s get started!
24
Checking Progress
We are using the die to keep track of where everyone is in the lab. Make sure to update it as you change sections.
When done with the lab, your die will have the 6 pointing up as shown here.
25
Lab Phase 2
26
Typical Auto-Coding Methodologies
Feature Effort =
27
Typical Auto-Coding Methodologies
Feature 1
Feature n
“Application Layer”
Effort =
28
Typical Auto-Coding Methodologies
Feature 1
Feature n
HardwareInterface
Effort =
29
Interfacing With Hardware
InputInputSwitchesSwitches DebounceDebounce LogicLogicNoiseNoise LEDsLEDs
30
Interfacing With Hardware
DebounceDebounce LogicLogicQuantiPhiQuantiPhi
PWMPWMOutputOutput
QuantiPhiQuantiPhiScheduling, Clock Configuration + BuildScheduling, Clock Configuration + Build
QuantiPhiQuantiPhiDigital Digital InputsInputs
SW4 pwm6
31
Another Hardware Abstraction Layer Example
Example of analog counts to engineering units:
32
R8C/3X Code-Gen Considerations
Don’t use floating point! (double, single)
Natural “int” size is 16 bits
Don’t run tasks too quickly (< 1ms for example)
33
Start the Lab – Phase 2
Keep your dice turned to the section of the lab you are on. (Instructionsare provided in the lab handout)
Please refer to the Lab Handout and let’s get started!
34
Checking Progress
We are using the die to keep track of where everyone is in the lab. Make sure to update it as you change sections.
When done with the lab, your die will have the 6 pointing up as shown here.
35
Key Takeaways (Revisited)
Models helps define requirements Models can be simulated Models can be auto-coded Auto-coding saves you time Auto-coding is powerful!
36
Innovation: Innovate Faster
37
Questions?
38
Thank You!