Precision Rectifier Using Mixer – PSoC® 3/PSoC 5 Project Name: Precision Rectifier Programming Language: C Associated Part Families:CY8C38xx/CY55xx ® Software: PSoC Creator™ Related Hardware: CY8CKIT-001 Prerequisites: Example Project: Using System Wide Resources Author: Praveen Sekar Project Objective This project demonstrates full wave rectifier implementation using mixer component . Overview The sine wave is given to the input of the Multiplying mixer. The mixer operates as follows: As an Inverting amplifier when its local oscillator input is Low (-1). And as a Non-inverting amplifier when its local oscillator input is High (+1). The local oscillator input of the mixer receives the square wave of the same frequency as an input sine wave. A rectified wave is thus obtained at the mixer output. Component List Instance Name Mixer_Multiplier Component Name Mixer Version 1.10 Component Category Analog Comments Configured as Multiplier Comp_ZCD Comparator 1.10 Analog -- Opamp_Buffer Opamp 1.10 Analog Amplifiers The opamp buffers the reference voltage (Vdda/2) before it is brought out on the pin Pin_SineInput Analog Pin 1.20 Ports and Pins -- Pin_RectifiedOut Analog Pin 1.20 Ports and Pins -- Pin_Reference Analog Pin 1.20 Ports and Pins -- Vdda/2 VRef 1.0 System -- June 3, 2010 Document No. 001-61919 Rev. ** 1 [+] Feedback Mixer_Rectifier Top Design The following figure shows the Components and its Routing. The following figure shows the Pin Configuration (as in .cydwr file) June 3, 2010 Document No. 001-61919 Rev. ** 2 [+] Feedback Mixer_Rectifier Component Configuration Mixer_Multiplier Opamp_Buffer Note The Opamp component buffers the reference voltage (Vdda/2) before it is brought out on the pin. June 3, 2010 Document No. 001-61919 Rev. ** 3 [+] Feedback Mixer_Rectifier Comp_ZCD Design Wide Resources This project uses the default configuration. Refer to the .cydwr file for the default settings. Operation A multiplying mixer acts as a unity gain amplifier alternating its gain between high (+1) and low (-1) based on the local oscillator input level. So, when the input wave’s comparator output is fed as a local oscillator input, a rectified output is obtained. The waveform depicts the input signal, comparator output and the mixer output. As shown in the figure, whenever the sine wave goes below zero, the comparator output also goes low which alternates the gain to -1 and hence the negative half of the incoming sine wave is always given a gain of -1, positive half given a gain of +1 leading to rectification. The comparator’s response time is 30 ns. For an input signal frequency of 333 kHz, the period is 100 times the response time and the response time do not cause a big impact. June 3, 2010 Document No. 001-61919 Rev. ** 4 [+] Feedback Mixer_Rectifier Hardware Connections The external sine input signal needs to be reference with respect to Vdda/2. Hence, apply 1 V amplitude and 1 kHz sin wave signal to Pin P0[2] with respect to Pin P0[1]. Connect the signal generator output signal to P0[2] and the signal generator ground to Pin P0[1]. Connect pin P0[2] and P3[3] to Oscilloscope to view input signal and rectified output signal respectively. For rest of the basic settings of the DVK, refer to the CY8CKIT-001 PSoC Development Kit Board Guide which is supplied with the kit. Output Build the Project and Program the PSoC 3 device, Note The default device selection is PSoC 3 (CY8C3866AXI-040), for using this project with PSoC 5 Device follow the given steps. Go to Project Device Selector Select PSoC 5 device (CY8C5588AXI-060), build the project again and program the PSoC 5 device as shown in the Figure 1 on Page 6. June 3, 2010 Document No. 001-61919 Rev. ** 5 [+] Feedback Mixer_Rectifier Figure 1. Program PSoC 5 Device Press SW4 to reset the device. (Reset Switch) The following figure shows the Input Signal and Rectified Output. June 3, 2010 Document No. 001-61919 Rev. ** 6 [+] Feedback Mixer_Rectifier PSoC is a registered trademark of Cypress Semiconductor Corp. "Programmable System -on-Chip," CyDesigner is trademark of Cypress Semiconductor Corp. All other trademarks or registered trademarks referenced herein are the property of their respective owners. Cypress Semiconductor 198 Champion Court San Jose, CA 95134-1709 Phone: 408-943-2600 Fax: 408-943-4730 http://www.cypress.com/ © Cypress Semiconductor Corporation, 2010. The information contained herein is subject to change without notice. Cypress Semiconductor Corporation assumes no responsibility for the use of any circuitry other than circuitry embodied in a Cypress product. Nor does it convey or imply any license under patent or other rights. Cypress products are not warranted nor intended to be used for medical, life support, life saving, critical control or safety applications, unless pursuant to an express written agreement with Cypress. Furthermore, Cypress does not authorize its products for use as critical components in life-support systems where a malfunction or failure may reasonably be expected to result in significant injury to the user. The inclusion of Cypress products in life-support systems application implies that the manufacturer assumes all risk of such use and in doing so indemnifies Cypress against all charges. This Source Code (software and/or firmware) is owned by Cypress Semiconductor Corporation (Cypress) and is protected by and subject to worldwide patent protection (United States and foreign), United States copyright laws and international treaty provisions. Cypress hereby grants to licensee a personal, non-exclusive, non-transferable license to copy, use, modify, create derivative works of, and compile the Cypress Source Code and derivative works for the sole purpose of creating custom software and or firmware in support of licensee product to be used only in conjunction with a Cypress integrated circuit as specified in the applicable agreement. Any reproduction, modification, translation, compilation, or rep resentation of this Source Code except as specified above is prohibited without the express written permission of Cypress. Disclaimer: CYPRESS MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS MATERIAL, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. Cypress reserves the right to make changes without further notice to the materials described herein. Cypress does not assume any liability arising out of the application or use of any product or circuit described herein. Cypress does not authorize its products for use as critical components in life-support systems where a malfunction or failure may reasonably be expected to result in significant injury to the user. The inclusion of Cypress’ product in a life-support systems application implies that the manufacturer assumes all risk of such use and in doing so indemnifies Cypress against all charges. Use may be limited by and subject to the applicable Cypress software license agreement. June 3, 2010 Document No. 001-61919 Rev. ** 7 [+] Feedback