Comparator (Comp) Features. General Description. When to use a Comparator Low input offset. User controlled offset calibration

Similar documents
Comparator (Comp) Features. General Description. When to use a Comparator 1.60

Use the Status Register when the firmware needs to query the state of internal digital signals.

The AMuxSeq is capable of having between 2 and 32 analog inputs. The paired inputs are present when the MuxType parameter is set to "Differential.

This optional pin is present if the Mode parameter is set to SyncMode or PulseMode. Otherwise, the clock input does not show.

This input determines the next value of the output. The output does not change until the next rising edge of the clock.

Use the Status Register when the firmware needs to query the state of internal digital signals.

Scanning Comparator (ScanComp) Features. General Description. Input/Output Connections. When to Use a Scanning Comparator. clock - Digital Input* 1.

Digital Logic Gates. Features. General Description. Input/Output Connections. When to Use a Logic Gate. Input 1. Input 2. Inputs 3-8 * 1.

Digital Multiplexer and Demultiplexer. Features. General Description. Input/Output Connections. When to Use a Multiplexer. Multiplexer 1.

PSoC 6 Current Digital to Analog Converter (IDAC7)

This section describes the various input and output connections for the SysInt Component.

Automatic reload of the period to the count register on terminal count

PSoC Creator Quick Start Guide

PSoC 4 Current Digital to Analog Converter (IDAC)

Use a DieTemp component when you want to measure the die temperature of a device.

One 32-bit counter that can be free running or generate periodic interrupts

Setting Oscillation Stabilization Wait Time of the main clock (CLKMO) and sub clock (CLKSO)

Base Timer Channel (BT) Features. General Description. When to Use a PDL_BT Component 1.0

Analog Multiplexer (AMux) Features. General Description. Input/Output Connections. When to Use an AMux Single or differential connections

Supports a range of speeds of external memories (from 5 to 200 ns) Supports external memory power-down, sleep, and wakeup modes

Capable of adjusting detection timings for start bit and data bit

For More Information Please contact your local sales office for additional information about Cypress products and solutions.

PSoC 4 Voltage Comparator (Comp) Features. General Description. When to Use Comparator Low input offset. User controlled offset calibration

Multifunction Serial Interface (PDL_MFS) Features. General Description. When to Use a PDL_MFS Component. Quick Start 1.0

Optional Pause Pulse for constant frame length of 282 clock ticks

W H I T E P A P E R. Timing Uncertainty in High Performance Clock Distribution. Introduction

Use the IDAC8 when a fixed or programmable current source is required in an application.

EZ-PD Analyzer Utility User Guide

W H I T E P A P E R. Introduction. Devices. Energy Comparison of Cypress F-RAM and EEPROM

CE CY8CKIT-042-BLE F-RAM Data Logger

PSoC 4 Low Power Comparator (LPComp) Features. General Description. When to Use a LPComp 2.0. Low input offset. User controlled offset calibration

Cypress BLE-Beacon ios App User Guide

ModusToolbox USB Configurator Guide

For More Information Please contact your local sales office for additional information about Cypress products and solutions.

PSoC 4 Voltage Comparator (Comp) Features. General Description. When to Use Comparator Low input offset. User controlled offset calibration

THIS SPEC IS OBSOLETE

Supports Analog, Digital I/O and Bidirectional signal types

Shift Register. Features. General Description 1.20

CE95314 PSoC 3, PSoC 4, and PSoC 5LP EZI2C

Configurable transfer modes: single transfer, 1D transfer (using X loop) and 2D transfer (using both X and Y loops).

Sequencing Successive Approximation ADC (ADC_SAR_Seq) Features. General Description. When to Use the ADC_SAR_Seq Supports PSoC 5LP devices

Operational Amplifier (Opamp) Features. General Description. Input/Output Connections. Noninverting Analog Follower or Opamp configuration

AN F²MC-16FX Family, I2C. Contents. 1 Introduction. This application note describes how to communicate via I2C with a Serial EEPROM.

Use the Status Register when the firmware needs to query the state of internal digital signals.

