Presentation is loading. Please wait.

Presentation is loading. Please wait.

Infineon Technologies Corp. June 99 1 HOT167-1 Version 2.0 F PWMmax = 1 2 8 x 50ns = 78 kHz Pulse Width Modulation Unit (PWM) (20 MHz)  4 independent.

Similar presentations


Presentation on theme: "Infineon Technologies Corp. June 99 1 HOT167-1 Version 2.0 F PWMmax = 1 2 8 x 50ns = 78 kHz Pulse Width Modulation Unit (PWM) (20 MHz)  4 independent."— Presentation transcript:

1 Infineon Technologies Corp. June 99 1 HOT167-1 Version 2.0 F PWMmax = 1 2 8 x 50ns = 78 kHz Pulse Width Modulation Unit (PWM) (20 MHz)  4 independent PWM channels each with its own time-base 50ns or 12.8µs timer-resolution provides a very wide frequency range to generate PWM signals Programmable output polarity Up to 78 KHz at 8-bit PWM resolution  Four operation modes Standard, edge-aligned PWM Symmetrical, center-aligned PWM for asynchronous motor control Burst-mode for modulated PWM signals Single-shot mode

2 Infineon Technologies Corp. June 99 2 HOT167-1 Version 2.0 PWM unit Frequencies and Resolution PMW Unit Frequencies and Resolution in Mode 1 Operation (SYMMETRICAL) PMW Unit Frequencies and Resolution in Mode 0 Operation (EDGE-ALIGNED) Resolution Input Clock (CPU @ 20 MHz) 8 Bit10 Bit12 Bit14 Bit16 Bit CPU Clock (50ns Resolution) CPU Clock / 64 (3.2µs Res.) 39.1 KHz 610 Hz 9.77 KHz 152.6 Hz 2.44 KHz 38.15 Hz 610 Hz 9.54 Hz 152.6 Hz 2.4 Hz Resolution Input Clock (CPU @ 20 MHz) 8 Bit10 Bit12 Bit14 Bit16 Bit CPU Clock (50ns Resolution) CPU Clock / 64 (3.2µs Res.) 78.1 KHz 1.22 KHz 19.5 KHz 305 Hz 4.88 KHz 76.3 Hz 1.22 KHz 13.1 Hz 305 Hz 4.77 Hz

3 Infineon Technologies Corp. June 99 3 HOT167-1 Version 2.0 Run Enable Timer PT0-PT3 Comparator Shadow Register INTR Flag FlagINTR PWM unit Function Diagram Input Mode Control Pulse Width Reg. PW0-PW3 Shadow Register 4 identical PWM Channels with common Interrupt Control Register Period Register PP0-PP3 Output Polarity Enable 20 MHz 78 KHz at 20 MHz CPU Clock PWM Outputs Comparator up/down,clear

4 Infineon Technologies Corp. June 99 4 HOT167-1 Version 2.0 PWM unit - Mode 0 and 1 Contents of the PWx Register Interrupt Request and Latch of the Shadow Register Contents of the PWx Register IR and Latch of the Shadow Register Timer Period Contents of the Period Register (PPx) PWM Mode 0: Standard PWM’s or Edge-Aligned PWM’s PWM Mode 1: Symmetrical or Center-Aligned PWM’s PWM Signal If all channels are programmed to mode 0, edge-aligned PWM signals will be generated. A duty cycle from 0 to 100% is programmable If all channels are programmed to mode 1, center-aligned PWM signals will be generated. A duty cycle from 0 to 100% is programmable PWM Signal Possible PWM Signals from other channels programmed to the same mode: PWMx PWMy

5 Infineon Technologies Corp. June 99 5 HOT167-1 Version 2.0 PWM unit - Burst Mode / Single Shot Mode Burst Mode : Burst Sequence by combining PWM channel 0 and 1 Single Shot : Only one PWM Pulse is generated Mode available for channel 2 and 3 Period Value Pulse width Value Period Value Internal Signal of Channel 0 Period of Timer PT1 Int. Signal of Channel 1 Output Result: Channel 1 is modulated by Channel 0 Output Signal Timer is automatically stopped Timer is released by Software again The Timer can be dynamically changed to lengthen (retrigger) or shorten the output pulse Timer Period Timer Period PT0

6 Infineon Technologies Corp. June 99 6 HOT167-1 Version 2.0 Overview Port Structure  The Port lines provide the connection to the external world 111 Port lines on the C167  All Port lines are individually addressable and all I/0 lines are independently programmable for input or output  Each Port line is dedicated to one or more peripheral functions  Each Port is protected with fast diodes  Programmable open drain buffers P2, 3, 6, 7, 8 on the C167

