At 05:24 PM 1/1/2008, you wrote:
{Quote hidden}>I've hooked up an NE555 in monostable mode which is triggered by a
>PIC. While functioning perfectly, there is one small annoyance that
>beats me of why it happens and how I can prevent it.
>
>The reset-pin on the 555 is hooked to a 10k pull-up and the
>trigger-pin is connected directly to the PIC (no caps or anything
>between). The weird thing is this: When powering up, the 555 is
>triggered, despite the fact that except for the INTOSC-calibration the
>first thing I'm doing in the PIC is to set TRIS to output and set the
>ports to '1'. Why this is weird is because the 555 is supposed to trig
>on negative flanks according to the datasheet, and the PIC-pins go
>from either 1->1 or 0->1 (depening on their values on startup) but
>never from 1->0->1.
>
>I'm attaching the small code if anyone wants to peek, but I doubt the
>error is in there.
>
>Anyway, a hardware solution for this problem would be to let the
>reset-pin on the 555 stay low (i.e. ignoring any triggers) for about a
>second after starting up, but I'm not sure how to implement this.
>Sure, I can make it non-simple by adding another 555, or a bunch of
>other IC's, but I'm pretty sure this delay can be achieved by using
>RC-logic. Although I have yet no clue how to do it.
You should set the relevant port bit to '1' *before* you write to
TRIS. The power-up state of the port bits is undefined. If the value
at power-up happens to be 0, you're generating a nice clean trigger pulse.
If absence of false operation at power-up is important, I would also suggest
using external /MCLR, an external reset circuit (tied to both /RESET and
/MCLR), and a pullup resistor on the trigger output so it gets pulled up
towards Vdd during the power-up.
Or dump the 555 entirely and do the timing inside the program.
>Best regards,
Spehro Pefhany --"it's the network..." "The Journey is the reward"
spam_OUTspeffTakeThisOuT
interlog.com Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog Info for designers: http://www.speff.com