UG0657: ADC Scaling User Guide

ADC Scaling
UG0657 User Guide
Table of Contents
Introduction ....................................................................................................................3
Hardware Implementation .............................................................................................4
Inputs and Outputs ........................................................................................................................................ 5
Configuration Parameters .............................................................................................................................. 5
Resource Utilization ....................................................................................................................................... 6
List of Changes ..............................................................................................................7
Product Support.............................................................................................................8
Customer Service .......................................................................................................................................... 8
Customer Technical Support Center ............................................................................................................. 8
Technical Support .......................................................................................................................................... 8
Website .......................................................................................................................................................... 8
Contacting the Customer Technical Support Center ..................................................................................... 8
ITAR Technical Support ................................................................................................................................ 9
2
UG0657: ADC Scaling User Guide
Introduction
An analog to digital converter (ADC) converts a voltage signal as input to a digital signal in a number of bits that
depends on ADC resolution. The signals that are not readily available in voltage form, for example, current, are
converted to a voltage signal through some signal processing. The digital signal output of the ADC that is relative to
its bit width should be scaled to a value that can be properly interpreted by the system that processes the signal. The
digital output of ADC can have an unintended DC offset that could be generated by the signal processing circuit
before ADC input or the ADC itself. The offset value in signal measurement should be removed before using it in
digital algorithm. The ADC scaling performs the following functions:
•
Performs auto offset computation initially:
Involves disabling PWM and triggering the ADC by a pre-determined number of times (8192)
to determine zero current.
•
•
ChX_offset = adc_result_chX_i + ChX_offset
EQ1
Scales raw ADC data into phase currents:
Iph = (adc_result_chX_i − ChX_offset/8192) ∗ adc_scale_val_i
EQ2
Detects over current fault after phase current computation, which can be used to stop the motors
immediately.
UG0657: ADC Scaling User Guide
3
Hardware Implementation
Figure 1 shows the block diagram of ADC scaling.
reset_i
done_o
sys_clk_i
calib_done_o
adc_results_ready_i
adc_scale_val_i
ADC Scaling
adc_result_ch0_i
over_current_fault_o
ia_adc_o
adc_result_ch1_i
ib_adc_o
fault_threshold_i
Figure 1. System-level Block Diagram of ADC Scaling
The ADC scaling accumulates the first 8,192 samples of adc_result_ch0_i and adc_result_ch1_i. The calib_done_o
signal is asserted after 8,192 samples are accumulated. The accumulated data is averaged and subtracted from each
sample thereafter. This value is multiplied with adc_scale_val_i to give the actual ADC result. The block also asserts
the over_current_fault_o when the scaled currents are more than the fault_threshold_i value.
During simulation, the block need not accumulate a large number of samples. The g_DEBUG parameter can be
set to 1 to reduce the number of samples that are accumulated to 5, while setting it to 0 accumulates 8,192
samples.
UG0657: ADC Scaling User Guide
4
Hardware Implementation
Inputs and Outputs
Table 1 shows the input and output ports of ADC scaling.
Table 1. Inputs and Outputs of ADC Scaling
Signal Name
Direction
Description
reset_i
Input
Asynchronous active low reset signal to design.
sys_clk_i
Input
System clock.
adc_results_rdy_i
Input
Trigger indicating ADC inputs are available.
adc_scale_val_i
Input
Scaling value for currents.
adc_result_ch0_i
Input
Channel 0 result from ADC.
adc_result_ch1_i
Input
Channel 1 result from ADC.
fault_threshold_i
Input
Threshold value of current above which a fault is indicated.
done_o
Output
Indicates completion of scaling operations – high for one clock cycle.
calib_done_o
Output
A constant high signal indicates offset calibration is complete.
over_current_fault_o
Output
Indicates that at least one of the currents have exceeded the
fault_threshold_i input value. The signal goes back to zero (not latched)
when all the currents are less than fault_threshold_i.
ia_adc_o
Output
Scaled current value for phase a (from Channel 0).
ib_adc_o
Output
Scaled current value for phase b (from Channel 1).
Configuration Parameters
Table 2 shows the description of the configuration parameters used in the hardware implementation of ADC scaling.
These are generic parameters and can be varied as per the requirement of the application.
Table 2. Configuration Parameters
Signal Name
g_DEBUG
Description
When 0 supports Synthesis.
When 1 supports Simulation.
g_ADC_RESULTS_WIDTH
Defines the width of the inputs from ADC Measurements block.
g_STD_IO_WIDTH
Defines the width of the input and output signals.
g_APB3_IF_DATA_WIDTH
Defines the width of the data from the APB3 interface.
g_NO_MCYCLE_PATH
Defines the number of clock delays required before asserting the multiplier
done signal.
UG0657: ADC Scaling User Guide
5
Hardware Implementation
Resource Utilization
®
ADC scaling is implemented on the SmartFusion 2 system-on-chip (SoC) field programmable gate array (FPGA) and
®
IGLOO 2 devices. Table 3 shows the resource utilization report after synthesis with g_STD_IO_WIDTH value equal
to 18.
Table 3. Resource Utilization Report of PWM Scaling
Cell Usage
6
Count
SLE (Sequential)
138
Combinational Logic
260
MACC
1
RAM1Kx18
0
RAM64x18
0
UG0657: ADC Scaling User Guide
List of Changes
The following table shows important changes made in this document for each revision.
Date and Revision
Revision 1
(October 2015)
Change
Initial release.
UG0657: ADC Scaling User Guide
Page
N/A
7
Product Support
Microsemi SoC Products Group backs its products with various support services, including Customer Service,
Customer Technical Support Center, a website, electronic mail, and worldwide sales offices. This appendix contains
information about contacting Microsemi SoC Products Group and using these support services.
Customer Service
Contact Customer Service for non-technical product support, such as product pricing, product upgrades, update
information, order status, and authorization.
From North America, call 800.262.1060
From the rest of the world, call 650.318.4460
Fax, from anywhere in the world 650. 318.8044
Customer Technical Support Center
Microsemi SoC Products Group staffs its Customer Technical Support Center with highly skilled engineers who can
help answer your hardware, software, and design questions about Microsemi SoC Products. The Customer Technical
Support Center spends a great deal of time creating application notes, answers to common design cycle questions,
documentation of known issues and various FAQs. So, before you contact us, please visit our online resources. It is
very likely we have already answered your questions.
Technical Support
For Microsemi SoC Products Support, visit http://www.microsemi.com/products/fpga-soc/design-support/fpga-socsupport.
Website
You can browse a variety of technical and non-technical information on the Microsemi SoC Products Group home
page, at http://www.microsemi.com/products/fpga-soc/fpga-and-soc.
Contacting the Customer Technical Support Center
Highly skilled engineers staff the Technical Support Center. The Technical Support Center can be contacted by email
or through the Microsemi SoC Products Group website.
Email
You can communicate your technical questions to our email address and receive answers back by email, fax, or
phone. Also, if you have design problems, you can email your design files to receive assistance. We constantly
monitor the email account throughout the day. When sending your request to us, please be sure to include your full
name, company name, and your contact information for efficient processing of your request.
The technical support email address is [email protected].
My Cases
Microsemi SoC Products Group customers may submit and track technical cases online by going to My Cases.
UG0657: ADC Scaling User Guide
8
Product Support
Outside the U.S.
Customers needing assistance outside the US time zones can either contact technical support via email
([email protected]) or contact a local sales office. Visit About Us for sales office listings and corporate
contacts.
ITAR Technical Support
For technical support on RH and RT FPGAs that are regulated by International Traffic in Arms Regulations (ITAR),
contact us via [email protected]. Alternatively, within My Cases, select Yes in the ITAR
drop-down list. For a complete list of ITAR-regulated Microsemi FPGAs, visit the ITAR web page.
UG0657: ADC Scaling User Guide
9
Microsemi Corporation (Nasdaq: MSCC) offers a comprehensive portfolio of semiconductor
and system solutions for communications, defense & security, aerospace and industrial
markets. Products include high-performance and radiation-hardened analog mixed-signal
integrated circuits, FPGAs, SoCs and ASICs; power management products; timing and
synchronization devices and precise time solutions, setting the world's standard for time; voice
processing devices; RF solutions; discrete components; security technologies and scalable
anti-tamper products; Ethernet solutions; Power-over-Ethernet ICs and midspans; as well as
custom design capabilities and services. Microsemi is headquartered in Aliso Viejo, Calif., and
has approximately 3,600 employees globally. Learn more at www.microsemi.com.
Microsemi Corporate Headquarters
One Enterprise, Aliso Viejo,
CA 92656 USA
Within the USA: +1 (800) 713-4113
Outside the USA: +1 (949) 380-6100
Sales: +1 (949) 380-6136
Fax: +1 (949) 215-4996
E-mail: [email protected]
© 2015 Microsemi Corporation. All
rights reserved. Microsemi and the
Microsemi logo are trademarks of
Microsemi Corporation. All other
trademarks and service marks are the
property of their respective owners.
Microsemi makes no warranty, representation, or guarantee regarding the information contained herein or
the suitability of its products and services for any particular purpose, nor does Microsemi assume any
liability whatsoever arising out of the application or use of any product or circuit. The products sold
hereunder and any other products sold by Microsemi have been subject to limited testing and should not
be used in conjunction with mission-critical equipment or applications. Any performance specifications are
believed to be reliable but are not verified, and Buyer must conduct and complete all performance and
other testing of the products, alone and together with, or installed in, any end-products. Buyer shall not
rely on any data and performance specifications or parameters provided by Microsemi. It is the Buyer’s
responsibility to independently determine suitability of any products and to test and verify the same. The
information provided by Microsemi hereunder is provided “as is, where is” and with all faults, and the
entire risk associated with such information is entirely with the Buyer. Microsemi does not grant, explicitly
or implicitly, to any party any patent rights, licenses, or any other IP rights, whether with regard to such
information itself or anything described by such information. Information provided in this document is
proprietary to Microsemi, and Microsemi reserves the right to make any changes to the information in this
document or to any products and services at any time without notice.
50200657-1/10.15