Shop OBEX P1 Docs P2 Docs Learn Events
Handy in and output circuit ....good for testing circuits .. idea's .. — Parallax Forums

Handy in and output circuit ....good for testing circuits .. idea's ..

OzStampOzStamp Posts: 377
edited 2007-10-03 18:37 in Propeller 1
Hi All.

Alway's trying to wire a couple of inputs with a couple of outputs.

This was my criteria.. just for proto stuffing on my bench..

Wanted a simple· circuit that satisfies quick testing.. without releasing the magic smoke
from the Propeller Chip.
I seem to be testing little code snippets all the time.. shifting leds on and off
testing and proving sequences etc etc ... like to see leds confirming what's going on..
Mainly digital type stuff or routines that involve internal but shifting etc etc..
You know what we mean SPI· in/out·· doing calculations shifting etc etc..
So see the attached document for the sketch on what was the outcome of it all.

The i/O pin when configured for input is pulled down with the 10K resistor
When the switch is closed the voltage as measured rises to 2.4V ( well above the threshold)
and detects a 1 .. (also the led lights up confirming a 1 is present on the input pin)
Of course when the switch is open the input is low ..

The I/O pin when configured for output sources power to the led via the resistor and the led
lights up.(when the output is set to high)
If the output pin is low the top resistor is in the circuit even if the switch is on the current
will be shunted away from the LED ( so not lit) the current is limited to safe margins...
Turning the switch on or off has no bearing at all on what the leds does.. the I/O pin
when set to output controls the status of the led.

The value of 560 Ohms works well .. even 680 or 820 Ohms as well
Just depends on how bright you want the led to be..I use nice bright little SHARP brand ones
and they work well at all the above values..


Enjoy

Ronald Nollet·· OZ·

Comments

  • Stan671Stan671 Posts: 103
    edited 2007-10-03 18:37
    I do lots of testing with a few switches here and there and a few LEDs here and there. This nice little circuit uses only one I/O pin for either (or both) purposes. I am going to add a couple to my prototyping board immediately. Excellent. Thanks!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Stan Dobrowski
Sign In or Register to comment.