Murphy's law says that you happen to do this in the middle of a flash
write cycle some day and then the whole thing might be on the fritz from
then on.
Use a proper interrupt pin.
--
Regards, Joerg
http://www.analogconsultants.com/
"gmail" domain blocked because of excessive spam.
Use another domain or send PM.
> _ wrote:
>> Say I wanted to have a run/stop switch on a circuit controlled by a
>> micro-processor. Could I halt the chip by holding the clock line high?
>> Would this have to be done carefully (if at all) to not damage the clock
>> generator circuit?
>
>
> Murphy's law says that you happen to do this in the middle of a flash
> write cycle some day and then the whole thing might be on the fritz from
> then on.
>
> Use a proper interrupt pin.
Don't think I can - the code is burnt, and they use the interupt pin for
something else.
Which micro? If it's static, it shouldn't know the difference, but if it's
dynamic (a la dynamic RAM) then you'll have to find a standby pin or
something.
Good Luck!
Rich
Now why is it you should use proper source control???
Can you supply an external clock and gate that? That'd be safer,
although still not very safe.
Careful with flash write cycles. Besides shortened clock cycles and the
troubles those cause a hard abort during a flash write could make that
whole 256-byte or whatever flash segment toastissimo. What it reads next
can be like the lottery.
Also, some uC do not activate their brown-out reset upon clock failure.
Some don't even have one.
IOW my advice would be: Don't do that. Switch the signal instead and not
the uC.
---
It would have to be done very carefully, and you might not be able to do
it at all.
For example, if you're using a crystal or a ceramic resonator to
generate the clock and you stop the crystal from oscillating in some
gross way, then when you want the �P to start up again the crystal's got
to start up again from scratch. Maybe several hundreds or several
thousands of cycles till it's up and running nicely.
The �P might not like that.
OTOH, if you're using a canned oscillator and all of the circuitry is
static it might work if you just gate the clock into the �P, but still
you'd need to be careful.
What I'd do would be to tell the clock that I wanted it to turn off, and
then on its next rising edge it would pull its output high and hold it
there until I told it to start sending clocks again which it would do
starting with its next falling edge.
That way everything is nice and clean and the micro never sees thin
clock slices which might confuse it.
There's a third possibility too, and that would be to build your own
gated oscillator.
In any case, I'd first check with the �P's tech support folks to see
what they think.
JF
Have a look at the microcontroller datasheet- specifically at the
clock signal requirements. *If* you can avoid violating *any* of the
requirements, the answer *might* be yes. Typically, for a modern
static CMOS micro, this would involve synchronizing the on/off signal
with an external oscillator (for example an oscillator module) using
something like a 74HC73 to avoid short cycles and resulting
malfunctions.
OTOH, if the micro has a clock monitor function and/or a watchdog
timer function (and if they are enabled) then it probably won't work.
Typically they will reset the micro within milliseconds after a
'failure' of the clock using internal RC oscillators or other timing
circuits.
Almost all modern micros have the latter functions, BTW, so your
chances are not very good IMHO.
Best regards,
Spehro Pefhany
--
"it's the network..." "The Journey is the reward"
sp...@interlog.com Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog Info for designers: http://www.speff.com
Some Freescale (formerly Motorola) processors have HALT and WAIT
instructions to do exactly what you're asking but you have to write
the code properly. Obviously you wouldn't WAIT or HALT the processor
during flash memory writes but you can get into an extremely low power
'wait for interrupt to re-start' mode.
G²
>On Tue, 10 Nov 2009 00:13:21 GMT, the renowned _
><jtayNO...@hfDONTSENDMESPAMx.andara.com> wrote:
>
>>Say I wanted to have a run/stop switch on a circuit controlled by a
>>micro-processor. Could I halt the chip by holding the clock line high?
>>Would this have to be done carefully (if at all) to not damage the clock
>>generator circuit?
>
>Have a look at the microcontroller datasheet- specifically at the
>clock signal requirements. *If* you can avoid violating *any* of the
>requirements, the answer *might* be yes. Typically, for a modern
>static CMOS micro, this would involve synchronizing the on/off signal
>with an external oscillator (for example an oscillator module) using
>something like a 74HC73 to avoid short cycles and resulting
>malfunctions.
A lot of CMOS micros aren't static. The 8-bit variety likely are,
though. This is something that you *really* need to investigate. It's
often not specified directly. Check if there is a minimum frequency,
though that may be a PLL thing (more ointment in your fly).
>OTOH, if the micro has a clock monitor function and/or a watchdog
>timer function (and if they are enabled) then it probably won't work.
>Typically they will reset the micro within milliseconds after a
>'failure' of the clock using internal RC oscillators or other timing
>circuits.
I thought most of those used a timer/counter off the oscillator.
>Almost all modern micros have the latter functions, BTW, so your
>chances are not very good IMHO.
I would tend to agree. Unless it's on the banner as a feature, I'd
assume it's not possible.
>On Mon, 09 Nov 2009 22:05:21 -0500, Spehro Pefhany
><spef...@interlogDOTyou.knowwhat> wrote:
>
>>On Tue, 10 Nov 2009 00:13:21 GMT, the renowned _
>><jtayNO...@hfDONTSENDMESPAMx.andara.com> wrote:
>>
>>>Say I wanted to have a run/stop switch on a circuit controlled by a
>>>micro-processor. Could I halt the chip by holding the clock line high?
>>>Would this have to be done carefully (if at all) to not damage the clock
>>>generator circuit?
>>
>>Have a look at the microcontroller datasheet- specifically at the
>>clock signal requirements. *If* you can avoid violating *any* of the
>>requirements, the answer *might* be yes. Typically, for a modern
>>static CMOS micro, this would involve synchronizing the on/off signal
>>with an external oscillator (for example an oscillator module) using
>>something like a 74HC73 to avoid short cycles and resulting
>>malfunctions.
>
>A lot of CMOS micros aren't static. The 8-bit variety likely are,
>though. This is something that you *really* need to investigate. It's
>often not specified directly. Check if there is a minimum frequency,
>though that may be a PLL thing (more ointment in your fly).
Yes. Some of the modern 32-bit micros have something like half a dozen
PLLs to generate various clock domains from a single crystal, and none
of them are going to like the clock running too slow, let alone
stopping. And even some 8-bit ones now have PLLs, so minimum external
clock frequency is in the low MHz if the PLL is enabled.
>>OTOH, if the micro has a clock monitor function and/or a watchdog
>>timer function (and if they are enabled) then it probably won't work.
>>Typically they will reset the micro within milliseconds after a
>>'failure' of the clock using internal RC oscillators or other timing
>>circuits.
>
>I thought most of those used a timer/counter off the oscillator.
No, because that's potentially disastrous if the clock fails (say, due
to a bad crystal). Has to be independent and preferably entirely
internal. I've seen some that combined such a timer/counter for the
watchdog with a clock monitor to ensure there's still a reasonably
fast clock coming in. Useless if a watch crystal is used (clock
monitor has to be disabled) but usually something that runs off a
watch crystal isn't connected to anything that can hurt anyone or
anything much.
>>Almost all modern micros have the latter functions, BTW, so your
>>chances are not very good IMHO.
>
>I would tend to agree. Unless it's on the banner as a feature, I'd
>assume it's not possible.
Some micros can be static clocked, look in the datasheet for 'static clock',
some need a clock all the time, in that case you cannot do it.
I think shorting a clock *input*, when using a crystal connected to a micro,
is no problem.
The only answer to this is to read the specifications for the UPC, the
memory, and perphial chips. Some UPCs are dynamic and have a minimum
clock speed, others are static and don't. Ditto for memory and support
chips.
Other possible options?
Can you cobble up a second microcontroller circuit and trigger that
from the original?
That way, you could put the run/stop function on the 2nd uPc and not
have worry much about the first one.
Is there a RESET line on the processor? Can you just hold that line
(stop) until you need it (run)?
I assume this is someone else's code that you don't have access to?
Otherwise, the obvious advice is to just implement your run/stop in
coding - assuming you have the hardware resources available.
Good luck.
-mpm
If the clock fails (bad crystal) your watchdog has nothing to bark at.
It's dead, Jim. The 8051's watchdog timer was a counter/timer (I had
one 8051 watching the other ;). I believe the TI 5K series of DSPs
watchdogs' are too.
Some can be stopped in one state but not the other. Again, this sort
of thing is going to be yelled about in feature headings.
I remember reading about maximum clock frequency change for one micro
recently, I believe it was the AVR. Suggests that rapid frequency change is
a bad idea. This might only affect certain functions, though, probably involving
timers and TWI/USART functionality.
M
Why would they care? The problem is the PLLs losing lock.
AFAIK a few AVR's do indeed have PLL, but I believe those are used
for PWM/Timers. I guess we're both correct.
M
Timers and such won't go squirrely if the oscillator changes. PLLs
will.