I am new here, and this is my first experience with the Prop micro.· I am experiencing some strange behavior at a couple of pins·and I was hoping someone would be able to help me.·

I am using pins 8 and 9 for inputs, and I just need to be able to tell if they are high or low.· The problem is that they both seem to be floating, even if I define their direction in a simple piece of code:

pub main· | input
·repeat
· dira[7..9]~
· input := ina[7..9]

The pins should be low, but·pin 8 is showing about 0.9V from pin to ground, and·pin 9 about 2.4V.·

If I use this code, I get zeros on both pins:

pub main· | input
·repeat
· dira[7..9]~~
· outa[7..9]~

That tells me that the chip is outputting to the pins normally (I think), but leaves me without the use of those pins for inputs because they are never zero if·I define them as inputs.·

Any insight would be much appreciated.·

Thanks

Phil Pilgrim (PhiPi)

09-19-2007, 12:12 AM

It's normal for input pins to float between Vdd and Vss if there's nothing connected to them. It's up to an externally-connected device to define what those pins see. If you need the default input condition to be 0V, you will need to connect a pull-down resistor between the pin and Vss. 10K should work, and it will hold the voltage at zero until an external device impresses a different voltage on it.

-Phil

slosjo

09-19-2007, 12:52 AM

Ahh perfect. Thanks Phil.

slosjo

09-19-2007, 02:25 AM

Using the pull-down resistor worked on one of the pins, but on the other I'm still getting about 1.5 volts. Do you think a smaller resistor will remedy this? say, 5k?

deSilva

09-19-2007, 02:33 AM

No, it will not.
Even a 100k resistor should pull the pin to 0V except there is something else connected to it additionally. That's what I suspect...

slosjo

09-19-2007, 04:12 AM

I am still having issues with this.

I have checked to make sure that nothing else is touching the pins, and I am still getting about 1.5v (pulled down with a 3k resistor now).

deSilva

09-19-2007, 04:19 AM

Well use your intuition!
Try some other pins 0...27. Can you pull them to zero? You need no special program, DIRA :=0 is the default value.

Or try a 100 Ohms resistor (will do no harm); still 1.5V?

Phil Pilgrim (PhiPi)

09-19-2007, 04:56 AM

The voltage you're reading is not current-dependent, i.e. 1.5V regardless of the pull-down value. So something is driving that pin. I'm betting that the pin has been programmed for a DUTY output, in which case your voltmeter would only see an average value. Are you absolutely certain that the pin is an input in all cogs? (It only takes one programmed as an output for it to be driven.)

-Phil

slosjo

09-19-2007, 05:13 AM

deSilva and others-

I am able to pull other pins to 0V with 10K resistors. This particular pin, however, is acting strange. I am able to pull it down close to zero with a 100ohm resistor to about .005 VDC, but then the voltage fluctuates, rising eventually to 1VDC or so, but very unstable along the way. I am certain that there is nothing else connected to this particular pin, but there are many other caps and resistors on my prototype board.

Any insight you may have would be very helpful.

deSilva

09-19-2007, 05:23 AM

It sounds a little bit as if you have "fried" that pin. This easily happens by connecting 5V >100mA to the pin... Even 3V3 is not so good when you have driven it low.

As there has been this misunderstanding about forcing the pins "low" I can easily imagine that this could have happened

slosjo

09-19-2007, 06:48 AM

That would make sense. I will try a different pin with the same setup and see what happens.

Thanks for the help.

Paul Baker

09-19-2007, 06:55 AM

deSilva said...
It sounds a little bit as if you have "fried" that pin. This easily happens by connecting 5V >100mA to the pin... Even 3V3 is not so good when you have driven it low.

As there has been this misunderstanding about forcing the pins "low" I can easily imagine that this could have happened
Forcing a pin to the opposite rail does not harm the Propeller in the short to medium time frame (a 24 hour test has been performed and the chip passed), long term effects such as metal migration have not been studied so it is not recomended design practice, but for those occasional "oops" moments no harm will occur. Forcing the pin beyond the rail is another story since current flows through the ESD diode and it's heating effects and subsequent failure can damage the I/O cell as well.

Just so we can rule out a software issue, try your measurments with the following code running:

CON

_clkmode = xtal1 + pll16x
_xinfreq = 5_000_000

PUB start

dira := 0
repeat

Substitute whatever settings for _clkmode and _xinfreq are appropriate for your system.

-Phil

deSilva

09-19-2007, 02:07 PM

This complete program is fully equivalent http://forums.parallax.com/images/smilies/smile.gif

PUB start
REPEAT

If there is a different behavior to PhiPi's program then things inside the Prop have been demaged..

Post Edited (deSilva) : 9/19/2007 6:11:58 AM GMT

Peter Jakacki

09-19-2007, 04:43 PM

I'd like to chip in (pun) with this basic suggestion - hold the Propeller in reset and check the line. A hardware reset should force all pins to high-impedance state and reset any special counter configurations etc.

However, I do remember before that you said that these pins were "floating" plus turning them into outputs gave you 0V. Was this not the case? If so, then what you are saying doesn't make sense. I suspect that you have something driving the pin externally. You didn't say which board you are using but you must have a schematic for it so you can check it.

*Peter*

Loopy Byteloose

09-19-2007, 05:10 PM

Peter,
So are you saying that a reset will absolutely confirm that a pin is damged?

If so, that is a handy piece of advice.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"Everything in the world is purchased by labour; and our passions are the only causes of labor." -- David·Hume (1711-76)········

···················· Tropically,····· G. Herzog [·黃鶴 ]·in Taiwan

Peter Jakacki

09-19-2007, 07:17 PM

Absolutely, sort of.

What the reset does is basically disconnect/disable any special functions so you are left with a floating input. Now, if you connect an meter to measure the current from VDD to pin and also GND to pin it should not read anything other than leakage (worst case 10ua).

Another way to check for damaged pins in general is, with the power off, measure the parasitic diode using the diode range on your meter. Connect meter+ to gnd and meter- to the pin and you will read around 400mv. The exact voltage is not important but all the pins should be similar. Do the same with the meter- to VDD and meter+ to the pin to check the other diode. This method of testing is a low-tech trick that proves invaluable in testing high-tech devices for pin damage.

*Peter*

slosjo

09-19-2007, 08:51 PM

OK everyone here is my status:

Peter said:

"However, I do remember before that you said that these pins were "floating" plus turning them into outputs gave you 0V. Was this not the case? If so, then what you are saying doesn't make sense"

Turning the pin into an output gives me 0V for a short time, but then the pin slowly works it's way up to about 1V. When I said that setting the pins to outputs gave me zeros in my first message, I either didn't wait long enough, or just looked at pin 8 and not at pin 9. Even setting pin 9 to a low output results in a fluctuating voltage.

Phil, deSilva-
I tried both of your codes, both give the same result: the pin is still not zero

Peter- pressing the reset button while monitoring the pin shows nothing changing, voltage is still fluctuating.

Paul-I have never put more than logic high voltage on the pin at any time (3.3V), but it would appear that it is still damaged.

Ken Peterson

09-22-2007, 05:07 AM

We purchased a few proto boards and one of our engineers soldered some components on one of the boards but didn't power it up until after the components were mounted. After he powered it up, we had similar problems. Pins not working right, except it was ALL pins. The program loaded correctly, or at least we didn't get an error message, but after that, all pins were various values between 0 and 3.3V no matter what the program status. We tried a different demo board and it worked fine. The strange thing is that the program apparently loaded without error, but after that even the TX RX pins acted strangely. He disconnected all connections to the Propeller and tried similar test programs as those mentioned earlier, but still didn't work right.

I suspect we got a bad chip on our proto board or something...

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔

The more I know, the more I know I don't know.· Is this what they call Wisdom?