| Electronic Components Datasheet Search |
|
DS1852 Datasheet(PDF) 24 Page - Maxim Integrated Products |
|
|
|||||||||||||||||||||||||||||
DS1852 Datasheet(HTML) 24 Page - Maxim Integrated Products |
|
24 / 26 page ![]() DS1852 24 of 26 SCALING THE ADC procedure writeTrimValue(trim :integer); (* write trim to part *) procedure forceReference(Vin: real); (* applies reference voltage to input pin*) procedure waitForNewConversion(); (* writes update byte to zero and waits for update of new conversion with present trim *) function readValue():integer; (* reads converted digital answer *) procedure ProgramTrim(trim :integer);(*enables EE for table3 & programs trim*) Procedure calVad(maxInput :real) var Bit :integer; (* counter - represents bininary bit 15-0*) trim :integer; (* present trim values *) lsb :real; (* the lsb value of the voltage reading *) Vin :real; (* the reference input voltage *) Dec_in :integer; (* decimal representation of voltage input *) Dec_out :integer; (* voltage reading in decimal *) delta :integer; (* present error of voltage reading *) bestDelta :integer; (* the error closest to zero *) bestTrim :integer; (* the trim that gave the best delta *) Begin bestDelta := 1000000; bestTrim := 0; trim := 4095; (* 0FFFh *) lsb := maxInput / 65535; Dec_in := 63888; (* input is ~97.5% of full scale *) Vin := lsb * Dec_in; forceReference(Vin); (*Use SAR approach to trim course adjust on VAD scale bits 15-12*) for Bit := 15 downto 11 do (* must go 1 bit too far so that zero is possible solution *) begin if (Bit > 11) then begin trim := trim + lshft(1,Bit); end; writeTrimValue(trim); waitForNewConversion; Dec_out := readVoltage; delta := Dec_out - Dec_in; if ( delta >= 0 ) then |
|
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |