Keil Logo

Peripheral Simulation

For Infineon XC878LM-13F — Clock Control

Simulation support for this peripheral or feature is comprised of:

  • Dialog boxes which display and allow you to change peripheral configuration.
  • VTREGs (Virtual Target Registers) which support I/O with the peripheral.

These simulation capabilities are described below.

Claock Control Dialog

Claock Control

The Clock Generation dialog displays and allows you to specify the PLL and oscillator configuration for the MCU clock.


  • OCS_CON (OSC Control Register) contains the following control bit settings:
  • OSCR (Oscillator Run Status Bit) when set, indicates that the oscillator is running.
  • OSCSS (Oscillator Source Select) when set, selects the external oscillator.
  • OSCPD (On-chip OSC Power-down Control) when set, powers down the on-chip oscillator.
  • ORDRES (Oscillator Run Detection Reset) when set, the oscillator run detection logic is reset and restarted.
  • XPD (XTAL Power-down Control) when set, power is removed from XTAL.


  • PLL_CON (PLL Control Register) contains the following PLL control bit settings:
  • LOCK (PLL Lock Status Flag) when set, indicates the PLL is locked.
  • OSCDISC (Oscillator Disconnect) when set, disconnects the oscillator from the PLL. If reset, it is connected.
  • RESLD (Restart Lock Detection) when set, resets the PLL lock status flag(LOCK) and restarts the lock detection.
  • VCOBYP (PLL VCO Bypass Mode Select) when set, the derives the PLL clock from the oscillator clock divided by 2.
  • NDIV (PLL N-Divider) selects the N-divider value to produce required system clock frequency.


  • CMCON (Clock Control Register) contains the CLKREL setting.
  • CLKREL (Clock Divider) selects the slow-down clock frequency divisor.

Oscillators & CPU Clock

  • XTAL Freq. (Off Chip) specifies the crystal oscillator frequency in Hz.
  • On Chip Freq. displays on chip frequency in Hz.
  • CPU Clock displays the resulting system clock frequency in Hz.

Data Type: unsigned long

The CLOCK VTREG contains the speed of the microcontroller instruction clock (in Hertz). This is effectively the number of 1-cycle instructions that the simulated microcontroller can execute each second. This number is derived from the selected oscillator frequency and clock prescaler and PLL settings (if present). The CLOCK VTREG can only be read. It can not be changed directly. It can only be changed by changing the value of the selected oscillator frequency or by changing the clock prescaler or PLL settings (not available on all devices).

Data Type: unsigned long

The XTAL VTREG contains the frequency of the oscillator (in Hertz) used to drive the microcontroller. The value is automatically set from the value specified in Project Options - Options for Target. However, you may change the value of XTAL using the command window. For example:


You may also output the current value of XTAL using the following:


XTAL may be used in calculations to synchronize external scripts with the simulated microcontroller.

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.