This optional pin is present if the Mode parameter is set to SyncMode or PulseMode. Otherwise, the clock input does not show.

F²MC-8FX Family MB95200H/210H Series Capacitance Touch Sensor

Nine-Output 3.3 V Buffer

Use the Status Register when the firmware needs to query the state of internal digital signals.

EZ I2C Slave. Features. General Description. When to use a EZ I 2 C Slave Industry standard Philips I 2 C bus compatible interface

This optional pin is present if the Mode parameter is set to SyncMode or PulseMode. Otherwise, the clock input does not show.

FM3 Family Motor Graphical Interface User Manual

For More Information Please contact your local sales office for additional information about Cypress products and solutions.

BGM Adaptor MB E Operation Manual. 8FX Family 8-bit Microcontroller. Doc. # Rev. *A

MB39C811-EVB-03. PMIC for Solar/Vibration Energy Harvesting, Evaluation Board Operation Guide. Doc. No Rev. *B

Voltage Reference (Vref) Features. General Description. Input/Output Connections. When to Use a Vref Voltage references and supplies

Chip Errata for the MB96300/MB96600 Series MOVS/MOVSW Overlap of source and destination region, F 2 MC-16FX Microcontroller

The Emulated EEPROM Component should be used to store nonvolatile data on a target device.

PSoC 4 Operational Amplifier (Opamp) Features. General Description. When to Use the Opamp Follower or Opamp configuration

AN FR Family, MB91F467S Emulation. 1 Introduction. 2 Hardware Setup. 2.1 Required parts

External Library. Features. General Description 1.0. The library provides documentation for external components

ADC Successive Approximation Register (ADC_SAR)

The color of the Clock component waveform symbol will change based on the clock's domain (as shown in the DWR Clock Editor), as follows:

PSoC Creator Component Datasheet

TI: Uses a short pulse on spi_select to indicate start of transaction. National Semiconductor (Microwire): Transmission and Reception occur separately

EZ I 2 C Slave. Features. General Description. When to use a EZ I 2 C Slave 1.50

AN SIO Tips and Tricks in PSoC 3 / PSoC 5. Application Note Abstract. Introduction

CY8CKIT-002. PSoC MiniProg3 Program and Debug Kit Guide. Doc. # Rev. *H

8-Bit Voltage Digital to Analog Converter (VDAC8)

Filter_ADC_VDAC_poll Example Project Features. General Description. Development Kit Configuration

CY7C603xx CYWUSB

Master modes provide all functionality necessary to work in a multi-master environment.

Peripheral Driver Library (PDL) Component (PDL Application Programming Interface (API) only)

PSoC Creator 4.2 Production Release Notes

FM0+ Family S6E1A1 Series, Flash Programming Guide

FM4 S6E2Cx Series Over The Air Update 32-Bit Microcontroller With Embedded Dual Flash

Version February 02, 2018

Programmable Threshold Comparator Data Sheet

CE PSoC 4: Time-Stamped ADC Data Transfer Using DMA

This section describes the various input and output connections for the Voltage Fault Detector.

This section describes the various input and output connections for the Voltage Fault Detector.

Sequencing Successive Approximation ADC (ADC_SAR_Seq) Features. General Description. When to Use the ADC_SAR_Seq 2.0. Supports PSoC 5LP devices

Voltage Fault Detector (VFD) Features. General Description. Input/Output Connections. When to Use a VFD. Clock Input 2.30

Supports one or two address decoding with independent memory buffers. Memory buffers provide configurable Read/Write and Read Only regions

Inverting Programmable Gain Amplifier (PGA_Inv)

Graphic LCD Interface (GraphicLCDIntf) Features. General Description. When to Use a GraphicLCDIntf 1.80

FM Universal Peripheral Driver Library Quick Start Guide

Preliminary. Gas Sensor Analog Front End Datasheet GasSensorAFE V Features and Overview. This datasheet contains Preliminary information.

Supported Devices: CY8C28x13, CY8C28x33, CY8C28x43, CY8C28x45, CY8C28x52, CY8C21x45, CY8C22x45, CY8C24x93. CY8C24x

