XMC14 PSFB Hot

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 46

XMC14 PSFB HOT

Copeland
Dec. 2018
Objective

› Get an idea about how XMC can be used in digital power


applications
– Implement a simplified Phase Shifted Full Bridge
› Get a feel for some of the XMC development tools
– DAVE
– μC/Probe XMC

Copyright
© Infineon
Technologi
es AG
2018
2018. All
-10-
rights 2
Phase Shifted Full Bridge Topology

› Popular DC/DC Converter


› H-Bridge
LEAD_HS LAG_HS
› 50% Duty Cycle on Each
Half Bridge LEAD_LS LAG_LS

– Complimentary Outputs
with Dead-Time
LEAD_HS
› Phase Shifting between
the 2 half bridges LEAD_LS
increases/decreases the
output voltage LAG_HS

› Zero Voltage Switching LAG_LS


(ZVS) possible Phase Shift

Copyright
© Infineon
Technologi
es AG
2018
2018. All
-10-
rights 3
CAPCOM8 (CCU8)

› 4 Slices (just like CCU4)


› Compared to CCU4 each
slice has
– Extra Compare Channel
– Two different PWM Duty
Cycles per Slice
– Can be combined to
produce Asymmetric
center aligned PWM
– Dead Time
– Each Compare Channel
can produce
“complementary” PWM
with Dead Time
– Symmetric or
Asymmetric
› Each CCU8 slice can
control 2 half bridges (or
an H-Bridge) Copyright
© Infineon
Technologi
es AG
2018
2018. All
-10-
rights 4
PSFB with 2x CCU8 Slices - Concept

› One Slice for LEAD LEAD_HS


Phase
LEAD_LS
– Compare Channel
1 used to create
50% Duty Cycle
Output
– Compare Channel Start/Clear
2 used for Phase LAG_HS
Shift
LAG_LS
› One Slice used for
LAG Phase
– Timer Started by
LEAD Phase
Compare 2 Event
Copyright
© Infineon
Technologi
es AG
2018
2018. All
-10-
rights 5
PSFB with 2x CCU8 Slices - Details
Period_Reg

CMP1 = ½ Period_Reg
ST1
CMP2 = Phase Shift
ST2

OUT0 = LEAD_HS

OUT1 = LEAD_LS

Period_Reg
Start/Clear Start/Clear

CMP1 = CMP1
ST1

OUT0 = LAG_HS
Copyright
© Infineon
OUT1 = LAG_LS
Technologi
es AG
2018
2018. All
-10-
rights 6
Basic Tools Installation Instructions

› Install Segger Debug Drivers


– Execute Jlink_Windows_V640.exe

› Install DAVE
– If you don’t have 7-Zip, install it (7-
Zip is faster than most zip file
extraction utilities)
– Execute 7z1805-x64.exe
– Unzip DAVE-IDE-4.4.2-64Bit.7z to
your C: Drive (root directory C:\ is
the preferred destination) using 7-Zip

› Install uC-Probe
– Execute Infineon-uC-Probe-Setup-
Release-4.3.0.96.exe Copyright
© Infineon
Technologi
es AG
2018
2018. All
-10-
rights 7
Advanced Tools (optional)

› XMC Pin-Out Tool is a lightweight


tool that shows the functions of all
I/O pins

› XMC Flasher is a lightweight flash


programming utility that can be
automated

› Ozone is a debugger with advanced


features (e.g. live variable watch)

Copyright
© Infineon
Technologi
es AG
2018
2018. All
-10-
rights 8
Start DAVE

› Launch DAVE
› Create a workspace:
C:\XMC_PSFB_HOT\DAVE4_4_2

Copyright
© Infineon
Technologi
es AG
2018
2018. All
-10-
rights 9
Create a new project

› File | New | DAVE Project…


› Select “DAVE CE Project”
› Name the Project
“PSFB_XMC14”
› Click Next >

Copyright
© Infineon
Technologi
es AG
2018
2018. All
-10-
rights 10
Create a new project

