At 01:00 PM 18/01/2002 +1100, you wrote:
{Quote hidden}>Hi all,
>
>My 5th little PIC project is working fine thanks in part to all the
>wonderful help I have received on this list. I had a lot of trouble on this
>one, but decided to work it all out myself (no matter how frustrating it
>got) and it's paid off for me. Stupid mistakes really - a BCF instead of a
>BSF - D'ohh!
>
>I have a slight glitch in this application which I do not think I can avoid
>with software, but I thought I would bounce it off the list to see if there
>are any suggestions.
>
>Once again, I have a PIC12C508A (just love those little guys) with an LED
>driven from VCC to Pin2 (GP5) and a relay driven with an NPN transistor on
>Pin3 (GP4). Pins 4~7 are used as inputs.
>
>So, given the above configuration, when I want the LED to be ON, I need the
>drive GP5 Low and when I want the relay ON, I need to drive GP4 High. When
>this application starts up, I need both the relay and the LED to be OFF
>
>The beginning of my code (after initial equates etc.) is;
>
>MOVLW B'00001111'
>TRIS GPIO
>MOVLW B'00100000'
>MOVF GPIO
>GOTO CONFIG
I normally set the GPIO first and then do the TRIS. This avoids the blips
although unless the clock is *very* slow, I wouldn't think that you could
visibly see the LED blip when the delay is only a few cycles anyway.
>This is as soon as I can set GP5 high, but I still get a very obvious 'blip'
>of the LED. This application uses existing hardware, but I was considering
>to invert the logic of the LED.
Maybe there is something else in the hardware that's not obvious without
a circuit that is causing it. Anything else hooked to GP5 ?
>Before doing that however, I just wanted to ask if I was doing anything
>wrong? The state of the port(s) on power-up is not known right? But they
>seem (from my limited experience) more likely to be low than high. Can I get
>the pin driven high any sooner or would I have better results by simply
>inverting the logic for the LED and driving the Pin High when I want the LED
>on?
Regards...
--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads