Discussion forum for the BasicX family of microcontroller chips.
|
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] |
|
|
|
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 |
|
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] |
|
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 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 |
|
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] |