Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Thread

OT HC595 AND PIC GLITCHES

OT HC595 AND PIC GLITCHES

2006-09-07 by oldhat_owen

I know this is perhaps a bit off topic but I have several boards with 
PIC16F877 processors driving an HC595 shift register and the output 
pins from the pic driving the HC595 are virtually all glitches.

It is hard to pick up a high or low as such on the logic analyser 
other outputs seem ok, has anyone any idea what may be causing this. 

And yes I do not like pic's I normally use AVR'S.

Owen.

Re: [AVR-Chat] OT HC595 AND PIC GLITCHES

2006-09-07 by Zack Widup

I have a couple questions:

1 - What frequency is the PIC running at?

2 - Are the DC input leads to the PIC and the 74HC595 adequately bypassed 
with capacitors? (I'd assume you did this properly).

3 - Are all ground leads on the PIC grounded? I just about went around the 
bend once trying to figure out why one 16F877 circuit wouldn't work and 
found I'd forgotten to ground one of the ground leads. It worked fine once 
I did that.

4 - What is the duration of the pulses from the PIC to the HC595 that 
you're sending, per your program?

Zack
Show quoted textHide quoted text
On Thu, 7 Sep 2006, oldhat_owen wrote:

> I know this is perhaps a bit off topic but I have several boards with 
> PIC16F877 processors driving an HC595 shift register and the output 
> pins from the pic driving the HC595 are virtually all glitches.
> 
> It is hard to pick up a high or low as such on the logic analyser 
> other outputs seem ok, has anyone any idea what may be causing this. 
> 
> And yes I do not like pic's I normally use AVR'S.
> 
> Owen.
>

Re: [AVR-Chat] OT HC595 AND PIC GLITCHES

2006-09-07 by Leon Heller

----- Original Message ----- 
Show quoted textHide quoted text
From: "oldhat_owen" <oldboot@bigpond.com>
To: <AVR-Chat@yahoogroups.com>
Sent: Thursday, September 07, 2006 3:06 PM
Subject: [AVR-Chat] OT HC595 AND PIC GLITCHES


>I know this is perhaps a bit off topic but I have several boards with
> PIC16F877 processors driving an HC595 shift register and the output
> pins from the pic driving the HC595 are virtually all glitches.
>
> It is hard to pick up a high or low as such on the logic analyser
> other outputs seem ok, has anyone any idea what may be causing this.
>
> And yes I do not like pic's I normally use AVR'S.

Perhaps you are having read/modify/write problems, are you using the bit 
manipulation instructions?

Leon

RE: [AVR-Chat] OT HC595 AND PIC GLITCHES

2006-09-07 by OWEN-A

I have a couple questions:

1 - What frequency is the PIC running at?

20MHZ


2 - Are the DC input leads to the PIC and the 74HC595 adequately bypassed 
with capacitors? (I'd assume you did this properly).

100NF FOR EACH

3 - Are all ground leads on the PIC grounded? I just about went around the 
bend once trying to figure out why one 16F877 circuit wouldn't work and 
found I'd forgotten to ground one of the ground leads. It worked fine once 
I did that.

ALL GROUND LEADS ARE GROUNDED


4 - What is the duration of the pulses from the PIC to the HC595 that 
you're sending, per your program?

NOT 100% SURE  THERE ARE AT LEAST 10 nop's BETWEEN EACH TRANSITION

This is not my circuit or my code it is a fix up job for a system where the
original designers have quit "ex gone broke".
There are quite a few of these units in the field.
The logic analyser is capable to 50MHZ but on these lines it misses the
pulses and will only pick up a signal when glitch detection is turned on. 
Thanking you,
Owen.


Zack

On Thu, 7 Sep 2006, oldhat_owen wrote:

> I know this is perhaps a bit off topic but I have several boards with 
> PIC16F877 processors driving an HC595 shift register and the output 
> pins from the pic driving the HC595 are virtually all glitches.
> 
> It is hard to pick up a high or low as such on the logic analyser 
> other outputs seem ok, has anyone any idea what may be causing this. 
> 
> And yes I do not like pic's I normally use AVR'S.
> 
> Owen.
> 




 
Yahoo! Groups Links

RE: [AVR-Chat] OT HC595 AND PIC GLITCHES

2006-09-07 by OWEN-A

Using  bsf  and bcf   PORT?,n
Thanking You,
Owen.

>I know this is perhaps a bit off topic but I have several boards with
> PIC16F877 processors driving an HC595 shift register and the output
> pins from the pic driving the HC595 are virtually all glitches.
>
> It is hard to pick up a high or low as such on the logic analyser
> other outputs seem ok, has anyone any idea what may be causing this.
>
> And yes I do not like pic's I normally use AVR'S.

Perhaps you are having read/modify/write problems, are you using the bit 
manipulation instructions?

Leon 




 
Yahoo! Groups Links

Re: [AVR-Chat] OT HC595 AND PIC GLITCHES

2006-09-07 by Roy E. Burrage

If it's someone else's design and also their code, considering that they 
have gone Tango Uniform in the mean time, you might be better off to 
just take the original specs and start all over from scratch Owen.  If 
there are a number of boards out in the field, so be it.  If yours is 
form, fit, and function compatible there should be no problem...assuming 
this is a replaceable module in another piece of equipment.  If it fits 
in the same hole and connects the same way, who cares?

You can spend a lot of time to find one line of code that's out of 
whack, a marginal component combination, or a marginal circuit layout.  
When called in behind someone else who's gone TU, and upon explanation 
that there's probably a reason for that, most customers will go with the 
redesign option in my experience.

Then you can use a real controller...       :-D


REB



OWEN-A wrote:

>
>I have a couple questions:
>
>1 - What frequency is the PIC running at?
>
>20MHZ
>
>
>2 - Are the DC input leads to the PIC and the 74HC595 adequately bypassed 
>with capacitors? (I'd assume you did this properly).
>
>100NF FOR EACH
>
>3 - Are all ground leads on the PIC grounded? I just about went around the 
>bend once trying to figure out why one 16F877 circuit wouldn't work and 
>found I'd forgotten to ground one of the ground leads. It worked fine once 
>I did that.
>
>ALL GROUND LEADS ARE GROUNDED
>
>
>4 - What is the duration of the pulses from the PIC to the HC595 that 
>you're sending, per your program?
>
>NOT 100% SURE  THERE ARE AT LEAST 10 nop's BETWEEN EACH TRANSITION
>
>This is not my circuit or my code it is a fix up job for a system where the
>original designers have quit "ex gone broke".
>There are quite a few of these units in the field.
>The logic analyser is capable to 50MHZ but on these lines it misses the
>pulses and will only pick up a signal when glitch detection is turned on. 
>Thanking you,
>Owen.
>
>
>Zack
>
>On Thu, 7 Sep 2006, oldhat_owen wrote:
>
>  
>
>>I know this is perhaps a bit off topic but I have several boards with 
>>PIC16F877 processors driving an HC595 shift register and the output 
>>pins from the pic driving the HC595 are virtually all glitches.
>>
>>It is hard to pick up a high or low as such on the logic analyser 
>>other outputs seem ok, has anyone any idea what may be causing this. 
>>
>>And yes I do not like pic's I normally use AVR'S.
>>
>>Owen.
>>


[Non-text portions of this message have been removed]

Re: [AVR-Chat] OT HC595 AND PIC GLITCHES

2006-09-07 by Leon Heller

----- Original Message ----- 
Show quoted textHide quoted text
From: "OWEN-A" <oldboot@bigpond.com>
To: <AVR-Chat@yahoogroups.com>
Sent: Thursday, September 07, 2006 4:09 PM
Subject: RE: [AVR-Chat] OT HC595 AND PIC GLITCHES


> Using  bsf  and bcf   PORT?,n
> Thanking You,

That could be the problem, if they follow one another (read-modify-write). 
Try putting NOPs between them, or write to the whole port.

Leon

Re: [AVR-Chat] OT HC595 AND PIC GLITCHES

2006-09-07 by Dennis Clark

Ouch. PIC 16F parts do a read-modify-write on the IO port that a pin is 
on when you use the bsf/bcf instructions, so if you do a bsf PORTA,7 
you'll read all of port A, set bit 7 and then write PORTA back out. 
This means that you could change any of the pins on PORTA depending upon 
what was read on those lines.  A far safer way to do this is to keep a 
"shadow" register for a port, do the bsf/bcf on that shadow register and 
when completed write the whole register out to the port.  This will 
guarantee that your bsf/bcf operations don't munge up other bits on the 
port.  Thank goodness the 18F, 30/33/24F parts DON'T have this side effect.

DLC

OWEN-A wrote:
> Using  bsf  and bcf   PORT?,n
> Thanking You,
> Owen.
> 
> 
>>I know this is perhaps a bit off topic but I have several boards with
>>PIC16F877 processors driving an HC595 shift register and the output
>>pins from the pic driving the HC595 are virtually all glitches.
>>
>>It is hard to pick up a high or low as such on the logic analyser
>>other outputs seem ok, has anyone any idea what may be causing this.
>>
>>And yes I do not like pic's I normally use AVR'S.
> 
> 
> Perhaps you are having read/modify/write problems, are you using the bit 
> manipulation instructions?
> 
> Leon 
> 
> 
> 
> 
>  
> Yahoo! Groups Links
> 
> 
> 
> 
> 
> 
>  
> 
> 
> 
> 
> 
> 
>  
> Yahoo! Groups Links
> 
> 
> 
> 
> 
> 
> 
> 

-- 
---------------------------------------
Dennis Clark    TTT Enterprises
---------------------------------------

Re: [AVR-Chat] OT HC595 AND PIC GLITCHES

2006-09-07 by David VanHorn

Something else to be aware of, glitches on the data pins going to the shift
registers don't matter at all, unless they are accompanied by a transition
on the clock line.

Those glitches may be intentional, driving something else.
They may be intentional, just to confuse reverse engineers.
They may be bugs.

Hard to see without a schematic.


[Non-text portions of this message have been removed]

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.