› Under “Boards” select “XMC1400


Boot Kit”
› Click “Finish”

Copyright
© Infineon
Technologi
es AG
2018
2018. All
-10-
rights 11
Test Build

› First make sure DAVE is working by doing a test build. Just click
one of the hammer buttons in the toolbar and check the
“Problems” tab at the bottom to make sure there are no errors

Copyright
© Infineon
Technologi
es AG
2018
2018. All
-10-
rights 12
Add two PWM_CCU8 APPs

› Click the “Add New APP”


button
› Type “PWM” in the Search
filter
› Add the “PWM_CCU8” APP
for the LEAD Phase
› Add another “PWM_CCU8”
APP for the LAG Phase
› When prompted choose
the existing global APP
instance so that both
slices will belong to the
same CCU8 module
Copyright
© Infineon
Technologi
es AG
2018
2018. All
-10-
rights 13
Add the UCPROBE APP

› We will use the UCPROBE


APP later to interact with
the SW
› Type “UC” in the Search
filter
› Add the “UCPROBE” APP
for the LEAD Phase
› Click “Close”

Copyright
© Infineon
Technologi
es AG
2018
2018. All
-10-
rights 14
Rename the PWM APPs to avoid confusion

› Right Click on the PWM_CCU8_0 APP in the APP Dependency


window and select “Rename Instance Label…”
› Rename this instance to “LEAD_PHASE”
› Right Click on the PWM_CCU8_1 APP and select “Rename
Instance Label…”
› Rename this instance to “LAG_PHASE”

Copyright
© Infineon
Technologi
es AG
2018
2018. All
-10-
rights 15
Make the HW Signal Connection

› Click on the “HW Signal Connectivity” (double click to maximize)


› Right Click on the LEAD_PHASE and select “HW Signal
Connections…”
› Connect the “timer_st” output signal from the LEAD_PHASE to
the LAG_PHASE “ext_event0” input
› Click “Save” and then “Close”

Copyright
© Infineon
Technologi
es AG
2018
2018. All
-10-
rights 16
Make the HW Signal Connection

› DAVE Shows the new signal connection in the HW Signal


Connectivity window

Copyright
© Infineon
Technologi
es AG
2018
2018. All
-10-
rights 17
Configure the LEAD_PHASE APP

› Double Click on the


“LEAD_PHASE” APP to open
the APP GUI
› Select “Start during
initialization”
› Change the PWM resolution to
334 nsec
› Change the Frequency to 100
Hz
› Change the Channel 1 duty
cycle to 50%
› Change the Channel 2 duty
cycle to 70%
Copyright
© Infineon
Technologi
es AG
2018
2018. All
-10-
rights 18
Configure the LEAD_PHASE APP

› Go to the “Signal Settings” tab


› Set the Status bit selection to
“ST2”
› Set the Channel 1 Direct
Output Passive state to “After
Compare Match”
› Set the Channel 1 Inverted
Output Passive state to
“Before Compare Match”
› Enable Channel 1 Dead Time
› Set the Rising time to 600,000
ns
› Set the Falling time to 600,000
ns Copyright
© Infineon
Technologi
es AG
2018
2018. All
-10-
rights 19
Configure the LEAD_PHASE APP

› In the “Pin Settings” Tab enable the Channel 1 Direct and


Inverted Outputs

Copyright
© Infineon
Technologi
es AG
2018
2018. All
-10-
rights 20
Configure the LAG_PHASE APP

› Double Click on the


“LAG_PHASE” APP to open
the APP GUI
› Select “Start during
initialization”
› Select “Single-shot mode”
› Change the PWM resolution
to 334 nsec
› Change the Frequency to 50
Hz
› Change the Channel 1 duty
cycle to 75%

Copyright
© Infineon
Technologi
es AG
2018
2018. All
-10-
rights 21
Configure the LAG_PHASE APP

› Go to the “Signal Settings”


