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 | Another question...

Discussion forum for the BasicX family of microcontroller chips.

Another question... - new - Oct 10 11:39:00 2004

I just bought a Infrared detector ( a Sharp GP2D12 ) ( Man is it small... Anyway... ) I thought id be as simple as hooking it up to the +5V and GND of my BX-24 development board Version 2, and any pin on the BX-24 ( in my case pin 13 ) and running a small program like the one below, to test it out, but.... to no avail. Anyone out there have done this already and know what I'd doing wrong ??? I also bought a SRF04 sonic module and will probably have the same problem, please help as much as you can !!!
Const IRSensorPin As Byte = 13

Public Sub Main()

Do
Debug.Print "Value: ";CStr(GetADC(IRSensorPin))
Sleep(2.0)
Loop

End Sub
[Non-text portions of this message have been removed]





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


Re: Another question... - Chris - Oct 11 13:40:00 2004

It is just that easy, I've done it many times.

As a test run your program and connect pin13 to ground (pin23 or pin4)
and +5 (pin21) and make sure you get both 0 and 1023 for readings.

If that works then your GPD12 is bad or miswirred.

Regards,

Chris ----- Original Message -----
From: "new" <>
To: <>
Sent: Sunday, October 10, 2004 9:39 AM
Subject: [BasicX] Another question... >
> I just bought a Infrared detector ( a Sharp GP2D12 ) ( Man is it small...
Anyway... ) I thought id be as simple as hooking it up to the +5V and GND of
my BX-24 development board Version 2, and any pin on the BX-24 ( in my case
pin 13 ) and running a small program like the one below, to test it out,
but.... to no avail. Anyone out there have done this already and know what
I'd doing wrong ??? I also bought a SRF04 sonic module and will probably
have the same problem, please help as much as you can !!! >
> Const IRSensorPin As Byte = 13
>
> Public Sub Main()
>
> Do
> Debug.Print "Value: ";CStr(GetADC(IRSensorPin))
> Sleep(2.0)
> Loop
>
> End Sub >
> [Non-text portions of this message have been removed] > Yahoo! Groups Links




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

Re: Another question... - new - Oct 12 6:13:00 2004

Thanks Chris, I thought it would ( or should I say, should ) work that way, but it doesn't. If I run and compile the program without the IR module hooked up at all, it goes through everything fine. then when I plug it in, I get a "Serial Date Error". If on the other hand I plug it in and compile and run it, it isn't able to halt basic-x and gives me an error code 203 ( whatever that means. ) either way it doesn't work. Multimeter test shows 4.97 volts, and have checked the datasheet for the pins and the plug that came with it is right. I'm totally confused, and hope the sonar module doesn't confuse me the same way.

Please help !?!?!?
----- Original Message -----
From: Chris
To:
Sent: Monday, October 11, 2004 2:40 PM
Subject: Re: [BasicX] Another question... It is just that easy, I've done it many times.

As a test run your program and connect pin13 to ground (pin23 or pin4)
and +5 (pin21) and make sure you get both 0 and 1023 for readings.

If that works then your GPD12 is bad or miswirred.

Regards,

Chris ----- Original Message -----
From: "new" <>
To: <>
Sent: Sunday, October 10, 2004 9:39 AM
Subject: [BasicX] Another question... >
> I just bought a Infrared detector ( a Sharp GP2D12 ) ( Man is it small...
Anyway... ) I thought id be as simple as hooking it up to the +5V and GND of
my BX-24 development board Version 2, and any pin on the BX-24 ( in my case
pin 13 ) and running a small program like the one below, to test it out,
but.... to no avail. Anyone out there have done this already and know what
I'd doing wrong ??? I also bought a SRF04 sonic module and will probably
have the same problem, please help as much as you can !!! >
> Const IRSensorPin As Byte = 13
>
> Public Sub Main()
>
> Do
> Debug.Print "Value: ";CStr(GetADC(IRSensorPin))
> Sleep(2.0)
> Loop
>
> End Sub >
> [Non-text portions of this message have been removed] > Yahoo! Groups Links Yahoo! Groups Sponsor
ADVERTISEMENT ------------------------------------------------------------------------------
Yahoo! Groups Links

a.. To
[Non-text portions of this message have been removed]




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

Re: Another question... - Chris - Oct 12 12:07:00 2004

Well, it sounds like everything stops working when you connect the Sharp
unit.
If the GPD12 is bad or miswirred it could sag the BX-24s +5v supply and
cause
the problems you are seeing.

Chris
----- Original Message -----
From: "new" <>
To: <>
Sent: Tuesday, October 12, 2004 4:13 AM
Subject: Re: [BasicX] Another question... >
> Thanks Chris, I thought it would ( or should I say, should ) work that
way, but it doesn't. If I run and compile the program without the IR module
hooked up at all, it goes through everything fine. then when I plug it in, I
get a "Serial Date Error". If on the other hand I plug it in and compile and
run it, it isn't able to halt basic-x and gives me an error code 203 (
whatever that means. ) either way it doesn't work. Multimeter test shows
4.97 volts, and have checked the datasheet for the pins and the plug that
came with it is right. I'm totally confused, and hope the sonar module
doesn't confuse me the same way.
>
> Please help !?!?!?
> ----- Original Message -----
> From: Chris
> To:
> Sent: Monday, October 11, 2004 2:40 PM
> Subject: Re: [BasicX] Another question... > It is just that easy, I've done it many times.
>
> As a test run your program and connect pin13 to ground (pin23 or pin4)
> and +5 (pin21) and make sure you get both 0 and 1023 for readings.
>
> If that works then your GPD12 is bad or miswirred.
>
> Regards,
>
> Chris > ----- Original Message -----
> From: "new" <>
> To: <>
> Sent: Sunday, October 10, 2004 9:39 AM
> Subject: [BasicX] Another question... > >
> > I just bought a Infrared detector ( a Sharp GP2D12 ) ( Man is it
small...
> Anyway... ) I thought id be as simple as hooking it up to the +5V and
GND of
> my BX-24 development board Version 2, and any pin on the BX-24 ( in my
case
> pin 13 ) and running a small program like the one below, to test it out,
> but.... to no avail. Anyone out there have done this already and know
what
> I'd doing wrong ??? I also bought a SRF04 sonic module and will probably
> have the same problem, please help as much as you can !!!
> >
> >
> >
> > Const IRSensorPin As Byte = 13
> >
> > Public Sub Main()
> >
> > Do
> > Debug.Print "Value: ";CStr(GetADC(IRSensorPin))
> > Sleep(2.0)
> > Loop
> >
> > End Sub
> >
> >
> >
> > [Non-text portions of this message have been removed]
> >
> >
> >
> >
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
> >
> >
> >
> > Yahoo! Groups Sponsor
> ADVERTISEMENT > --------------------------------------------------------------------------
----
> Yahoo! Groups Links
>
> a.. To >
> [Non-text portions of this message have been removed] > Yahoo! Groups Links






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

Re: Another question... - Austin Harkins - Oct 12 12:56:00 2004

You should probably consider using a seperate +5V regulated supply to
power everything other than your BX. The on-board 5V regulator can only
supply 100mA, 20mA of which are consumed by the BX during peak draw. That
only leaves you with ~80mA to play with. If your sensor(s) draw more than
that collectively, then you are definately overloading your BX's
regulator. The default behavior for the BX when the voltage drops below
5V is to place the chip into reset until power is restored. This is a
protection circuit to keep from damaging any of the internals when the
voltage is too low. I had a similar problem when trying to drive a small
servo with the on-board regulator. When I would tell the servo to change
directions suddenly without stopping first, the current draw would exceed
the capabilites of the regulator, dropping the voltage below 5V, and
resetting the chip.

You can test the draw of your sensor(s) with a multimeter. The BX
regulator was never intended to power high draw devices, therefore you
need a seperate supply.

There are regulators available with an output of 5V @ 1000mA. You can use
this to power the BX, and your sensor(s) and bypass the onboard regulator
all together. If you do this, do not connect power to the external power
in. Instead, connect the externally regulated 5V directly to pin (look at
pinout diagram and find the correct 5V pin, pin 21)

