Skip to content

Commit

Permalink
Pull request #15: Deployment Maintenance Release 1.1.0
Browse files Browse the repository at this point in the history
Merge in MCU16CE/dspic33ck-power-pwm-phase-shift from develop to master

* commit 'df67892c3759b70371028443c93779fe4e2bd25d':
  * 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
  Fixed pipeline failure
  • Loading branch information
areiter128 committed Aug 10, 2023
2 parents 35df845 + df67892 commit e02c5cc
Show file tree
Hide file tree
Showing 13 changed files with 380 additions and 293 deletions.
404 changes: 209 additions & 195 deletions .citd/Jenkinsfilek8s

Large diffs are not rendered by default.

20 changes: 16 additions & 4 deletions .citd/cloudprovider.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,26 @@ metadata:
spec:
containers:
- name: xc16-mplabx-sonar-fmpp-python
image: artifacts.microchip.com:7999/microchip/citd/bundles/xc16-mplabx-sonar-fmpp-python-yarn-node:1.50-5.40-4.2-0.9.16-3.x-1.17.3-12.x
image: artifacts.microchip.com:7999/microchip/citd/bundles/xc16-mplabx-sonar-fmpp-python-yarn-node:latest
imagePullPolicy: Always
command: ['cat']
tty: true
resources:
requests:
cpu: 1
memory: 1Gi
cpu: 500m
memory: 1500Mi
limits:
cpu: 2
cpu: 1
memory: 2Gi
- name: buildtools
image: artifacts.microchip.com:7999/microchip/buildtools/doxygen:1.8.15-r0
imagePullPolicy: Always
command: ['cat']
tty: true
resources:
requests:
cpu: 500m
memory: 750Mi
limits:
cpu: 1
memory: 1Gi
53 changes: 45 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,20 +1,54 @@
# .gitignore file
#
# Set up for Microchip/MPLAB X development
# Set up for Microchip/MPLAB X® development
#
# Default gitignore files for code examples, only removing/ignoring usual MPLAB X clutter
# Default gitignore files for code examples, only removing/ignoring usual MPLAB X® clutter

# Object files
# Excluding object files
*.o
*.ko
*.obj
*.elf

# Executables
# Excluding documentation output directories and file types
docs/
*.mp4
.mchp_private/doxygen/doxylog.txt
.mchp_private/doxygen/doxymsg.txt
.mchp-private/doxygen/doxylog.txt
.mchp-private/doxygen/doxymsg.txt
mchp_private/doxygen/doxylog.txt
mchp_private/doxygen/doxymsg.txt
mchp-private/doxygen/doxylog.txt
mchp-private/doxygen/doxymsg.txt

# Excluding archive and backup directories
.archive/
.backup/

# Excluding documentation input directories
#_dox/
#_dox/images/

# Excluding test output directories
test/
.test/

# Excluding SiMetrix/Simplis temporary simulation directories
SIMPLIS_Data/
TMP/

# Excluding any executables
*.exe

# Netbeans specific
#Excluding Files/Folders Auto-Generated by Test Harness
.generated_files/
node_modules/

# Excluding Netbeans specific build directories and file types
~*.*
.generated_files/
queuelogs/
nbproject/build/
nbproject/dist/
nbproject/private/
Expand All @@ -24,22 +58,25 @@ dist/
private/
disassembly/
*.zip
!code-templates.zip
*.mk
*.bash
*.dump
Makefile-genesis.properties

# MPLAB X Trace specific
# Excluding MPLAB X® Trace files
*.log
*.inx

# VisualStudio Code specific
buildLog/

# KDE specific
.directory

# Misc
.svn
*.bak
*.doc
*.docx



25 changes: 10 additions & 15 deletions .main-meta/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,27 @@
"metaDataVersion":"1.0.0",
"category":"com.microchip.ide.project",
"content":{
"metaDataVersion":"1.0.0",
"metaDataVersion":"1.3.0",
"name":"com.microchip.mplabx.project.dspic33ck-power-pwm-phase-shift",
"version":"1.0.0",
"version":"1.1.0",
"displayName":"dsPIC33CK/CH-MP PWM Configuration: Phase Shifted PWM Output",
"projectName":"dspic33ck-power-pwm-phase-shift",
"shortDescription":"Phase Shifted PWM Output Configuration Example for dsPIC33CK-MP devices",
"ide":{
"name":"MPLABX",
"semverRange":">=5.40.0"
"semverRange":">=6.05.0"
},
"compiler":{
"name":"XC16",
"semverRange":"^1.50.0"
"semverRange":"^2.00.0"
},
"dfp":{
"name":"dsPIC33CK-MP_DFP",
"semverRange":"^1.4.102"
"semverRange":"^1.10.341"
},
"configurator": {
"name": "MCC",
"semverRange": ">=4.0.1"
"semverRange": ">=5.3.7"
},
"device":{
"metaDataVersion":"1.0.0",
Expand All @@ -34,18 +34,13 @@
"versionRange":"*"
}
},
"peripherals":[
"GPIO",
"PWM",
"Timer"
],
"keywords":[
"dsc",
"dspic",
"power",
"power-conversion",
"power-supply",
"smps"
"power",
"power-conversion",
"power-supply",
"smps"
]
}
}
50 changes: 30 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<p><a target="_blank" href="https://www.microchip.com" rel="nofollow"><img src="images/microchip.png" alt="MCHP" width="200";"></a></p>

# dsPIC33C High-Resolution PWM Configuration: Lab 4

**Phase-Shifted PWM Waveform Generation**

<p><center><a href="https://www.microchip.com/MA330048" rel="nofollow">
Expand All @@ -11,46 +12,54 @@
- - -

## Summary

Learning how to use the High Resolution PWM Module of dsPIC33C MP devices, Lab 4:
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

- - -

## Related Documentation
- [dsPIC33CK256MP508 Family Data Sheet](https://ww1.microchip.com/downloads/en/DeviceDoc/dsPIC33CK256MP508-Family-Data-Sheet-DS70005349G.pdf)
- [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)
- [dsPIC33CH512MP508 Family Data Sheet](http://ww1.microchip.com/downloads/en/DeviceDoc/dsPIC33CH512MP508-Family-Data-Sheet-DS70005371D.pdf)
- [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)

- [dsPIC33CK256MP508 Family Data Sheet](https://www.microchip.com/70005349)
- [dsPIC33CK256MP508 Family Silicon Errata and Data Sheet Clarification](https://www.microchip.com/80000796)
- [dsPIC33CH512MP508 Family Data Sheet](http://www.microchip.com/70005371)
- [dsPIC33CH512MP508 Family Silicon Errata and Data Sheet Clarification](http://www.microchip.com/80000805)

**Please always check for the latest data sheets on the respective product websites:**

- [dsPIC33CK256MP508 Family](https://www.microchip.com/dsPIC33CK256MP508)
- [dsPIC33CH512MP508 Family](https://www.microchip.com/dsPIC33CH512MP508)

## Software Used
- [MPLAB® X IDE v5.40](https://www.microchip.com/mplabx-ide-windows-installer)
- [MPLAB® XC16 Compiler v1.50](https://www.microchip.com/mplabxc16windows)
- [MPLAB® Code Configurator v4.01](https://www.microchip.com/mplab/mplab-code-configurator)

- [MPLAB® X IDE v6.05](https://www.microchip.com/mplabx)
- [MPLAB® XC16 Compiler v2.00](https://www.microchip.com/xc16)
- [MPLAB® Code Configurator v4.85](https://www.microchip.com/mcc)

## Hardware Used

- Digital Power Development Board, Part-No. [DM330029](https://www.microchip.com/DM330029)
- dsPIC33CK Digital Power Plug-In Module (DP PIM), Part-No. [MA330048](https://www.microchip.com/MA330048)
- Alternatively: dsPIC33CH Digital Power Plug-In Module (DP PIM), Part-No. [MA330049](https://www.microchip.com/MA330049)

## Supported Target Devices

- [dsPIC33CK256MP506](https://www.microchip.com/dsPIC33CK256MP506)
- [dsPIC33CH512MP506](https://www.microchip.com/dsPIC33CH512MP506)
- Code compatible with all Single and Dual Core dsPIC33C MP families of devices

- - -

## Setup

- Plug-In the dsPIC33CK or dsPIC33CH Digital Power Plug In Module into the Digital Power Development Board PIM socket J1
- Open and compile the firmware and program the DSC

<br><center><img src="images/dm330029.jpg" width="400"></center><br>

## Operation
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.

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.

<br><center><img src="images/pwm90phaseshift.png" width="400"></center><br>
<br><center>*CH1(blue):PWM1H CH2(green):PWM1L CH3(red):PWM3H CH4(purple):PWM3L*</center><br>
Expand All @@ -60,41 +69,42 @@ By pressing the on-board push button *USER* on the Digital Power Development Boa
<br><center><img src="images/pwm180phaseshift.png" width="400"></center><br>
<br><center>*CH1(blue):PWM1H CH2(green):PWM1L CH3(red):PWM3H CH4(purple):PWM3L*</center><br>


Please refer to section *FIRMWARE QUICK-START GUIDE* below for more information on the initialization process and code structure.

<br><center><img src="images/dm330029-pinmap.png" width="600"></center><br>

- - -

## FIRMWARE QUICK-START GUIDE

This code example builds on previous code examples showing how to use Microchip Code Configurator (MCC) to set up device clock domains.
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.
This code example builds on previous code examples showing how to use Microchip Code Configurator (MCC) to set up device clock domains.
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.
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.
Once users are familiar with the architecture, features and capabilities, both configuration options (generic peripheral library or MCC) may be used.

#### a) Project Directory Structure <br/>

The project contains four sub-directories

1. config: location of all hardware abstraction header files
2. common: location of generic peripheral drivers
2. common: location of generic peripheral drivers
3. MCC Generated Files: all device configuration files auto-generated by MCC
4. root: application user code

On the hard drive, main.c/h are located in the MPLAB X project directory.
All other user files, incl. peripheral drivers, are located in the sub-directory *sources*.
Files generated by MCC are always located in their own sub-directory *mcc_generated-files*
On the hard drive, main.c/h are located in the MPLAB X project directory.
All other user files, incl. peripheral drivers, are located in the sub-directory *sources*.
Files generated by MCC are always located in their own sub-directory *mcc_generated-files*

#### b) Using the generic PWM peripheral driver <br/>
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.

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.

To learn more about the generic PWM driver, its supported features and intended use cases, please read the comments inside p33c_pwm.c.

#### c) Executing the Code Example <br/>
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.


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.

- - -

© 2020, Microchip Technology Inc.
&copy; 2023, Microchip Technology Inc.
31 changes: 29 additions & 2 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,38 @@
# dspic33ck-power-pwm-phase-shift, release v1.1.0

### Release Highlights

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.

### Toolchain Updates

* Changed minimum MPLAB X IDE version to 6.05 and later - [Get latest Version](https://www.microchip.com/mplabx)
* Changed minimum XC16 compiler version to v2.00 - [Get latest Version](https://www.microchip.com/xc16)
* Changed minimum Device File Pack (DFP) version to 1.10.341
* 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

### Features Added\Updated

* Updated gitignore file filtering clutter of MPLAB X IDE 6.05 and later
* Fixed typos in leading comment of main.c
* Removed interrupt register bits, which are not supported by DFP versions v1.5.135 and later
* Removed obsolete virtual folder from MPLAB X project explorer
* Changed label of PWM Module register set from P33C_PWM_SFRSET_t to P33C_PWM_MODULE_t

&copy; 2023, Microchip Technology Inc.

---

# dspic33ck-power-pwm-phase-shift, release v1.0.0

### Release Highlights

This is the initial release demonstrating the basic configuration of a high-resolution PWM generator of the dsPIC33C family of devices.
This example is part of a series of code examples highlighting specific operating modes and features.

### Features Added\Updated

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.
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.


20 changes: 10 additions & 10 deletions dspic33ck-power-pwm-phase-shift.X/device_setup.mc3
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<config configVersion="1.1" device="dsPIC33CK256MP506" coreVersion="4.85.0">
<config configVersion="1.1" device="dsPIC33CK256MP506" coreVersion="4.85.1">
<usedClasses class="java.util.HashMap">
<entry>
<string>System Module</string>
Expand All @@ -12,14 +12,14 @@
<string>INTERNAL OSCILLATOR</string>
<string>class com.microchip.mcc.mcu16.systemManager.clk.Clock</string>
</entry>
<entry>
<string>Pin Module</string>
<string>class com.microchip.mcc.mcu16.pinManager.PinManager</string>
</entry>
<entry>
<string>WATCHDOG</string>
<string>class com.microchip.mcc.mcu16.systemManager.wdt.Wdt</string>
</entry>
<entry>
<string>Pin Module</string>
<string>class com.microchip.mcc.mcu16.pinManager.PinManager</string>
</entry>
<entry>
<string>DMT</string>
<string>class com.microchip.mcc.mcu16.systemManager.dmt.DMT</string>
Expand Down Expand Up @@ -13953,7 +13953,7 @@
</entry>
<entry>
<file>mcc_generated_files\mcc.h</file>
<hash>da11287b3388692edf3d6f8bc0480caf872dee4057749d4c81df8faf03235ba1</hash>
<hash>829614197b747f6c720bd3301562e684ad254d6f74417c788fa916d1167995f1</hash>
</entry>
<entry>
<file>mcc_generated_files\reset.c</file>
Expand Down Expand Up @@ -13983,14 +13983,14 @@
<file>mcc_generated_files\system_types.h</file>
<hash>5a950eea332589ea6dc66ce9c8aaf27ccaaf2623159a9deaed042055e43c9477</hash>
</entry>
<entry>
<file>mcc_generated_files\pin_manager.c</file>
<hash>7a64d50b1ff548dc0574f61ded05cb96c27256f7cee6a36fde3b11589b3d9b19</hash>
</entry>
<entry>
<file>mcc_generated_files\system.h</file>
<hash>0060fe1fb7298b89c45e013f472a9f4b996184788e2fd4462bf321204ae5163c</hash>
</entry>
<entry>
<file>mcc_generated_files\pin_manager.c</file>
<hash>7a64d50b1ff548dc0574f61ded05cb96c27256f7cee6a36fde3b11589b3d9b19</hash>
</entry>
<entry>
<file>mcc_generated_files\system.c</file>
<hash>6786bb8f8ac98a175fa85d7b2389824ac0c37afac965497d53c174820cd29422</hash>
Expand Down
Loading

0 comments on commit e02c5cc

Please sign in to comment.