Sign in

username:

password:



Not a member?

Search basicx



Search tips

Subscribe to basicx



basicx by Keywords

Accelerometer | ADC | ADXL | Adxl20 | AVR | BasicStamp | BX-35 | BX28 | BX35 | COM3 | Compiler | Downloader | EEPROM | Electromagnet | GetADC | GP2D1 | GPS | I2C | IDE | Keypad | LCD | LCD+ | MIDI | Motors | Multitasking | Netmedia | Networking | PCB | PID | PlaySound | PWM | Relays | RTC | Servo | ShiftOut | SitePlayer | SPI | Stack | Timer | USB

Ads

Discussion Groups

Discussion Groups | BasicX | ADC broken?

Discussion forum for the BasicX family of microcontroller chips.

ADC broken? - Jack Wu - Aug 18 1:55:00 2003

Hi i was playing with the GetADC command, i used a
loop to gather the voltage off of a pin, i think it is
broken because the readings are always wrong. here is
the code:
--------
Do
Voltage = GetADC(PinNumber)
Debug.Print CStr(Voltage)
Delay(0.50)
Loop
---------
I only get a value of 500 or so(usually around
500-600). My hardware setup, basically i just
connected from pin 13(the pinnumber) to ground. Also
without any wires connected to the BX, i tried all the
other pin numbers and they all return the same wierdo
random numbers. I think my BX is broken. does anyone
know? I also tried putting this: "Call PutPin(13,
bxInputTristate)" before the getadc call and this
doesn't help.

Somebody please help. Thanks

__________________________________






(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )


Re: ADC broken? - Tom Igoe - Aug 18 11:10:00 2003


Your code's good, as long as voltage is an integer, but your circuit is
probably wrong. Use a voltage divider, with the middle attached to the
pin. Or use a variable resistor attached to 5V and a pulldown resistor
as well. On Monday, August 18, 2003, at 02:55 AM, Jack Wu wrote:

> Hi i was playing with the GetADC command, i used a
> loop to gather the voltage off of a pin, i think it is
> broken because the readings are always wrong. here is
> the code:
> --------
> Do
> Voltage = GetADC(PinNumber)
> Debug.Print CStr(Voltage)
> Delay(0.50)
> Loop
> ---------
> I only get a value of 500 or so(usually around
> 500-600). My hardware setup, basically i just
> connected from pin 13(the pinnumber) to ground. Also
> without any wires connected to the BX, i tried all the
> other pin numbers and they all return the same wierdo
> random numbers. I think my BX is broken. does anyone
> know? --
Tom Igoe





(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )

Re: ADC broken? - Jack Wu - Aug 18 12:20:00 2003

i attached the pins directly to the ground line, and i
was still getting wacky readings. Then i just did a
getpin and i got a "1" returned. That's wrong, it
should be a "0". And this is with a bare bones BX
with the pins tied to ground. This must be broken, or
i have RF interference. --- Tom Igoe <> wrote:
>
> Your code's good, as long as voltage is an integer,
> but your circuit is
> probably wrong. Use a voltage divider, with the
> middle attached to the
> pin. Or use a variable resistor attached to 5V and
> a pulldown resistor
> as well. > On Monday, August 18, 2003, at 02:55 AM, Jack Wu
> wrote:
>
> > Hi i was playing with the GetADC command, i used a
> > loop to gather the voltage off of a pin, i think
> it is
> > broken because the readings are always wrong.
> here is
> > the code:
> > --------
> > Do
> > Voltage = GetADC(PinNumber)
> > Debug.Print CStr(Voltage)
> > Delay(0.50)
> > Loop
> > ---------
> > I only get a value of 500 or so(usually around
> > 500-600). My hardware setup, basically i just
> > connected from pin 13(the pinnumber) to ground.
> Also
> > without any wires connected to the BX, i tried all
> the
> > other pin numbers and they all return the same
> wierdo
> > random numbers. I think my BX is broken. does
> anyone
> > know?
> >
> >
> > --
> Tom Igoe

__________________________________






(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )

Re: ADC broken? - Tom Igoe - Aug 18 15:27:00 2003


On Monday, August 18, 2003, at 01:20 PM, Jack Wu wrote:

> i attached the pins directly to the ground line, and i
> was still getting wacky readings. Then i just did a
> getpin and i got a "1" returned. That's wrong, it
> should be a "0". And this is with a bare bones BX
> with the pins tied to ground. This must be broken, or
> i have RF interference. What happened when you tied it to 5V? Did you try the same thing on
pin 14? I have seen people fry the first channel of the ADC
frequently, especially when they put the chip in upside down the first
time and try to power it. --
Tom Igoe





(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )

Re: ADC broken? - Jack Wu - Aug 18 15:31:00 2003

With Getpin, it returns a 1 no matter what. in fact
it was being kinda iffy now. It would display 0 for a
few iterations in a loop, and then switch over to
being 1.

My BX has worked fine for over a year, now it's kinda
messed up.

For example when i try and read AD with GETADC, it
will read a few iterations in a loop and then freeze. --- Tom Igoe <> wrote:
>
> On Monday, August 18, 2003, at 01:20 PM, Jack Wu
> wrote:
>
> > i attached the pins directly to the ground line,
> and i
> > was still getting wacky readings. Then i just did
> a
> > getpin and i got a "1" returned. That's wrong, it
> > should be a "0". And this is with a bare bones BX
> > with the pins tied to ground. This must be
> broken, or
> > i have RF interference. > What happened when you tied it to 5V? Did you try
> the same thing on
> pin 14? I have seen people fry the first channel of
> the ADC
> frequently, especially when they put the chip in
> upside down the first
> time and try to power it. > --
> Tom Igoe

__________________________________





(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )