View Full Version : vref ???
bill horn
03-23-07, 03:12 PM
While getting the a/d going on the tiny2138 I noted that the vref pin 63 on the cpu is not referenced to anything. It floats from .4v to 1.5v. The a/d seems to work accurately though. This is puzzleing to me, I connected this pin to 3.3v and there was no change in the a/d measurement. I connected this pin to ground with no change to a/d reading. I am using the burst mode on ad0.5.
Has anyone else ran into this?
bilorn
nmitech
03-23-07, 03:27 PM
I am not sure if you pin it out correctly, but pin 63 VREF is currently connecting to VDD.
For your reference, here is an A/D appnote from NXP, phillips.
http://www.nxp.com/acrobat_download/various/TN06004_LPC2000_ADC.pdf
bill horn
03-23-07, 06:45 PM
On the tiny2138 I have, pin 63 on the processor has a trace from it that goes to a solder pad, and no where else. I may have a defective board, but I don't think so. The blown up photo of the tiny2138 shows this trace clearly. It ends near c6. I know your schematic shows this pin connected to vdd, but on mine it isn't.
I've just measured it and it was .711 volts with the board idleing. With the a/d measuring the voltage is .464 volts, watching it for a while showed that it just drifted around, not related to vdd or a/d function at all. This is the code I used to check it.
thanks again
bill horn
\ first trys with A/D on the LPC2138 TinyArm
\ hooking up to a ad590 with series resistor 4640 ohms.
\ the ad590 conducts 298.2 uA at 25 degrees celcius or 298.2 Kelvin
\ .0002982 * 4640 = 1.383648 / 298.2 = .00464 V/degK
\ A/D has range of 0 to 3 volts, 0 to 1023 counts
\ 3 / 1024 = .00293 V/count
\ 3 / .00464 = 646.55 K or 703.13 F, 372.85 C. were not going to get that hot.
$E0034000 constant ad0cr \ a/d control reg.
$E002C004 constant pinsel1 \ pin function select
$E0034004 constant ad0dr \ a/d data reg.
decimal
: #>B \ bit# -- bitvalue
1 swap lshift
;
: set-cr \ --
5 #>B \ sel ect ad0.5
10 #>B or \ divider = 4
16 #>B or \ burst mode
21 #>B or \ enable a/d
ad0cr !
;
: done? \ --f \ bit 31 is set when conversion
ad0dr @ 31 #>B and \ is done
;
: read \ --n \ bits 6 to 15 contain the a/d
ad0dr w@ 6 rshift \ count 6 right shifts convert it
; \ to a 10 bit value 0 - 1023
: ad5 \ --n
20 #>B pinsel1 ! \ set p0.26 for a/d mode
set-cr \ set up a/d and start conversion
begin done?
until read
0 ad0cr ! \ turn off a/d
;
: .volts dup 0 <# # # # 46 hold #s #> type ." Volts " ;
: k>f 10000 464 */ 27315 - 180 * 10000 / 32 + . ." F." ;
: avg 0 1001 0 do ad5 + loop 1000 / 3325 1024 */ .volts ;
: test start-clock begin cr avg k>f 1000 ms key? until ;
bill horn
03-23-07, 07:30 PM
I disconnected the temp. ic and connected vref on tinyarm to ad0.5 measurements = 1000 averaged samples per reading. at 1 second interval.
1.363 Volts 69 F.
1.363 Volts 69 F.
1.363 Volts 69 F.
1.363 Volts 69 F.
1.363 Volts 69 F.
1.363 Volts 69 F. ok
ok
test
0.629 Volts -215 F.
0.616 Volts -220 F.
0.603 Volts -225 F.
0.607 Volts -224 F.
0.623 Volts -218 F.
0.629 Volts -215 F.
0.620 Volts -219 F.
0.607 Volts -224 F.
0.607 Volts -224 F.
0.616 Volts -220 F.
0.629 Volts -215 F.
0.623 Volts -218 F.
0.610 Volts -223 F.
0.607 Volts -224 F.
0.613 Volts -221 F.
0.629 Volts -215 F.
0.626 Volts -216 F.
0.613 Volts -221 F.
0.603 Volts -225 F.
0.610 Volts -223 F.
0.626 Volts -216 F.
0.629 Volts -215 F.
0.616 Volts -220 F.
0.603 Volts -225 F. ok
ok
a/d voltages are within 2 mv. of those taken with a fluke 87.
Theres no problem with the a/d I'm just wondering whats going on??
thanks again
bill horn
nmitech
03-23-07, 08:55 PM
Does your board looks like this picture ?
http://www.newmicros.com/temp/images/Tini2138Vref.jpg
If not you may have an older version of PCB. The older version does not have two through holes to support the 32Khz xtal but it has two surface mount solder pads instead. In any case, to get a replacement please email nmiproduction@newmicros.com to request for a RMA# and instruction to return.
bill horn
03-23-07, 09:19 PM
I was measuring pin 47, my bad. I used the text on the chip as my pin reference. its rotated 90 degrees left from actual in the npx pinout drawing.
How I overlooked the dot I cannot say.
sorry for the bother.
thank you
bill horn
been off of coffee for a week now, good time to attempt rtc xtal install. :)
vBulletin v3.0.7, Copyright ©2000-2013, Jelsoft Enterprises Ltd.