Tech Support > Computer Hardware > Microprocessors > Avoiding a short circuit at boot up
Avoiding a short circuit at boot up
Posted by Tomás Ó hÉilidhe on February 11th, 2008




I'm very new to working with microcontrollers, I only started using
them properly within the last week.

I'm using the PIC16F684 in conjunction with MPLAB and PIC C.

One of my pins on the PIC chip is connected to the output from an
encoder. The output from the encoder will always be either 5 V or 0 V, it
will never be high impedence.

When power is applied to my circuit and the microcontroller boots up, I
need to make sure that the pins are all high impedence, because if any of
them are high or low then I'll have a short circuit leading to the encoder.

Does anyone know how to ensure that all the pins on the 16F684 will be
high impedence initially?

My pin layout for the PIC16F684 is:

C0 thru C5: Output to LED's

A0: Output to LED

A1 thru A3: Input from Encoder

A4: Output to the clock input of a shift register

A5: Output to a Piezo speaker


Basically I want to use all 12 pins, I don't want them to be set to
anything like A/D convertors or clock inputs. Does anyone know what
__CONFIG parameters I need to achieve this?

Basically I want either:
1) All pins are high impedence at the start, and then my code in main sets
them as per my specifications above.
2) All pins are set the way I want them when the chip boots up by using
__CONFIG parameters (I don't even know if this is possible).

Also, does anyone know how long it takes for the PIC16F684 to boot up
and actually start executing instructions? I've been told that it executes
its first instruction about 20 milliseconds after power is applied; does
this sound about right? Also does anyone know how long it takes for the pin
voltage to change once the machine instruction has been executed?

--
Tomás Ó hÉilidhe

Posted by Joerg on February 11th, 2008


Tomás Ó hÉilidhe wrote:
I don't know PICs but how about providing a resistor between encoder
output and PIC? Just in case some piece of code goes wrong and it
assigns that pin as output.

--
Regards, Joerg

http://www.analogconsultants.com/

Posted by Arlet Ottens on February 11th, 2008


Tomás Ó hÉilidhe wrote:
After reset, all I/O pins are set to inputs. The datasheet shows that
after a reset, the TRIS bits are set to '1'. So, there won't be a conflict.

Posted by Tim Wescott on February 11th, 2008


Arlet Ottens wrote:
This is normal for most microcontrollers these days, at least for pins
that can be either input or output. You should _always_ check the data
sheet carefully, though. Data sheets never modify themselves* to your
disadvantage after your design is set in stone, although this sometimes
seems to be the case.

--

Tim Wescott
Wescott Design Services
http://www.wescottdesign.com

Do you need to implement control loops in software?
"Applied Control Theory for Embedded Systems" gives you just what it says.
See details at http://www.wescottdesign.com/actfes/actfes.html

Posted by Tim Wescott on February 11th, 2008


Joerg wrote:
_don't_ have the board space to do it then carefully assess the amount
of damage you'll do by having an output <---> output failure, and put a
commensurate amount of effort into verifying your software.

--

Tim Wescott
Wescott Design Services
http://www.wescottdesign.com

Do you need to implement control loops in software?
"Applied Control Theory for Embedded Systems" gives you just what it says.
See details at http://www.wescottdesign.com/actfes/actfes.html

Posted by werty on February 14th, 2008



You will learn that MicroChip is obsolete .

Use A.R.M. , its modern , lower cost for
the same job .

Posted by Neil on February 14th, 2008


werty wrote:
(list for the PIC16F684)

What is the part number?

A PIC16F54 is under 50 cents
Sometimes little jobs only need little CPUs.

Posted by Arlet Ottens on February 14th, 2008


Neil wrote:
No, ARMs are not *that* cheap or small.

They're getting close, though, and they may be a good alternative for
the bigger PIC devices.

http://www.luminarymicro.com/product...ontroller.html

ARM Cortex, 28 pins, internal oscillator, 2K RAM, for $2.18 (single qty
@ Digi-Key)


Posted by Jim Granville on February 14th, 2008


werty wrote:
Microchip is a company, not a device.
As a company, they supply a great number of cores,
under the umbrella branding of PIC.

There is a whole world out there : A great many applications
are chosen on the P's : Pincount, Power, Peripherals, Price.

Notice the core is not even on this list!

ARMs 'bottom out' at ~48 pins,
so that leaves 6/8/10/14/16/18/20/24/28/32/36/40/44 pins, all
as candidates for other cores - indeed the ARM cannot reach these
applications at all.

(Microchips PIC32 cores do not bother going below 64 pins)

-jg


Posted by rickman on February 15th, 2008


On Feb 14, 3:14 am, Jim Granville <no.s...@designtools.maps.co.nz>
wrote:
I suppose you missed the introduction of the Luminary Micro ARM parts
a year or two ago???


Posted by werty on February 17th, 2008



Apparently you have no meaningful purpose for this hardware .

You post ........ $1.44 .... Whats the total cost in h/w and your
time ?!!.

I always write about important and productive uses for electronics .

The is no faster nor easier way to inmplement a powerful mcu , that
with A.R.M.

The slowest and most frustrating is MicroChip mcu's , next comes
Intel 8051

with its "simulated" control of external memory !

The STR710FZ2 has no bottlenecks nor extra chips needed .

no one wants to EVB , so ill use an avail' LPC2292 ,144 pins , but
way less internal SRAM ,

external 1/2 MB SRAM and 2MB Flash ...

As soon as i stop travelling so much , ill give away a free Forth
O.S. for the ARM .










On Feb 13, 11:08*pm, Neil <NeilKu...@worldnet.att.net> wrote:

Posted by Albert van der Horst on February 17th, 2008


In article <cb8bec52-9f3f-48e8-8a0d-eaeaf526d7db@i29g2000prf.googlegroups.com>,
werty <werty@swissinfo.org> wrote:
Don't hold your breath, people. werty is best known for his
trolling, i.a. on comp.lang.forth.

Groetjes Albert

--
--
Albert van der Horst, UTRECHT,THE NETHERLANDS
Economic growth -- like all pyramid schemes -- ultimately falters.
albert@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst



Similar Posts