DATASHEET SEARCH SITE | WWW.ALLDATASHEET.COM

Document overview

  • Manufacturer or author: Provided By ALLDATASHEET.COM(FREE DATASHEET DOWNLOAD SITE)
  • PDF pages: 5

Technical content

internal boost regulator which operates from sources as low as 0.5 V. Figure 1. Current-Sense Amplifier with Input Offset Voltage Correction subsequently reads the value periodically, remaining in sleep mode and consuming less than 8 µA. for long periods and save power, waking only periodically to read this mean current level.

2 Rev. 1.0 The accuracy of the circuit is extremely good and is generally limited only by the accuracy of the resistors used. 1% resistors yielded an error of no more than 1 µA. Op amp input offset voltages need to be considered carefully in this circuit. The TS1001 op amp is specified with +/ -3mV maximum input offset voltage at 25ºC, which correspo nds to +/-3mA of error. Another consideration is that Q1 exhibits drain-source leakage current of a few 10s of nanoamps at 25C, but this can approach 1µA over the commercial temperature range. Since the current through Q1 is effectively controlled by the op amp loop; therefore, any drain-source leakage from Q1 appears as a current floor and this generates a corresponding minimum voltage output across R3 below which current cannot be measured until the op amp “takes over” at higher measured currents. Therefore, normal methods of removing the current sense amplifier offset by subtracting the zero-load voltage at V_iload will not work, since the offset voltage due to the op amp’s VOS and the current floor from Q1’s drain-source leakage cannot be separated. Therefore, the offset correction scheme utilizing Q1 and R7 is im plemented. Amplifier input offset voltage may be calibrated out using the principal of making two measurements of the same parameter at the two gain settings. The offset voltage then can be found as: where Viload_G1 and Viload_G2 are the measurements made with low range and high range mode, respectively, and where: In this case, RG1 = 500 and RG2 = 100, effectively providing two scales of 100 µA and 500 µA full scale, respectively. The CY8C38 Microcontroller Code for Offset-Voltage-Corrected Current-Sense Amplifier follows: Current used by Cypress CY8C38 Current used by the Current Sense Amplifier 8µA (average, polling) 860 nA * File Name: main.c * Version: 1.0 * Description: * This is source code for the Current Sense Amplifier #include #include * Function Name: main * Target Device: * CY8C38 processor void main() int32 ADCResult; float Iin; float Iin_corrected; char OutputString[32];

Rev. 1.0 3 float Offset; int16 Offsetcounter; Offsetcounter= (int16) 0; Offset= (float) 0; LED_P1_2_Write(0xFFu); // Indicates active mode. Remove LED for Icc. GAINSWITCH_P1_6_Write(0xFFu); // GAINSWITCH to mode 1 CYGlobalIntEnable; // global interrupts //LCD_Start(); // start components (LCD optional) isr_Start(); ADC_Start(); SleepTimer_Start(); // sleep timer params set in the GUI for(;;) ADC_StartConvert(); // make a conversion and wait while (ADC_IsEndConversion(ADC_RETURN_STATUS) == 0) ADCResult = ADC_CountsTo_mVolts(ADC_GetResult32()); // math Iin= (float) ADCResult/5 ; // units microamps Iin_corrected= (float) Iin - Offset; // Optional LCD display sprintf(OutputString, "%5.3f",Iin_corrected); // 300usecs LCD_Position(0,0); // write to L CD; 700usecs LCD_PrintString("I load="); LCD_Position(0,8); LCD_PrintString(OutputString); ADC_StopConvert(); if (Offsetcounter==32) if ((Iin> 50) && (Iin<100)) GAINSWITCH_P1_6_Write(0x00u); // switch gain to m ode 2 CyDelay(50u); // delay ADC_StartConvert(); // make a conversio n and wait while (ADC_IsEndConversion(ADC_RETURN_STATUS) == 0) ADCResult = ADC_CountsTo_mVolts(ADC_GetResult32()); Offset= (float) ADCResult/5*1.25 - Iin*0.25; // Optional LCD display LCD_Position(1,0); LCD_PrintString("Offset= "); sprintf(OutputString, "%5.3f",Offset); LCD_Position(1,8); LCD_PrintString(OutputString); Offsetcounter= (int16) 0; ADC_StopConvert(); GAINSWITCH_P1_6_Write(0xFFu); // switch gain to m ode 1 else else Offsetcounter= (int16) Offsetcounter+1; ADC_Sleep(); LED_P1_2_Write(0x00u); // LED off for sleep mode. CyPmSaveClocks(); // sleep mode CyPmSleep(PM_SLEEP_TIME_NONE, PM_SLEEP_SRC_CTW); CyPmReadStatus(CY_PM_CTW_INT); CyPmRestoreClocks(); // wake up ADC_Wakeup(); /* [] END OF FILE */

Rev. 1.0 5 CONTACT INFORMATION Silicon Laboratories Inc.

400 West Cesar Chavez

Austin, TX 78701 Tel: 1+(512) 416-8500 Fax: 1+(512) 416-9669 Toll Free: 1+(877) 444-3032 Please visit the Silicon Labs Technical Support web page: https://www.siliconlabs.com/support/pages/contacttechnicalsupport.aspx and register to submit a technical support request. Patent Notice Silicon Labs invests in research and development to help our customers differentiate in the market with innovative low-power, small size, analog- intensive mixed-signal solutions. Silicon Labs' extensive patent portfolio is a testament to our unique approach and world-class engineering team. Silicon Laboratories and Silicon Labs are trademarks of Silicon Laboratories Inc. Other products or brandnames mentioned herein are trademarks or registered trademarks of their respective holders. The information in this document is believed to be accurate in all respects at the time of publication but is subject to change without notice. Silicon Laboratories assumes no responsibility for errors and omissions, and disclaims responsibility for any consequences resulting from the use of information included herein. Additionally, Silicon Laboratories assumes no responsibility for the functioning of undescribed fea- tures or parameters. Silicon Laboratories reserves the right to make changes without further notice. Silicon Laboratories makes no warran- ty, representation or guarantee regarding the suitability of its products for any particular purpose, nor does Silicon Laboratories assume any liability arising out of the application or use of any product or circuit, and specifically disclaims any and all liability, including without limitation consequential or incidental damages. Silicon Laboratories products are not designed, intended, or authorized for use in applications intend- ed to support or sustain life, or for any other application in which the failure of the Silicon Laboratories product could create a situation where personal injury or death may occur. Should Buyer purchase or use Silicon Laboratories products for any such unintended or unauthorized application, Buyer shall indemnify and hold Silicon Laboratories harmless against all claims and damages.