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 CCS Technical Support

Glitch down to 900 mV on 3.3V rail

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



Joined: 13 Apr 2011
Posts: 417

View user's profile Send private message

Glitch down to 900 mV on 3.3V rail
PostPosted: Tue Mar 06, 2018 1:49 pm     Reply with quote

I'm using a PIC18F67J50 at 3.3V that shares the same supply with a GPS module which is turned on by the µC through a P MOSFET.
Also a Flash SPI memory and an EEPROM SPI memory are in the same 3.3V rail.
When the GPS is turned on I get a very short glitch down to 960mV on 3.3V rail for about 5/7µS.

The µC is running at 48MHz (internal 8MHz * 4 (PLL)) and doesn't reset but some times have some strange behavior and/or the WDT barks.

Now I wonder if that glitch can corrupt RAM and/or some internal modules.

I know that this is not OK and now I'm making some changes in the power supply but I wonder what happens inside the µC after such glitch.

In short, I would like to know your experiences and advice in these type of glitches.
_________________
Electric Blue
temtronic



Joined: 01 Jul 2010
Posts: 9229
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Tue Mar 06, 2018 2:24 pm     Reply with quote

just a general comment....

most (all ? ) GPS units draw a LOT of power when turned on...so as you found out, you NEED to have a bigger power supply, maybe add a supercap?
I'd like to see some 'decoupling' of the power feeds, maybe put additional C on the PIC VDD line.
Ttelmah



Joined: 11 Mar 2010
Posts: 19520

View user's profile Send private message

PostPosted: Tue Mar 06, 2018 2:40 pm     Reply with quote

and, yes a glitch can corrupt the RAM in the PIC or even change the latch contents feeding ports. Problem is it'll be completely unpredictable, and may well change with other things like temperature.
asmallri



Joined: 12 Aug 2004
Posts: 1635
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

Re: Glitch down to 900 mV on 3.3V rail
PostPosted: Tue Mar 06, 2018 3:26 pm     Reply with quote

E_Blue wrote:
doesn't reset but some times have some strange behavior and/or the WDT barks.


When a WDT "Barks" it means a WDT reset occurs yet, in the same sentence you said the processor does not reset. Only one of these statement can be true.

A WDT "Barking" usually means the processor is not executing the code path that was expected. This can be due to a software bug not allowing for a fringe condition, a peripheral that hit an error condition you did not allow for or the processor crashed typically caused by some external event such as a glitch. When the processor "crashes" it is processing some unintended code fragment and can be modifying virtually anything. To protect the processor for doing things it should not do when a glitch occures (such as drop an elevator down an elevator shaft) you would use brownout detection to force the processor to reset in the presence of a glitch combined with hardware design to for the HW into a "safe state when outputs of the processor go tri-state as a result of a reset.

The glitch problem is not necessarily with the power supply itself and adding a bigger power supply will not necessarily fix the problem., it could (and probably is) as a result of insufficient power supply filtering (big low ESR caps) and/or insufficient bypass capacitors especially around the FET controlling power to the GPS.
_________________
Regards, Andrew

http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!!
newguy



Joined: 24 Jun 2004
Posts: 1908

View user's profile Send private message

Re: Glitch down to 900 mV on 3.3V rail
PostPosted: Tue Mar 06, 2018 3:33 pm     Reply with quote

E_Blue wrote:
In short, I would like to know your experiences and advice in these type of glitches.


As you've learned the hard way, I try to avoid these types of glitches as I've been bit by power supply undersizing before.

If I may, I'd like to suggest a "quick & dirty" fix before you get too deep. The GPS module is browning out your supply momentarily, so why not try something a little unconventional? I assume that your pFET is "good" = low Rds(on). That low resistance is contributing to your supply getting pulled low rather easily. Can you find a pFET with the same footprint as the one you're using now, but with an Rds(on) ~10x the one you're using now? Get an assortment of pFETs with that same footprint and with Rds(on) ranging from ~10x - 200x what you're now using.