tab
› For the Event 0 Function
select “External Start”
› For the Event 0 Trigger edge
select “Rising”
› For the External Start
Function Control select “Clear
And Start Timer”

Copyright
© Infineon
Technologi
es AG
2018
2018. All
-10-
rights 22
Configure the LAG_PHASE APP

› Go to the “Signal Settings”


tab
› Set the Channel 1 Direct
Output Passive state to “After
Compare Match”
› Set the Channel 1 Inverted
Output Passive state to
“Before Compare Match”
› Enable Channel 1 Dead Time
› Set the Rising time to
600,000 ns
› Set the Falling time to
600,000 ns
Copyright
© Infineon
Technologi
es AG
2018
2018. All
-10-
rights 23
Configure the LAG_PHASE APP

› In the “Pin Settings” Tab enable the Channel 1 Direct and


Inverted Outputs

Copyright
© Infineon
Technologi
es AG
2018
2018. All
-10-
rights 24
Configure the UCPROBE APP

› Double Click on the


“UCPROBE” APP to open the
APP GUI
› Select “Increase performance
of sampling functions by
placing them in RAM”

Copyright
© Infineon
Technologi
es AG
2018
2018. All
-10-
rights 25
Configure the UCPROBE APP

› In the “Oscilloscope Settings”


tab change the Sampling
frequency to 10,000 Hz

Copyright
© Infineon
Technologi
es AG
2018
2018. All
-10-
rights 26
Add a TIMER APP and a INTERRUPT APP

› Click the “Add New APP”


button
› We will use the timer to
create a periodic interrupt
– Inside the ISR we will
send data to the
UCPROBE oscilloscope
› Type “TIMER” in the Search
filter
› Add the TIMER APP
› Type “Interrupt” in the
search field
› Add the “INTERRUPT” APP
› Click “Close” Copyright
© Infineon
Technologi
es AG
2018
2018. All
-10-
rights 27
Configure the TIMER APP

› Double Click on the “TIMER_0” APP to open


the APP GUI
› Set the Timer interval to 100 usec
› In the “Event Settings” tab select “Time
interval event” to enable the timer interrupt
› Click OK on the warning box
› Right Click on the TIMER_0 App and select
“HW Signal Connections…”
› Connect the event_time_interval to the
INTERRUPT_0 sr_irq input
› Click Save and then Close

Copyright
© Infineon
Technologi
es AG
2018
2018. All
-10-
rights 28
Configure the INTERRUPT APP

› Double Click on the


“INTERRUPT_0” APP to open the
APP GUI
› Change the Interrupt handler
name to “_10kHzIsr”
– Note the “_” at the beginning of
the name so that it is a valid C
function name

Copyright
© Infineon
Technologi
es AG
2018
2018. All
-10-
rights 29
Assign the Pins & Generate the Code

› Click the “Pin Mapping


Perspective” button in the
toolbar
› Assign LAG_PHASE Pins
– CH1 Direct Out to P0.0
– CH1 Invert Out to P0.1
› Assign LEAD_PHASE Pins
– CH1 Direct Out to P0.2
– CH1 Invert Out to P0.3
› Go back to the DAVE CE
Perspective
› Click the “Generate Code”
button on the toolbar

Copyright
© Infineon
Technologi
es AG
2018
2018. All
-10-
rights 30
Let’s Add some code and a GUI

› In main.c on line 22 add some


global variables that we will
adjust using a GUI
volatile uint32_t Update = 0;
volatile uint32_t PhaseShift = 20;

Copyright
© Infineon
Technologi
es AG
2018
2018. All
-10-
rights 31
Let’s Add some code and a GUI

› In main.c arround
line 41 call the
UCPROBE_Init()
function which is
needed for the
oscilloscope
UCPROBE_Init();

Copyright
© Infineon
Technologi
es AG
2018
2018. All
-10-
rights 32
Let’s Add some code and a GUI

› In the main loop (around line 46) add some code that will allow
the GUI settings to update the Phase Shift
if (Update == 1)

Update = 0;

