EmbeddedRelated.com
Forums
Memfault Beyond the Launch

Inputs left floating at the very start

Started by Unknown May 3, 2008
On May 3, 3:19=A0pm, rickman <gnu...@gmail.com> wrote:

> Why can't you just measure it? =A0As soon as the CPU start executing > code, toggle a pin from low to high to low. =A0No matter what state the > pin was before initialization, you will get an edge from this > sequence.
My stopwatch only measures accurate to a tenth of a second, plus my reflexes aren't quick enough to stop it accurately. Seriously though what kind of device would I use to measure this? I'd need it to start measuring from when power was applied and get it to mark when the pin goes high.
On May 3, 7:07 pm, Tom=E1s =D3 h=C9ilidhe <t...@lavabit.com> wrote:
> On May 3, 3:19 pm, rickman <gnu...@gmail.com> wrote: > > > Why can't you just measure it? As soon as the CPU start executing > > code, toggle a pin from low to high to low. No matter what state the > > pin was before initialization, you will get an edge from this > > sequence. > > My stopwatch only measures accurate to a tenth of a second, plus my > reflexes aren't quick enough to stop it accurately. > > Seriously though what kind of device would I use to measure this? I'd > need it to start measuring from when power was applied and get it to > mark when the pin goes high.
Build a precision stopwatch using another microcontroller. You can output the data on a serial port, or on a set of displays.
Tom&#4294967295;s &#4294967295; h&#4294967295;ilidhe wrote:

> I have the PIC16F684. One of its inputs goes to the data input of a > shift register, and the other goes to the clock input of the same > shift register.
Inputs connected to inputs are, somewhat obviously, a bad idea. Avoiding such situations is one of the things pull-up/-down resistors are for.
linnix wrote:

> If you are driving LEDs with the Shift Registers, what difference does > it make to have random outputs for a few milliseconds? Noboby can > really catch it anyway.
You might be amazed what people will notice... A 10ms flash of an LED at full throttle is quite noticeable.
"Mark Borgerson" <mborgerson@comcast.net> wrote in message 
news:MPG.22861c9cea992cd6989860@newsgroups.comcast.net...
> In article <da6e9bf6-4659-4fc5-8d47-8f09f33f7cd7 > @l42g2000hsc.googlegroups.com>, toe@lavabit.com says... >> When the PIC boots up, all of its IO pins are set as inputs initially. >> What I'm concerned about though is that shift register's input pins >> must be either high or low, so I'm wondering if I'll get erratic >> behaviour at the very start because the pins are effectively floating? >> > A couple of 100K pullups or pulldowns should eliminate your doubts. > The 100K value is subject to change if the PIC pins have internal > pullups of their own.
The note I read said "weak" pull-ups, programmable to enable or disable, power up enabled. I also thought I recalled that one or two didn't have these for one reason or another. I expect it says somewhere in the data sheet what the exact values are, but I didn't get that far before running across the above info. - Bill
On May 3, 11:26 am, Hans-Bernhard Br=F6ker <HBBroe...@t-online.de>
wrote:
> linnix wrote: > > If you are driving LEDs with the Shift Registers, what difference does > > it make to have random outputs for a few milliseconds? Noboby can > > really catch it anyway. > > You might be amazed what people will notice... A 10ms flash of an LED > at full throttle is quite noticeable.
Yes, but does it really matter. We expect something strange at startup anyway. Everytime I plug in a header, the outlet flash. Is something wrong with my heater or the outlet?
Tom&#4294967295;s &#4294967295; h&#4294967295;ilidhe wrote:
> In college, I was always told not to leave input pins floating on a > device such as a 74HCT chip. I was told that the device might behave > erratically if any of its inputs are floating. > > I have the PIC16F684. One of its inputs goes to the data input of a > shift register, and the other goes to the clock input of the same > shift register. > > On the shift regsiter, there's an RC circuit on the master reset with > a charge time of about a microsecond (which is plenty slow enough to > have it set to all zeroes initially).
Shift registers are 'plain dumb' so even if they DO get bit-confused, they can always be flushed. Send it 8 (or whatever) clocks, and you now KKNOW what state it is in. <paste>
> I still haven't figured out how long it takes the PIC16F684 to boot up > so I guessed it to be about 20 milliseconds. If anyone has exact > figures I'd be appreciative
Read the data, and check your Reset Timeconstant. Some micros have a clock-stabalise counter, that additionally delays reset exit, others (like the 8051) are out of reset in 2 clocks, and starting your reset opcode. RC clocks havs very fast start times, Xtals, and especially Clock crystals, take longer to get going. -jg
linnix wrote:
> On May 3, 11:26 am, Hans-Bernhard Br&#4294967295;ker <HBBroe...@t-online.de> > wrote:
>> You might be amazed what people will notice... A 10ms flash of an LED >> at full throttle is quite noticeable.
> Yes, but does it really matter. We expect something strange at > startup anyway.
Well, for the devices we build at my place of work, random flashing at power-up like that would eventually put us out of business. Customers will not accept such glitches, period.
> Everytime I plug in a header, the outlet flash. Is something wrong > with my heater or the outlet?
Well, the difference is that there you're switching a couple kilowatts at 100+ volts, i.e. it's quite unavoidable that there will be some sort of spark. That's a whole different story from a multi-MHz microcontroller apparently failing to keep a measly 100 mW LED from turning on for a hundred thousand CPU cycles' time.
On May 3, 2:50 pm, Hans-Bernhard Br=F6ker <HBBroe...@t-online.de> wrote:
> linnix wrote: > > On May 3, 11:26 am, Hans-Bernhard Br=F6ker <HBBroe...@t-online.de> > > wrote: > >> You might be amazed what people will notice... A 10ms flash of an LED > >> at full throttle is quite noticeable. > > Yes, but does it really matter. We expect something strange at > > startup anyway. > > Well, for the devices we build at my place of work, random flashing at > power-up like that would eventually put us out of business. Customers > will not accept such glitches, period.
I can't image what application would be so mission critical at power up, but I'll take your words for it. For us, we only power up the device once, when we install the batteries. The power button is really talking the uC out of standby. Our device goes into standby after 2 minuties of idle time. That way, a button cell battery can last for a few hundred days.
In article <d2913c07-414d-458f-b3bd-5a0c7361f541
@p39g2000prm.googlegroups.com>, linnix says...
> On May 3, 2:50 pm, Hans-Bernhard Br&#4294967295;ker <HBBroe...@t-online.de> wrote: > > linnix wrote: > > > On May 3, 11:26 am, Hans-Bernhard Br&#4294967295;ker <HBBroe...@t-online.de> > > > wrote: > > >> You might be amazed what people will notice... A 10ms flash of an LED > > >> at full throttle is quite noticeable. > > > Yes, but does it really matter. We expect something strange at > > > startup anyway. > > > > Well, for the devices we build at my place of work, random flashing at > > power-up like that would eventually put us out of business. Customers > > will not accept such glitches, period. > > I can't image what application would be so mission critical at power > up,
As an example http://www.navitastechnologies.com/hydraulic.html Robert ** Posted from http://www.teranews.com **

Memfault Beyond the Launch