Keil Logo

Peripheral Simulation

For Silicon Laboratories, Inc. C8051T602 — Comparator 0

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.

Comparator Dialog

Comparator

The Comparator Dialog controls simulation of the two voltage comparators in the device. When enabled, it allows the user to compare voltage sources to generate a logic-level signal to a variety of destinations.

Comparator 0

  • CPT0CN (Comparator 0 Control Register) contains the following control bit settings:
  • CP0EN (Comparator 0 Output Enable Bit) is set to enable comparator 0.
  • CP0OUT (Comparator 0 Output State Flag) is set when the voltage on CP0P is greater than CP0N.
  • CP0RIF (Comparator 0 Rising-Edge Interrupt Flag) is set when a Comparator 0 rising edge interrupt occurs.
  • CP0FIF (Comparator 0 Falling-Edge Interrupt Flag) is set when a Comparator 0 falling edge interrupt occurs.
  • CORSEF (Comparator 0 Reset Flag) is set to reset Comparator 0.
  • CP0HYP (Comparator 0 Positive Hysteresis Control Bits) selects 0, 2, 4 or 10 mV of positive hysteresis.
  • CP0HYN (Comparator 0 Negative Hysteresis Control Bits) selects 0, 2, 4 or 10 mV of negative hysteresis.
  • CPT0MX (Comparator 0 MUX Selection Register) contains the positive and negative input controls for CMX0P and CMX0N.
  • CMX0P (Comparator 0 Positive Input MUX Select) selects the port pins to be used for positive input.
  • CMX0N (Comparator 0 Negative Input MUX Select) selects the port pins to be used for negative input.
  • CP0P (Comparator 0 Positive Input Voltage) displays the Comparator 0 negative input voltage.
  • CP0N (Comparator 0 Negative Input Voltage) displays the Comparator 0 positive input voltage.
  • CPT0MD (Comparator 0 Mode Selection Register) selects the Comparator 0 response time.

CPxN VTREG
Data Type: float

CPxN is the negative input voltage for Comparator x. x is the Comparator number, 0 or 1. Typing the following command in the debugger's Command Window sets the negative input voltage for Comparator 1 to 1.5 volts:

CP1N = 5.5

You may display the Comparator 0 negative input voltage in the debugger's Output Window by typing the following command:

CP0N

CPxP VTREG
Data Type: float

CPxN is the positive input voltage for Comparator x. x is the Comparator number, 0 or 1. Typing the following command in the debugger's Command Window sets the positive input voltage for Comparator 0 to 0.75 volts:

CP0P = 0.75

You may display the Comparator 1 positive input voltage in the debugger's Output Window by typing the following command:

CP1P
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.