8 to 1 Analog Multiplexer Datasheet AMux8 V 1.1. Features and Overview

PSoC 1 In-Circuit Emulator Development Kit Guide

For one or more fully configured, functional example projects that use this user module go to

Incremental ADC Data Sheet

4 to 1 Analog Multiplexer Data Sheet

Writing to Internal Flash in PSoC 3 and PSoC 5

16-Mbit (512 K words 32 bits) Static RAM with Error-Correcting Code (ECC)

Cypress EZ-PD Configuration Utility User Manual

Hardware Design Guidelines for Using EZ-PD CCG3PA Devices in Power Adapter Applications

PSoC Creator Component Data Sheet

Programmable Gain Amplifier Datasheet PGA V 3.2. Features and Overview

Smart IO. Features. General Description 1.0. Provides glue logic functionality at I/O ports. Low-power mode (Deep Sleep and Hibernate) operation

Transcription:

1.50 Features Low input offset User controlled offset calibration Multiple speed modes Low power mode Output routable to digital logic blocks or pins Selectable output polarity Configurable operation mode during Sleep and Hibernate General The component provides a hardware solution to compare two analog input voltages. The output can be sampled in software or digitally routed to another component. Three speed levels are provided to enable you to optimize for speed or power consumption. A reference or external voltage may be connected to either input. You can also invert the output of the comparator using the Polarity parameter. When to use a Comparator The Comparator can provide a fast comparison between two voltages as compared to using an ADC. Although an ADC can be used with software to compare multiple voltages levels, applications requiring fast response or little software intervention are good candidates for this comparator. Some example applications include CapSense, power supplies, or simple translation from an analog level to a digital signal. A common configuration is to create an adjustable comparator by connecting a voltage DAC to the negative input terminal. Cypress Semiconductor Corporation 198 Champion Court San Jose, CA 95134-1709 408-943-2600 Document Number: 001-63159 Rev *D Revised September 12, 2016

PSoC Creator Component Data Sheet Input/Output Connections This section describes the input and output connections for the Comp. An asterisk (*) in the list of I/O s states that the I/O may be hidden on the symbol under the conditions listed in the description of that I/O. Positive Input Analog This input is usually connected to the voltage that is being compared. This input can be routed to GPIOs and internal signals through analog globals, and to a selection of references. Negative Input Analog This input is usually connected to the reference voltage. This input can be routed to GPIOs and internal signals through the analog globals and to a selection of references. Comparator Out Digital Output The output of the comparison. For the non-inverting configuration, this output goes high when the positive input voltage is greater than the negative input voltage. If the polarity is set to inverting, the output will go high when the negative input voltage is greater than the positive input voltage. The output can be routed to the digital interconnect and interrupt structures. clock Digital Input * The clock input will synchronize the comparator output to the rising edge of the clock when the Sync parameter is set to "Normal." This forces the comparator output to be sampled on the rising edge of the clock. When the Sync parameter is set to "Bypass" the output is not synchronized and the clock input terminal no longer displayed on the component symbol. Page 2 of 13 Document Number: 001-63159 Rev *D

Parameters and Setup Drag a Comparator onto your design and double-click it to open the Configure dialog. The Comparator provides the following parameters. Hysteresis This parameter enables allows you to add approximately 10 mv of hysteresis to the comparator. This will help to ensure that slowly moving voltages or slightly noisy voltages will not cause the output of the comparator to oscillate when the two input voltages are near equal. Speed This parameter provides a way for the user to optimize speed verses power consumption. Ultra Low Power Slow (default) Speed Options Use this setting for very low power applications. Use this setting for signals requiring response times slower than 80ns Document Number: 001-63159 Rev *D Page 3 of 13

