XC800 Peripheral Highlights

XC800 Peripheral Highlights
8-bit microcontrollers
July 2008
Industrial and Multimarket Microcontroller – AIM MC IMM
Agenda
„ Realtime Applications
„ Example Switched Mode Power Supply – CC6
„ Example Current Measurement – CC6 & ADC
„ Example Board Selftest – Ports
„ Example Touchpad – CC6 & Ports
June 2008
Copyright © Infineon Technologies 2006. All rights reserved. AIM MC IMM
Page 2
Realtime Applications
„ Realtime applications need:
„ computing performance – this can be easily calculated
„ guaranteed reaction time – this is difficult to guarantee
„ Æ together this is called Realtime Performance
„ How to get Realtime Performance
„ use powerful MCU architectures (busses, datawidth, MUL/DIV
pipeline...)
† ... this is quite expensive
„ use good interrupt controllers
† ... 8051 has significant good interrupt performance
„ use high clockspeed
† ... this is very expensive Æ fast memory, high current
consumption etc...
„ use intelligent peripherals
† ... this needs application knowhow and technical expertise
June 2008
Copyright © Infineon Technologies 2006. All rights reserved. AIM MC IMM
Page 3
CPU vs. Peripheral Performance
Example: Servo Motor of a CNC Machine
Crack on
the cutter
head
Via
Via CPU
CPU
„
„ Check
Check limits
limits every
every 2µs
2µs
„
„ Assumption:
Assumption: 20
20 instructions
instructions
„
„ Additional
Additional 10
10 MIPS
MIPS CPU
CPU
performance
performance needed
needed for
for aa
“background”
“background” task!
task!
June 2008
Via
Via autonomous
autonomous peripherals
peripherals
„
„ Check
Check limits
limits every
every 2µs
2µs in
in ADC
ADC
„
„ Trigger
Trigger PWM
PWM unit
unit directly
directly in
in case
case
of
of limit
limit violation
violation
„
„ Zero
Zero additional
additional CPU
CPU load
load
Copyright © Infineon Technologies 2006. All rights reserved. AIM MC IMM
Page 4
Agenda
„ Realtime Applications
„ Example Switched Mode Power Supply – CC6
„ Example Current Measurement – CC6 & ADC
„ Example Board Selftest – Ports
„ Example Touchpad – CC6 & Ports
June 2008
Copyright © Infineon Technologies 2006. All rights reserved. AIM MC IMM
Page 5
Example Switched Mode Power Supply – CC6
„ for flyback converters, stepdown
converters, PFC etc. a typical
problem is that the switch
control requires
variable period and duty cycle
„ a standard PWM module cannot
do this – the signal is much too
fast
„ this is called
„ critical conduction mode
„ discontinuous mode etc...
„ CC6 can solve this problem
„ T13 in single shot mode
„ start T13 on external event
(T13HR)
„ By this an aperiodic signal can
be generated @ 100kHz
(Ton + Toff ≠ contstant)
June 2008
Copyright © Infineon Technologies 2006. All rights reserved. AIM MC IMM
Page 6
Agenda
„ Realtime Applications
„ Example Switched Mode Power Supply – CC6
„ Example Current Measurement – CC6 & ADC
„ Example Board Selftest – Ports
„ Example Touchpad – CC6 & Ports
June 2008
Copyright © Infineon Technologies 2006. All rights reserved. AIM MC IMM
Page 7
Example Current Measurement – CC6 & ADC
„ Single Shunt Current Measurement for SVM Controlled Motors
„
„
„
„
ADC can be triggered by hardware „time-accurate“
T13 and T12 are synchronized by hardware
ADC result is stored automatically
decoupling of software and hardware
Topology
Space Vector Modulation
(SVM)
June 2008
Copyright © Infineon Technologies 2006. All rights reserved. AIM MC IMM
Noisefree sampling
(T13PM)
Page 8
Agenda
„ Realtime Applications
„ Example Switched Mode Power Supply – CC6
„ Example Current Measurement – CC6 & ADC
„ Example Board Selftest – Ports
„ Example Touchpad – CC6 & Ports
June 2008
Copyright © Infineon Technologies 2006. All rights reserved. AIM MC IMM
Page 9
Example Board Selftest – Ports
„ Using flexible port feature
„ programmable pullup / pulldown
„ strong pull with opendrain
„ Short-Detection of two neighbour
pins on boardlevel
„ Emulation of external signals by
pullup/down stimulation
„ Æ external interrupts
„ Æ external sensors, even analog
„ Æ capture events
„ etc.
June 2008
short
read
pinlevel
Copyright © Infineon Technologies 2006. All rights reserved. AIM MC IMM
Page 10
Agenda
„ Realtime Applications
„ Example Switched Mode Power Supply – CC6
„ Example Current Measurement – CC6 & ADC
„ Example Board Selftest – Ports
„ Example Touchpad – CC6 & Ports
June 2008
Copyright © Infineon Technologies 2006. All rights reserved. AIM MC IMM
Page 11
Example Touchpad (1)
„ A Touchpad is a capacitive
switch
„ without electro-mechanical
parts
„ with galvanic isolation
finger
„ It works like a RC oscillator
where the
„ C is changed by the
„touching finger“
glass
pad
PCB
to MCU
portpin
count oscillations over a certain time
less oscillations when finger is on touchpad
June 2008
Copyright © Infineon Technologies 2006. All rights reserved. AIM MC IMM
Page 12
Example Touchpad (2)
„ SW Solution – 100% CPU load
start T2
T2 overflow
T2
opendrain
with pullup
yes
no
pullup on
read count
no
reset count
pinlevel high
CPU
count
above limit
yes
output low
yes
no
ON
OFF
count++
June 2008
Copyright © Infineon Technologies 2006. All rights reserved. AIM MC IMM
Page 13
Example Touchpad (3)
„ HW Solution – zero CPU load
T2
opendrain
with pullup
CC6
T2 ISR
hardware
start
T0
read count
count
reset count
above limit
June 2008
yes
no
ON
OFF
Copyright © Infineon Technologies 2006. All rights reserved. AIM MC IMM
Page 14
June 2008
Copyright © Infineon Technologies 2006. All rights reserved. AIM MC IMM
Page 15