Skip to content

Commit 187c13d

Browse files
committed
Merge pull request #9 in MCU16CE/dspic33ck-power-pwm-phase-shift from ~M91406/dspic33ck-power-pwm-phase-shift:bugfix/readme_fix to develop
* commit '38884f70074f7bb15099f0ec6a6f404e7537b878': Updated changes in data structure declarations in SFR abstraction driver into PWM object handlers in main() Incorporated change in data structure declarations in SFR abstraction driver into PWM initialization example Changed PWM configuration code example enumeration once more. Now Code example enumerations are called 'Lab 1', 'Lab 2'. 'Lab 3', etc. REplaced PWM SFR abstraction driver with latest version. major change was simplification of data structure to make the driver compliant with other SFR abstraction drivers and make usage more intuitive Fixed software version labels to start with MPLABX(R) Changed roman enumeration of code example to arabic numbers
2 parents cf8f065 + 38884f7 commit 187c13d

File tree

6 files changed

+309
-196
lines changed

6 files changed

+309
-196
lines changed

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<article class="markdown-body entry-content p-3 p-md-6" itemprop="This needs to be locked down and 'never' changed">
33
<p><a target="_blank" href="https://www.microchip.com" rel="nofollow"><img src="images/microchip.png" alt="MCHP" width="200";"></a></p>
44

5-
# dsPIC33C High-Resolution PWM Configuration IV
5+
# dsPIC33C High-Resolution PWM Configuration: Lab 4
66
**Phase-Shifted PWM Waveform Generation**
77

88
<p><center><a href="https://www.microchip.com/MA330048" rel="nofollow">
@@ -28,8 +28,8 @@ Code example for dsPIC33CK and dsPIC33CH devices showing a basic configuration o
2828

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

3434
## Hardware Used
3535
- Digital Power Development Board, Part-No. [DM330029](https://www.microchip.com/DM330029)

dspic33ck-power-pwm-phase-shift.X/main.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -199,20 +199,20 @@ int main(void)
199199
while(SW_Read() == SW_PRESSED);
200200

201201
// Update PWM timing registers
202-
if(my_pg1.pgHandle->PGxTRIGC.value == 5000) // If trigger is set to 25% duty cycle
202+
if(my_pg1->PGxTRIGC.value == 5000) // If trigger is set to 25% duty cycle
203203
{
204-
my_pg1.pgHandle->PGxTRIGC.value = 10000; // Set the trigger at 50% duty cycle
204+
my_pg1->PGxTRIGC.value = 10000; // Set the trigger at 50% duty cycle
205205

206206
}
207207
else
208208
{
209-
my_pg1.pgHandle->PGxTRIGC.value = 5000; // Set the trigger at 25% duty cycle
209+
my_pg1->PGxTRIGC.value = 5000; // Set the trigger at 25% duty cycle
210210

211211
}
212212

213213
// Set UPDATE bit of master PWM generator #1
214214
DBGPIN_Set(); // Set debug pin as oscilloscope trigger
215-
my_pg1.pgHandle->PGxSTAT.bits.UPDREQ = 1; // Set Update Bit (apply new timing to PWM generator)
215+
my_pg1->PGxSTAT.bits.UPDREQ = 1; // Set Update Bit (apply new timing to PWM generator)
216216
}
217217

218218
}

0 commit comments

Comments
 (0)