Help with 12C509 program

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
Hi all,

Would anyone be able to help a relative newbie to PIC's?

I have built and have working the following circuit:

http://quozl.netrek.org/flasher /

My question is that I need to disable the PIC i.e. no output when there
is a high logic signal to the chip. Would it be best to use SLEEP or
what?
I apologise for being thick, but after a few days messing about, I am
still unable to find a satisfactory conclusion.

TIA
--
             --dave

                 snipped-for-privacy@nospam.org.uk

Re: Help with 12C509 program

Quoted text here. Click to load it

Sleep does not disable any outputs.  They will remain just as they
were when the Sleep instruction was executed.  I'm not sure what you
mean by "no output".  An pin is either output-low, output-high, or
high-impedance (input).  In some cases the high-impedance state can be
configured with weak pull-ups, so it won't be quite as high an
impedance.


-Robert Scott
 Ypsilanti, Michigan
(Reply through this forum, not by direct e-mail to me, as automatic reply
address is fake.)


Re: Help with 12C509 program
Quoted text here. Click to load it
I'm sorry I was vague. I need to turn the LED off when a logic '1' is
applied to one of the other i/p pins, and enabling the output when that
i/p goes to '0'. I've so far been unable to implement this due to being
at the bottom of the learning curve with PIC's.
I have very little idea (as yet) what asm code to put in and where to
put it :(
--
              --dave

                   snipped-for-privacy@nospam.org.uk

Re: Help with 12C509 program

Quoted text here. Click to load it

Read the input pin in a loop, and when you detect that it goes low,
turn on the LED.  As to how to turn on an LED, that depends on your
circuit.  Drive the base of a NPN through a 4.7K resistor, and let the
NPN sink current from the LED.  Use another resistor in series with
the LED to limit the current to a safe value.


-Robert Scott
 Ypsilanti, Michigan
(Reply through this forum, not by direct e-mail to me, as automatic reply
address is fake.)


Re: Help with 12C509 program
You might show the assembly code you have tried so far here. Add comments
to the code to describe the intent.

-Hul

: Hi all,
:
: Would anyone be able to help a relative newbie to PIC's?
:
: I have built and have working the following circuit:
:
: http://quozl.netrek.org/flasher /
:
: My question is that I need to disable the PIC i.e. no output when there
: is a high logic signal to the chip. Would it be best to use SLEEP or
: what?
: I apologise for being thick, but after a few days messing about, I am
: still unable to find a satisfactory conclusion.
:
: TIA

--
- for email, put the word "keep" in subject line -

Re: Help with 12C509 program
Hi, put a pnp transistor in the power supply to the pic. Apply your signal to
the base (via a resistor).

Site Timeline