CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

GPIO on PIC undershooting

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
hello188



Joined: 02 Jun 2010
Posts: 74

View user's profile Send private message

GPIO on PIC undershooting
PostPosted: Sun Sep 22, 2013 9:43 pm     Reply with quote

Hi, I was troubleshooting SPI /SS line and noticed that the output undershoots about 500mV(to -500mV), for about 5ns and returns back to 0.

In datasheet, the absolute maximum rating for the pin is supposed to be only -0.3V.

So far, I am debugging with ICD3 and the chip seems to work fine.

However, would it cause problem later on?

What are the possible reasons for undershooting?

Thank you
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Mon Sep 23, 2013 12:39 am     Reply with quote

The maximum voltage rating should be read in conjunction with the maximum clamp current specification
of +/- 20 mA. As long it's not exceeded, there should be no risk for the chip.

An over/undershoot usually happens if an unterminated PCB line or cable of some length is driven with fast
rise time and high current strength. The best way to reduce is to insert a series resistor (e.g. 30 - 100 ohm)
at the driver side (source side impedance matching) or reduce the drive strength, if it's programmable.
Ttelmah



Joined: 11 Mar 2010
Posts: 19255

View user's profile Send private message

PostPosted: Mon Sep 23, 2013 12:43 am     Reply with quote

First start by making sure your scope probe is properly compensated.
Unless this is correctly adjusted, it can show over/undershoot where none exists. In fact the undershot can be caused by the probe itself in this case...
Second then look at where the scope is grounded, relative to the chip. It is easy to 'see' undershoot, when what is actually happening, is that the point the scope is grounded to, is rising.
In real circuits, a good ground plane, is the first step in controlling this.
A tiny series resistor in the line will fractionally slow the rising/falling edges and reduce overshoot. Perhaps 10R.

Basically, any signal line, carrying a high frequency signal, is a 'transmission line'. You will get undershoot, when the line being driven is not terminated to have a good match. The signal travels down the line, bounces back off the unterminated end, and arrives back at the driver a few pSec (depending on the length of the wire), after if went low, and pulls the line down.

So, things you can do:
1) Add termination to the line.
2) Make sure you have good decoupling. If this is inadequate it can again give 'apparent' undershoot.
3) Ground layout. Make sure everything is grounding back to the same point.
4) Slow the signal edges (this is part of what the series resistor does). Adding a (tiny) amount of capacitance to the line, can also be done.

Best Wishes
hello188



Joined: 02 Jun 2010
Posts: 74

View user's profile Send private message

PostPosted: Mon Sep 23, 2013 8:20 pm     Reply with quote

Thank you.

I redid the auto-compensation on my tektronix oscilloscope, and still shows
the undershoot. There is overshoot too, but it's not as bad as the undershoot

So, basically, I have to control the slew rate of the driving pin's.

Unfortunately, I don't think PIC18F 's don't have that option.

Do I have to add a series resistor pin right after the driving pin's?
RF_Developer



Joined: 07 Feb 2011
Posts: 839

View user's profile Send private message

PostPosted: Tue Sep 24, 2013 1:42 am     Reply with quote

I suspect you have a basic misunderstanding of the significance of the data presented in the datasheet.

The absolute ratings related to what can be applied from an external source, and in a sense are macro-scale ratings in terms of time, i.e. you will probably get away with applying a higher voltage than an abs max if its only for a very short time.

Overshoot and undershoot - essentially the same thing, just in after different direction of change of signal - are normal and almost impossible to eliminate. The fact that an output from the PIC overshoots to beyond abs max is not really a big issue: its momentary and the energy is low. It's not great, but its almost impossible to get rid of. The theory is "simple": match the transmission line and load to the impedance of the output and the overshoot will pretty much go away. However the output impedance is not constant and not defined, therefore you cannot get it "right", just "close enough" at best. PICs are also hardly the fastest devices in our increasingly high speed digital world. PICs clock rates are hundreds of times slower than many other processors (tens of MHz v several GHz) and line matching for PICs is generally a non-issue. Yes, you'll get over and undershoot, which if you're really worried about it, a series termination resistor typically a few tens of ohms tops and half-decent PCB layout, will largely tame, but that's quite normal and nothing to worry about and I doubt few, if any PIC users bother, except in a very few exceptional cases.

There certainly are abs max voltage rating problems with PICs and other processors, but overshoot is generally not it: there are bigger fish to fry. What IS a real problem is things like analogue inputs being driven beyond Vdd/Vss by op-amps powered from higher voltage rails, e.g. +/-12V when the Vdd of the PIC is 5V, or a PIC running at 3.3V being attached to peripherals running at 5V.
Ttelmah



Joined: 11 Mar 2010
Posts: 19255

View user's profile Send private message

PostPosted: Tue Sep 24, 2013 3:00 am     Reply with quote

Also, if this is a pin used to drive a 'select', then you might want to consider adding a pull up resistor at the opposite end of the line. Has the advantage of meaning the end is driving a slightly lower impedance, and ensures that the line is pulled high when the PIC has not yet woken up.

Best Wishes
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group