The Datasheet Archive - 100 Million Datasheets from 7500 Manufacturers.    


Datasheet Search Engine   
 
Part # or Description: • 5V RS232 Driver • 2SC5066* • "Real Time Clock" • "USB connector" • "blue led" 5mm • 10 watt zener diode • 2N3055* motorola
 
Search Tip: Try entering the part number only. Include a wildcard (eg. lm317* or 1n4148*)

 

 

MicroConverterT Technical Note uC005 ADuC812 Software Calibration


Datasheet Thumbnail

  

Download PDF



Top Searches for this datasheet



Introduction:
MicroConverterT Technical Note uC005 ADuC812 Software Calibration
This Technical Note describes software routine used calibrate ADuC812 endpoint offset gain errors. software referred below found, along with this technical note, This document describes both functions software routines their standard applications. ADuC812 calibration coefficients, offset calibration gain calibration. Both offset gain calibration coefficients words, located Special Function Register (SFR) area. offset calibration coefficient divided into ADCOFSH bits) ADCOFSL bits) gain calibration coefficient divided into ADCGAINH bits) ADCGAINL bits). Each ADuC812 calibrated factory prior shipping offset gain calibration coefficients stored hidden area FLASH/EE memory. Each time ADuC812 powers internal power-on configuration routine, copies these coefficients into offset gain calibration registers area. MicroConverter accuracy vary from system system board layout, grounding, clock speed, etc. best accuracy your system, should perform software calibration routine described this technical note. Offset Gain Calibration Coefficients: offset calibration coefficient compensates offset errors both input signal. Increasing offset coefficient compensates positive offset, effectively pushes Transfer Function DOWN. Decreasing offset coefficient compensates negative offset, effectively pushes Transfer Function maximum offset that compensated typically VREF, which equates typically ±125mV with 2.5V reference. Similarly, gain calibration coefficient compensates gain errors both input signal. Increasing gain coefficient, compensates smaller analog input signal range scales Transfer Function effectively increasing slope transfer function. Decreasing gain coefficient, compensates larger analog input signal range scales Transfer Function DOWN, effectively decreasing slope transfer function. maximum analog input signal range which gain coefficient compensate 1.025 VREF minimum input range 0.975 VREF which equates typically 2.5% reference voltage.
Version Jan. 2000
MicroConverter Tech Note uC005
ADuC812 Offset Calibration Subroutine: CALZEROSCALE
MicroConverterT Technical Note uC005 ADuC812 Software Calibration
offset calibration subroutine described below called. calibrates offset
This subroutine found `812cal.asm' assembly file accompanying this technical note. calibrates offset error selected channel passed subroutine Accumulator (ACC). selected channel must externally held fixed system zero-scale voltage i.e. zero volts VREF), when subroutine called. This subroutine employs successive approximation algorithm. first iteration, subroutine sets (TESTBIT) ADCOFSH/L registers (i.e. sets ADCOFSH/L registers 2000h). conversions generated Carry flag average these results greater than equal 0.5. TESTBIT (MSB) left state, TESTBIT cleared. second iteration, MSB-1 becomes TESTBIT bit, same test sequence performed. This test sequence repeated each bits ADCOFSH/L registers. This subroutine uses bytes Stack store registers used code. These registers restored when subroutine completed. Offset Calibration Algorithm Flow: General Housekeeping code, i.e. store registers used code stack, ADC, etc. Clear Offset Calibration coefficient (ADCOFSH/L registers) 0000Hex. current TESTBIT Offset Calibration. first iteration effectively setting Offset Calibration coefficient 2000H. Perform conversions, average return (average result >=0.5). leave TESTBIT set, then clear TESTBIT Point next tested. After first iteration, MSB-1 becomes TESTBIT. Repeat steps until bits ADCOFSH/L registers have been tested. Restore registers stored stack step
Version Jan. 2000
MicroConverter Tech Note uC005
MicroConverterT Technical Note uC005 ADuC812 Software Calibration
0000H
ESTBIT ADCOFSH/L
DO10 C=(AVER >=0.5)
TESTBIT
CLEA TESTBIT
POIN TESTBIT
ADCOFSH/L TESTED
RESTO ISTER
Version Jan. 2000
MicroConverter Tech Note uC005
ADuC812 Gain Calibration Subroutine: CALFULLSCALE
MicroConverterT Technical Note uC005 ADuC812 Software Calibration
second subroutine calibrates gain error called. calibrates gain
This subroutine also found `812cal.asm' assembly file accompanying this technical note. calibrates gain error selected channel passed subroutine ACC. selected channel must externally held fixed system full-scale reference voltage (within ±2.5% VREF) when subroutine called. This subroutine also employs successive approximation algorithm. first iteration, subroutine sets (TESTBIT) ADCGAINH/L registers (i.e. sets ADCGAINH/L register 2000h). conversions generated Carry flag average these results less than 4094.5. TESTBIT (MSB) left state, then TESTBIT cleared. second iteration, MSB-1 becomes TESTBIT bit, same test sequence performed. This test sequence repeated each bits ADCGAINH/L registers. This subroutine uses bytes Stack store registers used code. These registers restored when subroutine completed. Gain Calibration Algorithm Flow: General Housekeeping code, i.e. store registers used code stack, ADC, etc. Clear Gain Calibration coefficient (ADCGAINH/L registers) 0000Hex current TESTBIT Gain Calibration coefficient. first iteration, effectively setting Gain Calibration coefficient 2000H. Perform conversions, average return (average result 4094.5). leave TESTBIT set, then clear TESTBIT. Point next tested. After first iteration, MSB-1 becomes TESTBIT. Repeat steps until bits ADCGAINH/L registers have been tested. Restore registers stored stack step
Version Jan. 2000
MicroConverter Tech Note uC005
MicroConverterT Technical Note uC005 ADuC812 Software Calibration
START
STORE REGISTERS USED
SUBRO UTINE
SETUP NORMAL MODE
GAIN REGISTER 0000H
TESTBI ADCGAINH
CONVERSIONS C=(AVERAGE<4094.5)
LEAVE TESTBIT
LEAR TESTBIT
POINT NEXT TESTBIT
ADCGAINH TESTED
ESTO ISTE VALUES FINISH
Version Jan. 2000
MicroConverter Tech Note uC005
MicroConverterT Technical Note uC005 ADuC812 Software Calibration
Evaluating Offset Gain Calibration Subroutines: wish evaluate performance calibration subroutines without writing your code, using this technical notes' companion code. following description assumes user using ADuC812 Quickstart Development System evaluation board software tools, also assumes that software tools installed default directory `C:\ADuC'. program `812cal00.asm' includes `812cal.asm' `UARTIO.asm' allows user evaluate offset gain calibration subroutines using preconfigured `hyper terminal' program supplied with ADuC812 QuickStart Development Kit. This program demonstrates offset gain factory calibrated coefficients your device well software calibrated coefficients generated using these routines. this program, follow steps below. Copy `812cal00.hex' program `ADuC\DownLoad' directory. Ensure (PSEN) inserted. double-click DownLoad icon type `812cal00.hex' click
window that comes
Download program will display below information, indicating that serial download successful.
This program will communicate with VT100 terminal, PC-based terminal emulator program (such "hyperterminal" windows), configured Hyperterminal users will find simple configuration file packaged with MicroConverter development tools. open Hyperterminal program, double-click 9600COM1 icon directory. located `C:\ADuC'
Remove (PSEN) press RESET button ADuC812 evaluation board. following screen should appear.
Version Jan. 2000
MicroConverter Tech Note uC005
MicroConverterT Technical Note uC005 ADuC812 Software Calibration
`default' offset gain coefficients those calibrated factory downloaded power-on configuration. `present' offset gain calibration coefficients current contents ADCOFSH/L ADCGAINH/L. Both `default' `present' values will different each ADuC812. results consecutive conversions selected channel default case shown). This channel changed using option which will dealt with after have calibrated ADC. zero-scale calibration (Option selected typing keyboard this adds another lines above screen (see below) prompting user choose particular input when calibrating remind user connect that input `AGND'.
After entering channel number, zero-scale calibration performed.
Version Jan. 2000
MicroConverter Tech Note uC005
MicroConverterT Technical Note uC005 ADuC812 Software Calibration
From picture above, that while `default' offset coefficient stays same, `present' value changes. this case value offset register increases therefore pushes transfer function down average `ADC results' gets closer zero. next step perform full-scale scale calibration choosing option `2'. This brings following following screen.
This screen which prompts user connect channel VREF enter number that channel(0 this example). Once channel number been entered, program performs full-scale calibration.
Version Jan. 2000
MicroConverter Tech Note uC005
MicroConverterT Technical Note uC005 ADuC812 Software Calibration
`present' gain coefficient been changed `1EE7' which current value ADCGAINH/L registers. this value greater than factory calibrated value, this effect scaling transfer function effectively increasing slope transfer function. calibration complete. After calibration, channel connected voltage source mid-scale (1.25V). Using option following results were gathered.
Option above allows user select different channel take conversions. Channel connected mid-scale then selected using option When selecting channel other than used when calibrating ADC, Channel Channel `Offset Error Matching' `Gain Error Matching' specifications input multiplexer should taken into account. These typically 1LSB 1.5LSB respectively
Version Jan. 2000
MicroConverter Tech Note uC005
MicroConverterT Technical Note uC005 ADuC812 Software Calibration
results reported from channel shown above. Though un-modified ADuC812 evaluation board very simply function calibration routine described above, single-supply op-amps that buffer inputs evaluation board will degrade performance (specifically noise repeatability) voltages near ground. Therefore, best offset-cal results will obtained only when driving input directly from low-impedance source such voltage calibrator dual supply op-amp. Gain-cal performance appreciably affected single supply op-amps when using 2.5V reference. should noted that offset gain calibration coefficients result software calibration current values stored Special Function Register area registers ADCOFSH/L ADCGAINL. These volatile values will lost when power removed ADuC812 been RESET. `power `reset', factory calibrated offset gain coefficients always copied from hidden Flash/EE space part `power-on configuration routine'. Integrating Offset Gain Calibration Routines into your Code: method integrate calibration subroutines into your code shown below. This uses `$INCLUDE' directive which includes integrates program `812cal.asm' (330 bytes approx.) into your code. This example requires input AGND input VREF before code executes. should noted that optimal endpoint calibration, Offset Calibration should performed Before Gain Calibration.
MAIN: SETB note: channel number passed calibration routine A,#00H pass channel number zero-scale calibration subroutine accumulator CALL CALZEROSCALE perform zero-scale calibration A,#01H pass channel number full-scale calibration subroutine accumulator CALL CALFULLSCALE perform full-scale calibration MAIN
SUBROUTINE INCLUDE FILES
Version Jan. 2000
MicroConverter Tech Note uC005
$INCLUDE(812CAL.asm)
MicroConverterT Technical Note uC005 ADuC812 Software Calibration
Assembler Directive Integrate file containing calibration subroutines
Calibrate Once Only Store Coefficients Flash/EE Data Space: Sometimes desirable perform calibration only once factory when your product first manufactured. This avoids extra steps calibrating every time power applied. these situations, nonvolatile Flash/EE data memory ADuC812 used store calibration results. These results, once stored, copied into calibration coefficient registers space whenever power applied system. example code segment below, page Flash/EE data memory space used store four bytes calibration data (2-bytes offset 2-bytes gain). code performs zero-scale calibration followed full-scale calibration. reads page copies ADCOFSH/L ADCGAINH/L registers EDATA1, Flash/EE data registers area. then performs erase page finally programs contents EDATA registers into Flash/EE data memory space. Note, this method used, chosen input channels offset gain calibration (channels this example) must connected ground VREF while code executes.
MAIN: CALL CALL A,#7 CALZEROSCALE CALERROR A,#6 CALFULLSCALE CALERROR select channel zero-scale calibration perform zero-scale (offset) calibration indicate error calibration fails select channel full-scale calibration perform full-scale (gain) calibration indicate error calibration fails
EADRL,#0 point page Flash/EE data space ECON,#1 Read page EDATA1,ADCOFSL move coefficients into EDATA1,2,3,4. EDATA2,ADCOFLH EDATA3,ADCGAINL EDATA4,ADCGAINH ECON,#5 Erase page ECON,#2 .and program EDATA1,2,3,4 page Flash/EE space rest main program would reside here. includes calibration subroutines
$INCLUDE(812cal.asm)
mentioned previously, code segment above typically executed part factory production test routine. However, code segment below integrated into final application program. This code simply copies software calibrated coefficients from first page Flash/EE data memory their designated locations.
MAIN: EADRL,#0 point page Flash/EE data space ECON,#1 read data from page into EDATA1,2,3,4 ADCOFSL,EDATA1 restore coefficients. ADCOFSH,EDATA2 ADCGAINL,EDATA3 ADCGAINH,EDATA4 .and continue program rest main program would reside here.
Version Jan. 2000
MicroConverter Tech Note uC005

Other recent searches


SiJ900DP - SiJ900DP   SiJ900DP Datasheet
OM1324SMM - OM1324SMM   OM1324SMM Datasheet
OM1324NMM - OM1324NMM   OM1324NMM Datasheet
OM1324NKM - OM1324NKM   OM1324NKM Datasheet
OM1324NTM - OM1324NTM   OM1324NTM Datasheet
OM1324STM - OM1324STM   OM1324STM Datasheet
OM1324N2M - OM1324N2M   OM1324N2M Datasheet
LM117A - LM117A   LM117A Datasheet
NTMS4807N - NTMS4807N   NTMS4807N Datasheet
IHSM-5832 - IHSM-5832   IHSM-5832 Datasheet
GTXO-546 - GTXO-546   GTXO-546 Datasheet
GTXO-546T - GTXO-546T   GTXO-546T Datasheet
GTXO-546V - GTXO-546V   GTXO-546V Datasheet
FB160LM - FB160LM   FB160LM Datasheet
AKD4118A-A - AKD4118A-A   AKD4118A-A Datasheet

 

Privacy Policy | Disclaimer
© 2012 Datasheet Archive