Shop OBEX P1 Docs P2 Docs Learn Events
National ADC12130 -- Need help with — Parallax Forums

National ADC12130 -- Need help with

ArchiverArchiver Posts: 46,084
edited 2002-10-07 18:44 in General Discussion
Well, of all the board and groups I have participated in over the
past 20 years, you folks look like some of the friendliest, and
nicest folks around. So, rather than continue to bang my head against
the wall, I'm going to ask for some help.

Nothing fancy here… just my first Stamp project. I'm an old hands on
computer guy with a good Electrical Engineering background, so I
think I've avoided any really basic problem (like forgetting to plug
it into the wall), but…

I've got a National ADC12130 A/D Chip I'm trying to get to digitize a
fixed DC value.

Here is the program:

'{$STAMP BS2}
'{$PORT COM1}

CS CON 0 ' Chip select active LOW
SCLK CON 1 ' Serial Clock
DOUT CON 2 ' Digital Out of the A/D
DIN CON 3 ' Digital Input of the A/D
AD VAR WORD ' Value of the conversion
initstr var word ' Init String to the A/D

' LOW CONV
' initstr = %10000000
' shiftout DIN, SCLK, LSBFIRST, [noparse][[/noparse]initstr\8]
' HIGH CONV

pause 1000

Again:
LOW CS
SHIFTIN DOUT, SCLK, msbpost, [noparse][[/noparse]AD\13]
HIGH CS
debug ISBIN16 AD, " ",sDEC5 AD,cr
pause 1000
goto Again

The pins are attached to the chip as you the descriptions indicate
above, in addition the all the chip power and ground lines. I've got
a constant 1.5 Volts into CH0 and have grounded CH1, as the chip
defaults to differential mode. The chip also defaults to a 12 bit
data stream, with a sign bit, so 13 bits in total. There are all
kinds of format and data options, but I'm just going with the power-
up defaults, MSB, 12 Bits + one bit sign.

I'm getting data from the chip no problem (see example output below),
just not making any sense to me. Anyone have any experience or idea
of what I may be doing wrong? One thing I'm not sure of… do you
actually need to generate a CCLK signal for an a/d chip? The CCLK is
controlling the "successive approximation conversion time", which in
one place the documentation references as 5 MHz, but in other places
does not show as being connected.

Thank for any help or ideas you may have!


Richard P. Biby, P.E. KD4DSX
KD4DSX-ARRL.NET (make "-" into "@" for email)
UHF Rover www.speakeasy.net/~richbiby www.k8gp.net


%0000000001111111 00127
%0000000000000000 00000
%0001111111111111 08191
%0001111111111111 08191
%0001111111111111 08191
%0001111111111111 08191
%0001111111111111 08191
%0001111111111111 08191
%0000000000001111 00015
%0000000000000000 00000
%0001111111111111 08191
%0001111111111111 08191
%0001111111111111 08191
%0001111111111111 08191
%0001111111111111 08191
%0000111111111111 04095
%0000000000000000 00000
%0001111000000000 07680
%0001111111111111 08191
%0001111111111111 08191
%0001111111111111 08191
Sign In or Register to comment.