Thinking here is that instead of a low resistance path to Vcc, give the GPS module a "high" resistance path so that whatever it's charging inside of itself initially is "insulated" from the rest of the circuitry somewhat. You should be able to find a pFET with characteristics that require nothing else on your PCB to be changed that will brown out your supply to a point that is still acceptable for your PIC so that nothing gets corrupted (no weird behaviour).
asmallri



Joined: 12 Aug 2004
Posts: 1635
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

Re: Glitch down to 900 mV on 3.3V rail
PostPosted: Tue Mar 06, 2018 4:24 pm     Reply with quote

[quote="newguy"]
E_Blue wrote:


Thinking here is that instead of a low resistance path to Vcc, give the GPS module a "high" resistance path so that whatever it's charging inside of itself initially is "insulated" from the rest of the circuitry somewhat. You should be able to find a pFET with characteristics that require nothing else on your PCB to be changed that will brown out your supply to a point that is still acceptable for your PIC so that nothing gets corrupted (no weird behaviour).


This solution is also not without its own challenge. GPS modules contain their own embedded processors. Creating a situation like this with a slow VDD rise time could cause the embedded processor in the GPS module to crash.
_________________
Regards, Andrew

http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!!
newguy



Joined: 24 Jun 2004
Posts: 1908

View user's profile Send private message

Re: Glitch down to 900 mV on 3.3V rail
PostPosted: Tue Mar 06, 2018 4:31 pm     Reply with quote

asmallri wrote:
This solution is also not without its own challenge. GPS modules contain their own embedded processors. Creating a situation like this with a slow VDD rise time could cause the embedded processor in the GPS module to crash.


Thus the "quick & dirty" description. Laughing

Often called a "bush fix" round these parts.
E_Blue



Joined: 13 Apr 2011
Posts: 417

View user's profile Send private message

PostPosted: Wed Mar 07, 2018 7:14 am     Reply with quote

@temtronic
I will put a separate power supply but for now I need to solve this with a bigger cap at the supply output.

@Ttelmah
Thanks for the input.

@asmallri
Quote:
When a WDT "Barks" it means a WDT reset occurs yet, in the same sentence you said the processor does not reset. Only one of these statement can be true.


I mean that the µC doesn't reset in the exact time when the glicht occurs, but few seconds later.
The brownout is enabled but according the datasheets it needs at least 200µS of low voltage but the glitch is about 7µS at most.

@newguy
I can't change it now, In my country the SMD components are sold by 4000 pcs.
For now I will change the power supply output capacitor by a bigger one.
On next release I will use a separate power supply just for the GPS.
_________________
Electric Blue
Ttelmah



Joined: 11 Mar 2010
Posts: 19520

View user's profile Send private message

PostPosted: Wed Mar 07, 2018 7:26 am     Reply with quote

Quote:

I mean that the µC doesn't reset in the exact time when the glicht occurs, but few seconds later.
The brownout is enabled but according the datasheets it needs at least 200µS of low voltage but the glitch is about 7µS at most.


What is happening is that the RAM is getting glitched or the processor itself locked up. The watchdog triggers at it's expiry interval 'after' the event. The actual time will depend on how long it was since the last reset.
asmallri



Joined: 12 Aug 2004
Posts: 1635
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Wed Mar 07, 2018 3:26 pm     Reply with quote

E_Blue wrote:
@temtronic
I will put a separate power supply but for now I need to solve this with a bigger cap at the supply output.

@Ttelmah
Thanks for the input.

@asmallri
Quote:
When a WDT "Barks" it means a WDT reset occurs yet, in the same sentence you said the processor does not reset. Only one of these statement can be true.


I mean that the µC doesn't reset in the exact time when the glicht occurs, but few seconds later.
The brownout is enabled but according the datasheets it needs at least 200µS of low voltage but the glitch is about 7µS at most.

@newguy
I can't change it now, In my country the SMD components are sold by 4000 pcs.
For now I will change the power supply output capacitor by a bigger one.
On next release I will use a separate power supply just for the GPS.


Before you go changing the power supply, A GPS module, such as a uBlox module would consume the most power (about 70mA) during acquisition. Depending on your existing power supply, this may be a non issue. Post your schematic and a link to the power supply module you are using and how much current your hardware is consuming and the supply voltage
_________________
Regards, Andrew

http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!!
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