Searching \ for '[PIC] Transients when setting an output port toits' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page:
Search entire site for: 'Transients when setting an output port toits'.

Exact match. Not showing close matches.
PICList Thread
'[PIC] Transients when setting an output port toits'
2008\11\02@172108 by Jan-Erik Soderholm

face picon face

Dr Skip wrote:
> That would make sense, but for sake of argument, and to more thoroughly
> understand any issues involved, let me ask essentially the same question
> another way:
> Assume the outputs are all driving transistor bases with a pullup on each base.

And with some resistor between the I/O pin and the base ?
What values of that (the base) resistor and of the pullup ?
What kind of transistor ? Bipolar och mosfet ?

>   One then wants to toggle every other bit _except_ bits 3 and 4 (arbitrary
> selection), including setting these others to inputs, outputs, high, low, but
> from the beginning of the program, 3 and 4 were initially set as outputs and to
> a value (one high and one low) and monitored.
> Is there any operation that doesn't directly alter bits 3 and 4 (like clearing
> the whole byte) yet would cause any pulse or change of state for even a minimal
> amount of time?

No, not in theory. But you could be hit by the
read-modify-write problem. There are both timing
issues (how fast after setting pin 3 and 4 are the
other pins set/cleared?) and configuration issues
(such as not shut off analog pin funtions).

But, not as "glitches" but more likely as permament changes
of pin 3 and 4 (until they're set back to whatever they
should be by some other code).

And again, are you actualy seeing something that
makes you ask ? Or is it just in general ?


{Quote hidden}

2008\11\03@043648 by Jan-Erik Soderholm

face picon face
Ruben Jönsson wrote:
> Inputs don't use the shadow register. Just read the port directly.
> btfss/btfsc does ofcourse read the port but they don't write anything back so
> there is no rmw issue here and it doesn't involve the shadow register at all.
> You can even read the outputs and verify that they are the same as the shadow
> register.

But why doing that ?

If you *are* using a shadow register it's becuse they are
*not* (or might not be) the same becuse of RMW issues. If
they are always the same you don't have any RMW issue
and you do not need the shadow register in the first place.


> Only the output bits then ofcourse. If they are not the same, it
> could be because an output is shorted or overloaded.
> /Ruben
>>> One way to solve this is to never read the the value from the port to
>>> the shadow register but keep the shadow register as a global variable
>> That would be impractical if you have to monitor inputs. I'm sure that
>> eg btfss pin / btfsc pin reads the port
>> --

2008\11\03@075451 by olin piclist

face picon face
Rodent of Unusual Size wrote:
> So the following is safe and will never introduce a transient?
> MOVLW B'100'

Not if "safe" means immune to the read-modify-write issue.

Embed Inc, Littleton Massachusetts,
(978) 742-9014.  Gold level PIC consultants since 2000.

2008\11\03@120136 by Rodent of Unusual Size

Rodent of Unusual Size wrote:
> So the following is safe and will never introduce a transient?
>        MOVLW        B'100'
>        IORWF        PORTB,F

D'oh, the article even explicitly said 'don't do that.'
(smacks forehead).

This HPS40 is pissing me off..  Half of the rare times when I
can get a semi-reasonable square wave on it, it shows
+/- pulses at the edges.

Maybe I'll start a new thread about recommendations for

Thanks, all!
#ken        P-)}

Ken Coar, Sanagendamgagwedweinini  http://Ken.Coar.Org/
Author, developer, opinionist      http://Apache-Server.Com/

"Millennium hand and shrimp!"

2008\11\03@132758 by Wouter van Ooijen

face picon face
> Another part of this low end with which I'm not familiar..
> If interrupts are disabled when one *would have* been delivered,
> is it lost?  


> Or delivered if/when interrupts are re-enabled


> (to some stack-limited number, no doubt)?



Wouter van Ooijen

-- -------------------------------------------
Van Ooijen Technische Informatica:
consultancy, development, PICmicro products
docent Hogeschool van Utrecht:

2008\11\03@221645 by Jinx

face picon face
> >You should be safe with BSF and MOVWF though

> Whoops, looks like I took the wrong one of the two possible meanings

Sorry for that. BSF _plus_ MOVWF

As Olin calculated, even a fast PIC is not generally prone to r-m-w if
some minor allowances are made. A fast micro like the Scenix, which
has a port architecture similar to a 16-series PIC, can be, as cycle time
is down at 20ns

More... (looser matching)
- Last day of these posts
- In 2008 , 2009 only
- Today
- New search...