PSoC Creator Component Data Sheet Fast Speed Options Use this setting for signals requiring response times faster than 80ns Power Down Override Enabling the power down override parameter causes the comparator to stay active during Sleep and Hibernate modes. Polarity This parameter allows you to invert the output of the comparator. This is useful for peripherals that require an inverted signal from the comparator. The sampled signal state returned by the software API is not affected by this parameter. Polarity Options Inverting Non Inverting (default) Output goes high when positive input is less than the negative input Output goes high when positive input is greater than negative input Sync This parameter selects between synchronizing the output with a clock and connecting directly to the comparator output. When Normal is selected, the output will change on the rising edge of the clock input. Normal (default) Bypass Sync Options Sync the comparator output with the clock input. Connect the analog comparator directly to the output signal. Placement There are no placement specific options. Resources The Comparator component uses one analog comparator block. Page 4 of 13 Document Number: 001-63159 Rev *D

Application Programming Interface Application Programming Interface (API) routines allow you to configure the component using software. The following table lists the interface to each function. The subsequent sections cover each function in more detail. By default, PSoC Creator assigns the instance name "Comp_1" to the first instance of a component in a given design. You can rename the instance to any unique value that follows the syntactic rules for identifiers. The instance name becomes the prefix of every global function name, variable, and constant symbol. For readability, the instance name used in the following table is "Comp". Function void Comp_Init(void) void Comp_Enable(void) void Comp_Start(void) void Comp_Stop(void) void Comp_SetSpeed(uint8 speed) uint8 Comp_ZeroCal(void) uint8 Comp_GetCompare(void) void Comp_LoadTrim(uint8 trimval) void Comp_Sleep (void) void Comp_Wakeup (void) void Comp_SaveConfig(void) void Comp_RestoreConfig(void) void Comp_PwrDwnOverrideEnable(void) void Comp_PwrDwnOverrideDisable(void) Initialize or Restore default Comparator configuration. Enable the Comparator. Initializes the Comparator with default customizer values. Turn off Comparator Set speed of comparator. Zero the input offset of comparator. Returns compare result. Write a value to the comparator trim register Stops the comparator operation and saves the user configuration. Restores and enables the user configuration. Empty function. Provided for future usage. Empty function. Provided for future usage. Enables comparator operation in sleep mode Disables comparator operation in sleep mode Document Number: 001-63159 Rev *D Page 5 of 13

PSoC Creator Component Data Sheet Global Variables Variable Comp_initVa r Indicates whether the Comparator has been initialized. The variable is initialized to 0 and set to 1 the first time Comp_Start() is called. This allows the component to restart without reinitialization after the first call to the Comp_Start() routine. If reinitialization of the component is required, then the Comp_Init() function can be called before the Comp_Start() or Comp_Enable() function. void Comp_Init(void) Initializes/Restores default Comparator configuration. void Comp_Enable(void) Enables the Comparator. void Comp_Start(void) Initializes the Comparator with default customizer values. Enables and powers up the comparator. Page 6 of 13 Document Number: 001-63159 Rev *D

void Comp_Stop(void) Disable and power down the comparator. Note This API is not recommended for use on PSoC 3 ES2 and PSoC 5 ES1 silicon. These devices have a defect that causes connections to several analog resources to be unreliable when not powered. The unreliability manifests itself in silent failures (e.g. unpredictably bad results from analog components) when the component utilizing that resource is stopped. It is recommended that all analog components in a design should be powered up (by calling the <INSTANCE_NAME>_Start() APIs) at all times. Do not call the <INSTANCE_NAME>_Stop() APIs. void Comp_SetSpeed(uint8 speed) This function selects one of three speed modes for the comparator. The comparator power consumption increases for the faster speed modes. (uint8) speed: Speed parameter, see table below for valid settings. Speed Options Comp_LOWPOWER Comp_SLOWSPEE D Comp_HIGHSPEED Use this setting for very low power applications. Use this setting for signals requiring response times slower than 80ns Use this setting for signals requiring response times faster than 80ns Document Number: 001-63159 Rev *D Page 7 of 13

PSoC Creator Component Data Sheet uint8 Comp_ZeroCal(void) Performs custom calibration of the input offset to minimize error for a specific set of conditions: comparator reference voltage, supply voltage and operating temperature. A reference voltage in the range at which the comparator will be used must be applied to the negative input of the comparator while the offset calibration is performed. The comparator component must be configured for Fast or Slow operation when calibration is performed. The calibration process will not work correctly if the comparator is configured in Low Power mode. (uint8) the value from the comparator trim register after the offset calibration is complete. This value has the same format as the input parameter for the Comp_LoadTrim() API routine. Refer to the PSoC3, PSoC5 Technical Reference Manual for a description of the comparator trim register. During the calibration procedure the comparator output may behave erratically. During the calibration procedure the analog routing switches for the comparator positive input will be reconfigured. This reconfiguration may affect the analog signal routing for other components that are connected to the comparator positive input. When calibration is complete all routing and comparator configuration registers will be restored to the state they were in before calibration occurred. uint8 Comp_GetCompare(void) This function returns a non-zero value when the voltage connected to the positive input is greater than the negative input voltage. This value is not affected by the Polarity parameter. This value always reflects a non-inverted state. (uint8) comparator output state none zero value when the positive input voltage is greater than the negative input voltage, otherwise the return value is zero. Page 8 of 13 Document Number: 001-63159 Rev *D

void Comp_LoadTrim(uint8 trimval) This function writes a value into the comparator trim register. (uint8) trimval: Value to be stored in the comparator trim register. This value has the same format as the parameter returned by the Comp_ZeroCal() API routine. Refer to the PSoC3, PSoC5 Technical Reference Manual for a description of the comparator trim register. void Comp_SaveConfig(void) Saves the user configuration. Empty function. Implemented for future usage. No effect by calling this function. void Comp_RestoreConfig(void) Restores the user configuration. Empty function. Implemented for future usage. No effect by calling this function. void Comp_Sleep(void) Stops the comparator operation and saves the user configuration. Document Number: 001-63159 Rev *D Page 9 of 13

PSoC Creator Component Data Sheet void Comp_Wakeup(void) Restores and enables the user configuration. void Comp_PwrDwnOverrideEnable(void) This is the power down override feature. This function allows the component to stay active during sleep mode. void Comp_PwrDwnOverrideDisable(void) This is the power down override feature. This function allows the comparator to stay inactive during sleep mode. Sample Firmware Source Code The following is a C language example demonstrating the basic functionality of the Comp. This example assumes the component has been placed in the schematic and renamed to "Comp_1". #include <device.h> void main() { uint8 cmpval; Comp_1_Start( ); /* Turn on comparator */ Comp_1_SetSpeed(Comp_1_HIGHSPEED); /* Set high speed mode */ cmpval = Comp_1_GetCompare(); /* Return comparator state */ } Page 10 of 13 Document Number: 001-63159 Rev *D

Functional The Comparator component is similar to most common analog comparators on the market. The Comparator component offer greater flexibility in supporting the configuration of options such as speed/power, hysteresis, and clock synchronization. DC and AC Electrical Characteristics The Comp will operate at all valid supply voltages. Comparator DC Specifications Parameter Conditions Min Typ Max Units VIOFF Input offset voltage in fast mode Input offset voltage in slow mode Factory trim Factory trim - - - - ±2 mv ±2 mv VIOFF Input offset voltage in fast mode Input offset voltage in slow mode Custom trim Custom trim - - - - ±2 mv ±1 mv VIOFF Input offset voltage in ultra low power mode - ±12 - mv VHYST Hysteresis Hysteresis enable mode - 10 32 mv VICM Input common mode voltage Fast mode 0 - VDDA- 0.1 V Slow mode 0 - VDDA V CMRR Common mode rejection ratio 50 - - db ICMP High current mode/fast mode - - 400 μa Low current mode/slow mode - - 100 μa Ultra low power mode - 6 - μa Document Number: 001-63159 Rev *D Page 11 of 13

