You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merge in MCU16CE/dspic33ck-power-pwm-phase-shift from ~M91406/dspic33ck-power-pwm-phase-shift:code-maintenance to develop
* commit 'd4597ba97b54131d8a6e15103729a75d38ee9d49':
* Updated README file fixing data sheet links, toolchain versions and copyright dates
* Updated Changelog with mode information about latest tool chain versions used
Microchip Code Configurator Update * Updated MCC Plug-In version to require v5.3.7 or later * Updated mc3 file contents to work with core version 4.85.1 or later * Regenerated output
* Updated deployment scripts
* Changed label of PWM Module register set from P33C_PWM_SFRSET_t to P33C_PWM_MODULE_t
* Removed obsolete vitrual folder from MPLAB X project explorer
* Switched XC16 compiler version to v2.00 * Switched Device File Pack (DFP) to version 1.10.341
* Removed interrupt register bits, which are not supported by DFP versions v1.5.135 and later
* Fixed typos in leading comment of main.c
* Updated gitignore file filtering clutter of MPLAB X IDE 6.05 and later
//Branch(s) to be deployed, if multiple branches use comma separator. DEPLOY_BRANCH_LIST is the target branch of the PR.
34
34
DEPLOY_BRANCH_LIST = "master"
35
35
/*When using the main.json schema version 1.3.0 or higher, the PORTAL will first reject registration attempt when an unapproved keyword is found, but can be forced to accept.
Learning how to use the High Resolution PWM Module of dsPIC33C MP devices, Lab 4:
15
17
Code example for dsPIC33CK and dsPIC33CH devices showing a basic configuration of the high-resolution PWM module using two PWM generator channels generating a Phase-Shifted PWM waveforms
16
18
17
19
- - -
18
20
19
21
## Related Documentation
20
-
-[dsPIC33CK256MP508 Family Data Sheet](https://ww1.microchip.com/downloads/en/DeviceDoc/dsPIC33CK256MP508-Family-Data-Sheet-DS70005349G.pdf)
21
-
-[dsPIC33CK256MP508 Family Silicon Errata and Data Sheet Clarification](https://ww1.microchip.com/downloads/en/DeviceDoc/dsPIC33CK256MP508-Family-Silicon-Errata-and-Data-Sheet-Clarification-DS80000796G.pdf)
22
-
-[dsPIC33CH512MP508 Family Data Sheet](http://ww1.microchip.com/downloads/en/DeviceDoc/dsPIC33CH512MP508-Family-Data-Sheet-DS70005371D.pdf)
23
-
-[dsPIC33CH512MP508 Family Silicon Errata and Data Sheet Clarification](http://ww1.microchip.com/downloads/en/DeviceDoc/dsPIC33CH512MP508-Family-Silicon-Errata-and-Data-Sheet-Clarification-DS80000805F.pdf)
22
+
23
+
-[dsPIC33CK256MP508 Family Data Sheet](https://www.microchip.com/70005349)
24
+
-[dsPIC33CK256MP508 Family Silicon Errata and Data Sheet Clarification](https://www.microchip.com/80000796)
25
+
-[dsPIC33CH512MP508 Family Data Sheet](http://www.microchip.com/70005371)
26
+
-[dsPIC33CH512MP508 Family Silicon Errata and Data Sheet Clarification](http://www.microchip.com/80000805)
24
27
25
28
**Please always check for the latest data sheets on the respective product websites:**
After the device has been programmed and the MCU starts up, a 90 degrees phase shift between the two synchronized PWM Generators is generated see below screen capture. Both PWM Generator #1 and #3 are configured in complementary mode with 200 kHz frequency and 50% duty cycle waveform outputs. PWM Generator 1 output is available at PWM1H/L pins while PWM Generator 3 output is available at PWM3H/L pins.
61
+
62
+
After the device has been programmed and the MCU starts up, a 90 degrees phase shift between the two synchronized PWM Generators is generated see below screen capture. Both PWM Generator #1 and #3 are configured in complementary mode with 200 kHz frequency and 50% duty cycle waveform outputs. PWM Generator 1 output is available at PWM1H/L pins while PWM Generator 3 output is available at PWM3H/L pins.
This code example builds on previous code examples showing how to use Microchip Code Configurator (MCC) to set up device clock domains.
73
-
Although MCC also supports configuration tools for the High Resolution PWM module, PWM configuration in this example builds on generic peripheral drivers to help users better understand the peripheral architecture and key aspects of specific configurations and operating modes.
80
+
This code example builds on previous code examples showing how to use Microchip Code Configurator (MCC) to set up device clock domains.
81
+
Although MCC also supports configuration tools for the High Resolution PWM module, PWM configuration in this example builds on generic peripheral drivers to help users better understand the peripheral architecture and key aspects of specific configurations and operating modes.
74
82
In each PWM example code project the PWM configuration procedure is located in the user file pwm.c, where each register bit required to achieve/enable the specific function or mode of interest is set and its function described with comments.
75
83
Once users are familiar with the architecture, features and capabilities, both configuration options (generic peripheral library or MCC) may be used.
76
84
77
85
#### a) Project Directory Structure <br/>
86
+
78
87
The project contains four sub-directories
88
+
79
89
1. config: location of all hardware abstraction header files
80
-
2. common: location of generic peripheral drivers
90
+
2. common: location of generic peripheral drivers
81
91
3. MCC Generated Files: all device configuration files auto-generated by MCC
82
92
4. root: application user code
83
93
84
-
On the hard drive, main.c/h are located in the MPLAB X project directory.
85
-
All other user files, incl. peripheral drivers, are located in the sub-directory *sources*.
86
-
Files generated by MCC are always located in their own sub-directory *mcc_generated-files*
94
+
On the hard drive, main.c/h are located in the MPLAB X project directory.
95
+
All other user files, incl. peripheral drivers, are located in the sub-directory *sources*.
96
+
Files generated by MCC are always located in their own sub-directory *mcc_generated-files*
87
97
88
98
#### b) Using the generic PWM peripheral driver <br/>
89
-
The PWM peripheral driver files p33c_pwm.c/h provide data structures representing the Special Function Register (SFR) sets of PWM generators and the PWM base module. These 'virtual' PWM objects are used to load, read and modify PWM generator configurations without the need for hard-coded instructions, which would make the code hard to migrate from one peripheral to another or even across devices.To simplify PWM configurations, in these examples, each register is reset to a known default state before the user configuration of interest is set. Thus, only the register setting which really matters for a certain features/function are shown.
99
+
100
+
The PWM peripheral driver files p33c_pwm.c/h provide data structures representing the Special Function Register (SFR) sets of PWM generators and the PWM base module. These 'virtual' PWM objects are used to load, read and modify PWM generator configurations without the need for hard-coded instructions, which would make the code hard to migrate from one peripheral to another or even across devices. To simplify PWM configurations, in these examples, each register is reset to a known default state before the user configuration of interest is set. Thus, only the register setting which really matters for a certain features/function are shown.
90
101
91
102
To learn more about the generic PWM driver, its supported features and intended use cases, please read the comments inside p33c_pwm.c.
92
103
93
104
#### c) Executing the Code Example <br/>
94
-
This code has been written to automatically start up and perform the function of interest. Please read the demo instructions on top of file main.c to learn more about the code example, test points, expected signals and demo mode operation.
95
-
96
105
106
+
This code has been written to automatically start up and perform the function of interest. Please read the demo instructions on top of file main.c to learn more about the code example, test points, expected signals and demo mode operation.
Copy file name to clipboardExpand all lines: changelog.md
+29-2
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,38 @@
1
+
# dspic33ck-power-pwm-phase-shift, release v1.1.0
2
+
3
+
### Release Highlights
4
+
5
+
Version 1.1.0 of this code example is a maintenance cycle release, which is required to keep the source code provided being fully supported by the most recent development tool chain. In this release no functional changes have been made in comparison with the previous version.
6
+
7
+
### Toolchain Updates
8
+
9
+
* Changed minimum MPLAB X IDE version to 6.05 and later - [Get latest Version](https://www.microchip.com/mplabx)
10
+
* Changed minimum XC16 compiler version to v2.00 - [Get latest Version](https://www.microchip.com/xc16)
11
+
* Changed minimum Device File Pack (DFP) version to 1.10.341
12
+
* Microchip Code Configurator Update
13
+
* Updated MCC Plug-In version to require v5.3.7 or later
14
+
* Updated mc3 file contents to work with core version 4.85.1 or later
15
+
16
+
### Features Added\Updated
17
+
18
+
* Updated gitignore file filtering clutter of MPLAB X IDE 6.05 and later
19
+
* Fixed typos in leading comment of main.c
20
+
* Removed interrupt register bits, which are not supported by DFP versions v1.5.135 and later
21
+
* Removed obsolete virtual folder from MPLAB X project explorer
22
+
* Changed label of PWM Module register set from P33C_PWM_SFRSET_t to P33C_PWM_MODULE_t
This is the initial release demonstrating the basic configuration of a high-resolution PWM generator of the dsPIC33C family of devices.
5
33
This example is part of a series of code examples highlighting specific operating modes and features.
6
34
7
35
### Features Added\Updated
36
+
8
37
In this intial version the on-board LED of the dsPIC33CK Digital Power Plug-In Module is toggled with a interval üperiod of 300 ms, when the controller is running at maximum speed of 100 MIPS.
9
38
After startup, 90 degrees phase shift will be generated between pwm generator #1 and pwm generator #3. By pressing the on-board push button *USER* on the Digital Power Develpoment Board, the phase shift is toggled between the initial 90 degrees and 180 degrees.
0 commit comments