PWM_CCU8_SetDutyCycleSymmetric(&LEAD_PHASE, XMC_CCU8_SLICE_COMPARE_CHANNEL_2, (100-(50-


PhaseShift))*100);

Copyright
© Infineon
Technologi
es AG
2018
2018. All
-10-
rights 33
Let’s Add some code and a GUI

› After the main loop (around line 54) add the _10kHzIsr that will
update the oscilloscope data
__RAM_FUNC void _10kHzIsr(void)
{
ProbeScope_Sampling();
}

Copyright
© Infineon
Technologi
es AG
2018
2018. All
-10-
rights 34
Check to see if it’s working

› Click one of the hammer buttons in the toolbar to


build the code
› Check the “Problems” tab and make sure there are
no warnings or errors

› Connect the USB Cable from the kit to your laptop

Copyright
© Infineon
Technologi
es AG
2018
2018. All
-10-
rights 35
Launch the Debugger

› Click the bug button in the toolbar to launch the Debug


Configurations window
› Double Click on “GDB SEGGER J-Link Debugging” to create the
debug configuration
› Click the “Debug” button

› In the Confirm Perspective Switch window click “Yes”


› In the debugger toolbar click the “Resume” button to start
running

Copyright
© Infineon
Technologi
es AG
2018
2018. All
-10-
rights 36
Create your own GUI

› Launch uC/Probe
› Drag a Numeric
Up/Down control into
the DataScreen1

Copyright
© Infineon
Technologi
es AG
2018
2018. All
-10-
rights 37
Create your own GUI

› Click on the newly inserted


widget and then click on
the “Properties Editor”
button
› Set the Maximum Value to
49

Copyright
© Infineon
Technologi
es AG
2018
2018. All
-10-
rights 38
Create Your Own GUI

› Drag a Toggle Button into the


DataScreen1

› Click the “ELF” button to load the


symbol table

› Navigate to the “Debug” folder of


your project (e.g. C:\
XMC_PSFB_HOT\DAVE4_4_2\
PSFB_XMC14\Debug” )
› Select the elf file (e.g.
PSFB_XMC14.elf)

Copyright
© Infineon
Technologi
es AG
2018
2018. All
-10-
rights 39
Create you own GUI

› Expand the ELF file


› In main.c you will find our
global variables

› Drag and Drop “PhaseShift”


onto the “Numeric Up/Down”
widget
› Drag and Drop “Update” onto
the toggle button

Copyright
© Infineon
Technologi
es AG
2018
2018. All
-10-
rights 40
Setup the Oscilloscope to view the I/O pins

› Click the “Insert Screens”


button in the “Workspace
Explorer” and select
“Oscilloscope”
› Click the “CDF” button in the
“Symbol Browser”
› Select the XMC1404-
Q064x0200.ddf.cdf
› Expand the “XMC1400.svd”
and scroll down to PORT0-
>IN

Copyright
© Infineon
Technologi
es AG
2018
2018. All
-10-
rights 41
Setup the Oscilloscope

› Drag PORT0->IN->P0 into


the oscilloscope
› Drag PORT0->IN->P1 into
the oscilloscope
› Drag PORT0->IN->P2 into
the oscilloscope
› Drag PORT0->IN->P3 into
the oscilloscope

Copyright
© Infineon
Technologi
es AG
2018
2018. All
-10-
rights 42
Run the GUI and try different dim levels/times

› Click the “Run” button in the


toolbar
› The Numeric Up/Down
widget controls the Phase
Shift
› The Toggle button updates
the new value

Copyright
© Infineon
Technologi
es AG
2018
2018. All
-10-
rights 43
Setup the oscilloscope

› Select the Oscilloscope tab


› Click the “Auto Fit All
Traces” button

› Try Different Phase Shifts

Copyright
© Infineon
Technologi
es AG
2018
2018. All
-10-
rights 44
Have fun!

Copyright
© Infineon
Technologi
es AG
2018
2018. All
-10-
rights 45

You might also like