7 Infineon Technologies Corp. June 99 7 HOT167-1 Version 2.0 Direction Register Output Latch Alternate Output Alternate Enable ReadDirection Write Clock Alternate Input Internal Bus Overview Port Structure Buffer Mux Buffer Input Latch Open Drain Control VCC Vss Port Pin ESD structure

8 Infineon Technologies Corp. June 99 8 HOT167-1 Version 2.0 Exercise 7PWM_1 - Two edge-aligned PWM Signals with the PWM unit  Objective: Generate an edge-aligned 25% duty cycle PWM Signal using PWM channel 1 (Period: 1ms) Generate an edge-aligned 50% duty cycle PWM Signal using PWM channel 3 (Period: 1ms)

9 Infineon Technologies Corp. June 99 9 HOT167-1 Version 2.0 * C167CS not yet supported by DAvE V1.0 CD ROM. See “Hints regarding DAvE.” Exercise 7PWM_1- DAvE Configurations  Start DAvE  Create new Project with microcontroller C167CR/CS* Project name: 7pwm_1 Select project path: c:\hot167_1\7pwm_1  Project Settings: General: -Select Keil Compiler, SMALL model System Clock: -External Oscillator Frequency: Set to 5 MHz Startup Configuration: -Bus Type after Reset: Set to 16 bit DEMUX -Write Configuration: Pin #WR and #BHE operates as #WRL and #WRH Save & close

10 Infineon Technologies Corp. June 99 10 HOT167-1 Version 2.0 Exercise 7PWM_1 - DAvE Configurations (cont.)  Configure PWM: Control: -Configure Channel 1: -General: Use PWM Channel 1 -PWM Channel Mode Control: Standard PWM (edge aligned) -Channel Output Enable: Enable Channel 1 output signal -PWM Timer Start Control: Start PWM Timer 1 after init -Period: Required Period: 1000 us -Duty Cycle: Required Duty Cycle: 25% -Save & Close -Configure Channel 3: -General: Use PWM Channel 3 -PWM Channel Mode Control: Standard PWM (edge aligned) -Channel Output Enable: Enable Channel 3 output signal -PWM Timer Start Control: Start PWM Timer 3 after init -Period: Required Period: 1000 us -Duty Cycle: Required Duty Cycle: 50% -Save & Close

11 Infineon Technologies Corp. June 99 11 HOT167-1 Version 2.0 Exercise 7PWM_1 - DAvE Configurations (cont.)  Configure PWM (cont.) Functions: -Include PWM initialization function PWM_vInit Save & Close  Configure Port 7: Port 7: -DAvE has reserved P7.1 and P7.3 for the PWM alternate functions with 0 as initial output -Don’t enable general purpose IO! Functions: -Include port initialization function IO_vInit Save & close  Generate Code

12 Infineon Technologies Corp. June 99 12 HOT167-1 Version 2.0 Exercise 7PWM_1 - µVision2 Configurations  Start µVision2  New Project  Add Files: Go to Project | Targets, Groups, Files… Click ‘Groups / Add Files’ Select ‘Source Group 1’ Click ‘Add Files to Group’ Select all C files and click ‘add’ Enter file name ‘start.asm’, click ‘add’ (Assembler Startup File) Click ‘Close’ and ‘OK’ Double-click all files in the Project Window to open them  Select Target Hardware (kitCON-167): Go to Project | Options for Target ‘Target 1’ Go to ‘Debug’ tab Click ‘Settings’ (upper right hand corner) Monitor configuration: select ‘Phytec KC167’ Click ‘OK’ twice

13 Infineon Technologies Corp. June 99 13 HOT167-1 Version 2.0 Exercise 7PWM_1 - µVision2 Configurations (cont.)  Edit MAIN.C: include endless loop in main(): // USER CODE BEGIN (Main,2) while(1) {}; // USER CODE END

14 Infineon Technologies Corp. June 99 14 HOT167-1 Version 2.0 Exercise 7PWM_1 - Running the Program  Reset Target Hardware (Press Reset Button on Starter Kit)  Build Project (Project | Rebuild Target)  Run integrated Debugger from within µVision2 Debug | Start / Stop Debug Session (click ‘OK’ when prompted) The Debugger will load the Keil Monitor into the kitCON-167’s RAM via bootstrap loader Object file c:\hot167_1\7pwm_1\7pwm_1 will be loaded automatically and the debugger will go to main().  Go! (Debug | Go)  Program Verification: Connect Scope to P7.1 / POUT1 (connector X3 pin 121) P7.3 / POUT3 (connector X3 pin 122)

15 Infineon Technologies Corp. June 99 15 HOT167-1 Version 2.0 Exercise 7PWM_2 - Two center-aligned PWM Signals with the PWM unit  Objective: Generate a center-aligned 25% duty cycle PWM Signal using PWM channel 1 (Period: 250 us) Generate a center-aligned 50% duty cycle PWM Signal using PWM channel 3 (Period: 250us)

16 Infineon Technologies Corp. June 99 16 HOT167-1 Version 2.0 * C167CS not yet supported by DAvE V1.0 CD ROM. See “Hints regarding DAvE.” Exercise 7PWM_2 - DAvE Configurations  Start DAvE  Create new Project with microcontroller C167CR/CS* Project name: 7pwm_2 Select project path: c:\hot167_1\7pwm_2  Project Settings: General: -Select Keil Compiler, SMALL model System Clock: -External Oscillator Frequency: Set to 5 MHz Startup Configuration: -Bus Type after Reset: Set to 16 bit DEMUX -Write Configuration: Pin #WR and #BHE operates as #WRL and #WRH Save & close

17 Infineon Technologies Corp. June 99 17 HOT167-1 Version 2.0 Exercise 7PWM_2 - DAvE Configurations (cont.)  Configure PWM: Control: -Configure Channel 1: -General: Use PWM Channel 1 -PWM Channel Mode Control: Symmetrical PWM (center aligned) -Channel Output Enable: Enable Channel 1 output signal -PWM Timer Start Control: Start PWM Timer 1 after init -Period: Required Period: 250 us -Duty Cycle: Required Duty Cycle: 25% -Save & Close -Configure Channel 3: -General: Use PWM Channel 3 -PWM Channel Mode Control: Symmetrical PWM (center aligned) -Channel Output Enable: Enable Channel 3 output signal -PWM Timer Start Control: Start PWM Timer 3 after init -Period: Required Period: 250 us -Duty Cycle: Required Duty Cycle: 50% -Save & Close

18 Infineon Technologies Corp. June 99 18 HOT167-1 Version 2.0 Exercise 7PWM_2 - DAvE Configurations (cont.)  Configure PWM (cont.) Functions: -Include PWM initialization function PWM_vInit Save & Close  Configure Port 7: Port 7: -DAvE has reserved P7.1 and P7.3 for the PWM alternate functions with 0 as initial output Functions: -Include port initialization function IO_vInit Save & close  Generate Code

19 Infineon Technologies Corp. June 99 19 HOT167-1 Version 2.0 Exercise 7PWM_2 - µVision2 Configurations  Start µVision2  Open Project c:\hot167_1\7pwm_1\7pwm_1.uv2 (Project | Open Pr.)  Add Files: Go to Project | Targets, Groups, Files… Click ‘Groups / Add Files’ Select ‘Source Group 1’ Click ‘Add Files to Group’ Select all C files and click ‘add’ Enter file name ‘start.asm’, click ‘add’ (Assembler Startup File) Click ‘Close’ and ‘OK’ Double-click all files in the Project Window to open them  Select Target Hardware (kitCON-167): Go to Project | Options for Target ‘Target 1’ Go to ‘Debug’ tab Click ‘Settings’ (upper right hand corner) Monitor configuration: select ‘Phytec KC167’ Click ‘OK’ twice

20 Infineon Technologies Corp. June 99 20 HOT167-1 Version 2.0 Exercise 7PWM_2 - µVision2 Configurations (cont.)  Edit MAIN.C: include endless loop in main(): // USER CODE BEGIN (Main,2) while(1) {}; // USER CODE END

21 Infineon Technologies Corp. June 99 21 HOT167-1 Version 2.0 Exercise 7PWM_2 - Running the Program  Reset Target Hardware (Press Reset Button on Starter Kit)  Build Project (Project | Rebuild Target)  Run integrated Debugger from within µVision2 Debug | Start / Stop Debug Session (click ‘OK’ when prompted) The Debugger will load the Keil Monitor into the kitCON-167’s RAM via bootstrap loader Object file c:\hot167_1\7pwm_1\7pwm_1 will be loaded automatically and the debugger will go to main().  Go! (Debug | Go)  Program Verification: Connect Scope to P7.1 / POUT2 (connector X3 pin 121) P7.3 / POUT4 (connector X3 pin 123)


Download ppt "Infineon Technologies Corp. June 99 1 HOT167-1 Version 2.0 F PWMmax = 1 2 8 x 50ns = 78 kHz Pulse Width Modulation Unit (PWM) (20 MHz)  4 independent."

Similar presentations


Ads by Google