PSoC Creator Component Data Sheet Component Changes This section lists the major changes in the component from the previous version. Version of Changes Reason for Changes / Impact 1.50.d 1.50.c 1.50.b 1.50.a Minor datasheet edits. Minor datasheet edits. Minor datasheet edits. Added Known Problems and Solutions to datasheet To provide a workaround for hysteresis problem in PSoC3 ES2 silicon. 1.50 Added Sleep/Wakeup and Init/Enable APIs. To support low power modes, as well as to provide common interfaces to separate control of initialization and enabling of most components. Updated Configure dialog with customized interface. Added Power Down Override parameter to the Configure dialog. Added _PwrDwnOverrideEnable / _PwrDwnOverrideDisable APIs. The updated Configure dialog makes it easier to use. There is also a preview of how the component will change based on various selections. To allow configuration of Comparator to operate during sleep and hibernate modes. To allow the component to stay active / inactive during sleep mode. Known Problems and Solutions Problem & Solution Hysteresis implementation for PSoC3 ES2 silicon in version 1.50 of comparator component is broken. Workaround for this issue is : To disable the Hysteresis write: Comp_CR = 0x20; To enable the Hysteresis write: Comp_CR &=0xDF; Cypress ID 84266 Page 12 of 13 Document Number: 001-63159 Rev *D

Cypress Semiconductor Corporation, 2009-2016. This document is the property of Cypress Semiconductor Corporation and its subsidiaries, including Spansion LLC ( Cypress ). This document, including any software or firmware included or referenced in this document ( Software ), is owned by Cypress under the intellectual property laws and treaties of the United States and other countries worldwide. Cypress reserves all rights under such laws and treaties and does not, except as specifically stated in this paragraph, grant any license under its patents, copyrights, trademarks, or other intellectual property rights. If the Software is not accompanied by a license agreement and you do not otherwise have a written agreement with Cypress governing the use of the Software, then Cypress hereby grants you a personal, non-exclusive, nontransferable license (without the right to sublicense) (1) under its copyright rights in the Software (a) for Software provided in source code form, to modify and reproduce the Software solely for use with Cypress hardware products, only internally within your organization, and (b) to distribute the Software in binary code form externally to end users (either directly or indirectly through resellers and distributors), solely for use on Cypress hardware product units, and (2) under those claims of Cypress s patents that are infringed by the Software (as provided by Cypress, unmodified) to make, use, distribute, and import the Software solely for use with Cypress hardware products. Any other use, reproduction, modification, translation, or compilation of the Software is prohibited. TO THE EXTENT PERMITTED BY APPLICABLE LAW, CYPRESS MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS DOCUMENT OR ANY SOFTWARE OR ACCOMPANYING HARDWARE, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. To the extent permitted by applicable law, Cypress reserves the right to make changes to this document without further notice. Cypress does not assume any liability arising out of the application or use of any product or circuit described in this document. Any information provided in this document, including any sample design information or programming code, is provided only for reference purposes. It is the responsibility of the user of this document to properly design, program, and test the functionality and safety of any application made of this information and any resulting product. Cypress products are not designed, intended, or authorized for use as critical components in systems designed or intended for the operation of weapons, weapons systems, nuclear installations, life-support devices or systems, other medical devices or systems (including resuscitation equipment and surgical implants), pollution control or hazardous substances management, or other uses where the failure of the device or system could cause personal injury, death, or property damage ( Unintended Uses ). A critical component is any component of a device or system whose failure to perform can be reasonably expected to cause the failure of the device or system, or to affect its safety or effectiveness. Cypress is not liable, in whole or in part, and you shall and hereby do release Cypress from any claim, damage, or other liability arising from or related to all Unintended Uses of Cypress products. You shall indemnify and hold Cypress harmless from and against all claims, costs, damages, and other liabilities, including claims for personal injury or death, arising from or related to any Unintended Uses of Cypress products. Cypress, the Cypress logo, Spansion, the Spansion logo, and combinations thereof, WICED, PSoC, CapSense, EZ-USB, F-RAM, and Traveo are trademarks or registered trademarks of Cypress in the United States and other countries. For a more complete list of Cypress trademarks, visit cypress.com. Other names and brands may be claimed as property of their respective owners. Document Number: 001-63159 Rev *D Page 13 of 13