Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Electrical (http://www.chiefdelphi.com/forums/forumdisplay.php?f=53)
-   -   IR signals inverted (http://www.chiefdelphi.com/forums/showthread.php?t=24778)

Atheist 04-02-2004 22:14

IR signals inverted
 
For some reason the EDU controller is interpretting signals on the first and second digital inputs as 0 and no signal as 1. Am I missing something or is this not correct? I use PrintByte() to print the value of each and the beacons/sensors are functioning perfectly. What could be causing this?

Random Dude 04-02-2004 22:21

Re: IR signals inverted
 
Quote:

Originally Posted by Atheist
For some reason the EDU controller is interpretting signals on the first and second digital inputs as 0 and no signal as 1. Am I missing something or is this not correct? I use PrintByte() to print the value of each and the beacons/sensors are functioning perfectly. What could be causing this?


Well the IR sensor (Spec Sheet), will output a logic high (+5v) when it does not see a signal, and a logic low (0v) when it does see a signal. This appears to be what you are seeing.

Atheist 04-02-2004 22:29

Re: IR signals inverted
 
Thanks, so it would seem that they were working after all.

Atheist 04-02-2004 22:37

Re: IR signals inverted
 
Those are the best kinds of problems. :)

Kevin Watson 04-02-2004 23:40

Re: IR signals inverted
 
Quote:

Originally Posted by Atheist
For some reason the EDU controller is interpretting signals on the first and second digital inputs as 0 and no signal as 1. Am I missing something or is this not correct? I use PrintByte() to print the value of each and the beacons/sensors are functioning perfectly. What could be causing this?

This illustration shows what the sensor output should look like.

-Kevin

Atheist 06-02-2004 16:19

Re: IR signals inverted
 
Actually I don't think it has anything to do with the sensor output. When I manually connect the pins it reads as 0 and when they are not connected it reads as 0.

KenWittlief 06-02-2004 16:27

Re: IR signals inverted
 
is it possible you redefined the port in your code somewhere to make the pin an output instead of an input?

is it possible you connected something to the pin that you shouldnt have, like 12V, and blew out the input circuit for that pin?

I would look up how to connect a simple switch to the port (in the RC reference manual) and try reading the port that way - you cant get any simpler than a switch - if the pin is blown out, and you dont need to use all your input pins, then use another one.

Atheist 06-02-2004 16:32

Re: IR signals inverted
 
Anything is possible, but not likely. I've triple checked the code to make sure they are inputs. What I said is true for EVERY pin on the EDU controller. I tried the switch method with the same result.

Atheist 08-02-2004 11:24

Re: IR signals inverted
 
Any ideas? Am I missing something?

Mark McLeod 08-02-2004 13:20

Re: IR signals inverted
 
Quote:

Originally Posted by Atheist
Any ideas? Am I missing something?

Yep, you should get 1 when the signal pin is disconnected and 0 when a switch connects it to ground.

How are you displaying the value? Are you typecasting (int) the char value?
e.g.,
Code:

printf("rc_dig_in1 = %d\n", (int) rc_dig_in1);
Just to verify your User_Initialization() should have:

Code:


  IO1 = IO2 = INPUT;
.
.
.
/* SECOND: Configure the number of analog channels. */
  Set_Number_of_Analog_Channels(NO_ANALOG);    /* See ifi_aliases.h */


Atheist 08-02-2004 16:27

Re: IR signals inverted
 
Ok, that is what we are getting. 1 when disconnected and 0 when connected.


All times are GMT -5. The time now is 13:22.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi