Keil Logo

Peripheral Simulation

For Infineon C508 — Compare/Capture Unit

Simulation support for this peripheral or feature is comprised of:

  • Dialog boxes which display and allow you to change peripheral configuration.

These simulation capabilities are described below.

Capture Compare Unit (CCU) Dialog

The Capture Compare Unit (CCU) Dialog controls the compare and capture functions. The compare function generates an output signal when a compare timer equals a preset value. The capture function stores a capture timer value based on an external signal.

Capture/Compare Channels Group

  • CCx (Capture Compare Registers 0-2) holds the target compare or capture values.
  • CMSELx (Capture/Compare Mode Select Register 0-2) selects one of the capture or compare operating modes.
  • CMSELx3 (Compare Timer 2 Output Signal To COUTx) if set and compare mode is enabled, the output signal of the 10-bit compare unit is sent to the COUTx pin.

Interrupts Group

  • CCxREN (Capture/Compare Rising Edge Interrupt Enable) is set in capture mode to generate an interrupt when a low-to-high transition of the corresponding CCx signal occurs. In compare mode, CCxREN generates an interrupt when a a compare register (CCx) matches the compare timer 1 value while the time is up-counting.
  • CCxR (Capture/Compare Match On Up-count Flag) is set in capture mode when a low-to-high transition of the corresponding CCx capture signal occurs. In compare mode, CCxR is set when the corresponding CCx compare register matches the compare timer 1 value.
  • CCxFEN (Capture/Compare Falling Edge Interrupt Enable) is set in capture mode to generate an interrupt when a high-to-low transition of the corresponding CCx signal occurs. In compare mode, CCxFEN generates an interrupt when a a compare register (CCx) matches the compare timer 1 value while the time is down-counting.
  • CCxF (Capture/Compare Match On Down-count Flag) is set in capture mode when a high-to-low transition of the corresponding CCx capture signal occurs. In compare mode, CCxR is set when the corresponding CCx compare register matches the compare timer 1 value.

Trap Levels Group

  • CCxT (Capture Compare Output Level in Trap Condition) if set and the trap function is enabled, sets the state of CCx to 1. If reset, it sets the state of CCx to 0.
  • COUTxT (Compare Output Level in Trap Condition) if set and the trap function is enabled, sets the state of COUTx to 1. If reset, it sets the state of COUTx to 0.

Initial Value Group

  • CCxI (Compare Output Initial Value 0-2) if set, sets an initial value of 1 to the corresponding CMSEL register when the compare timer is not running. If reset the initial value is 0.
  • COUTxI (Compare Output Level In Trap Condition 0-2) if set, sets an initial trap level of 1 to the corresponding compare channel output. If reset, the initial trap value is 0.

Port Pins Group

  • CCx (Capture Compare Channel 0-2 Input/Output) displays or sets the Capture Compare I/O Channel pins 0-2 (P1.2, P1.4 and P1.6).
  • COUTx (Capture Compare Channel 0-2 Output) displays or sets the Capture Compare Output Channel pins 0-2 (P1.3, P1.5 and P1.7).

Compare Channel Group

  • CMP2 (Compare Timer 2 Compare Register) holds the 10-bit compare value for compare timer 2.
  • ECT20 (Enable Compare Timer 2 Output) is set to enable the COUT3 output when compare timer 2 is running.
  • COUTXI (COUT Invert) is set to invert the output signal at COUTx in burst or multi-channel PWM mode.
  • COUT3I (COUT3 Initial Logic Level) is set to define the output level of COUT3 prior to starting the compare timer.
  • COUT3 (Compare Unit Output) is the single-channel, PWM output signal level of the 10-bit compare unit.

Multi Channel Modes Group

  • MPWM (Multi-channel PWM Mode Selection) selects the multi-channel Pulse Width Modulation (PWM) operating mode.
  • BCM (Multi-channel PWM Mode Output Pattern Selection) selects the output signal pattern (Idle, Rotate Right, Rotate Left or Slow Down).
  • BCEN (Block Commutation Enable) enables the multi-channel PWM modes of the CAPCOM unit.
  • ESMC (Enable Software Controlled Multi-channel PWM Modes) when set, allows the Next Multi-channel PWM State (NMCS) switch the 4, 5 or 6-phase follower state.
  • NMCS (Next Multi-channel PWM State) selects the follower state (4, 5 or 6-phase) in multi-channel PWM mode.
  • BCMP/BCEM (Output Select/Error Mode Select Bit) if set while in multi-channel mode, both the COUTx and the CCx outputs receive the compare timer 2 output signals. If reset in multi-channel mode, only the COUTx outputs receive the compare timer 2 output signals. In block commutation mode, if block commmutation error interrupts (EBCE) are enabled, this bit sets the BCERR status when a "wrong follower" condition occurs.

Trap Group

  • CTRAP (External Trap Input Signal) is an external signal that decouples the CCx and COUTx output signal levels from the output of the compare unit.
  • TRPEN (External CTRAP Trap Function Enable Bit) enables the trap function for CTRAP input.
  • TRENx (Trap Enable Control Bits) enables the CCx and COUTx outputs. TREN0, TREN2 and TREN4 control the CCx outputs. TREN1, TREN3 and TREN5 control the COUTx outputs.

Emergency Int. Group

  • ETRP (Emergency Trap Interrupt Enable) is set to enable the emergency interrupt when a CCU trap signal occurs.
  • TRF (Trap Flag) is set when the trap function is enabled and the external trap input (CTRAP) becomes active (low).
  • EBCE (Enable Interrupt of Block Commutation Mode Error) if set, allows the a block commutation mode error to trigger an emergency interrupt.
  • BCERR (Block Commutation Mode Error Flag) is set if all INTx inputs are high or all low after a INTx transition. A "wrong follower" condition in the BCM can also set this flag.

Hall Sensors Group

  • INTx in block commutation PWM mode, these inputs control the levels of the CCx and COUTx outputs based on the Block Commutation Mode (BCM) value.
Get more information about the
Peripheral Simulation Capabilities
of the µVision Debugger.
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.