Reference:
http://www.basicx.com/Products/BX-24/pin_definitionsbx24.htm Chris said:
>
> Well, it sounds like everything stops working when you connect the Sharp
> unit.
> If the GPD12 is bad or miswirred it could sag the BX-24s +5v supply and
> cause
> the problems you are seeing.
>
> Chris >
> ----- Original Message -----
> From: "new" <>
> To: <>
> Sent: Tuesday, October 12, 2004 4:13 AM
> Subject: Re: [BasicX] Another question... >>
>> Thanks Chris, I thought it would ( or should I say, should ) work that
> way, but it doesn't. If I run and compile the program without the IR
> module
> hooked up at all, it goes through everything fine. then when I plug it in,
> I
> get a "Serial Date Error". If on the other hand I plug it in and compile
> and
> run it, it isn't able to halt basic-x and gives me an error code 203 (
> whatever that means. ) either way it doesn't work. Multimeter test shows
> 4.97 volts, and have checked the datasheet for the pins and the plug that
> came with it is right. I'm totally confused, and hope the sonar module
> doesn't confuse me the same way.
>>
>> Please help !?!?!?
>> ----- Original Message -----
>> From: Chris
>> To:
>> Sent: Monday, October 11, 2004 2:40 PM
>> Subject: Re: [BasicX] Another question...
>>
>>
>> It is just that easy, I've done it many times.
>>
>> As a test run your program and connect pin13 to ground (pin23 or pin4)
>> and +5 (pin21) and make sure you get both 0 and 1023 for readings.
>>
>> If that works then your GPD12 is bad or miswirred.
>>
>> Regards,
>>
>> Chris
>>
>>
>> ----- Original Message -----
>> From: "new" <>
>> To: <>
>> Sent: Sunday, October 10, 2004 9:39 AM
>> Subject: [BasicX] Another question...
>>
>>
>> >
>> > I just bought a Infrared detector ( a Sharp GP2D12 ) ( Man is it
> small...
>> Anyway... ) I thought id be as simple as hooking it up to the +5V and
> GND of
>> my BX-24 development board Version 2, and any pin on the BX-24 ( in my
> case
>> pin 13 ) and running a small program like the one below, to test it
>> out,
>> but.... to no avail. Anyone out there have done this already and know
> what
>> I'd doing wrong ??? I also bought a SRF04 sonic module and will
>> probably
>> have the same problem, please help as much as you can !!!
>> >
>> >
>> >
>> > Const IRSensorPin As Byte = 13
>> >
>> > Public Sub Main()
>> >
>> > Do
>> > Debug.Print "Value: ";CStr(GetADC(IRSensorPin))
>> > Sleep(2.0)
>> > Loop
>> >
>> > End Sub
>> >
>> >
>> >
>> > [Non-text portions of this message have been removed]
>> >
>> >
>> >
>> >
>> >
>> > Yahoo! Groups Links
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>>
>>
>> Yahoo! Groups Sponsor
>> ADVERTISEMENT
>>
>>
>>
>>
>>
>> --------------------------------------------------------------------------
> ----
>> Yahoo! Groups Links
>>
>> a.. To
>>
>>
>>
>> [Non-text portions of this message have been removed]
>>
>>
>>
>>
>>
>> Yahoo! Groups Links
>>
>>
>>
>>
>>
>>
>>
> > Yahoo! Groups Links





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

Re: Re: Another question... - Author Unknown - Oct 12 13:54:00 2004

The GP2D12 draws 33ma typical, with a max of 50ma.

When you said you measured 4.97 volts, was that pin 13 or vcc? If that's pin 13 then somethings wrong with the IR module, you shouldn't see anything above 3 volts on it's output. Do you have the pullup enabled on pin 13? > From: "Austin Harkins" <>
> Date: 2004/10/12 Tue PM 01:56:18 EDT
> To:
> Subject: Re: [BasicX] Another question...

[Non-text portions of this message have been removed]




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