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

My RTCC can't keep its time when VDD shutdown
Goto page Previous  1, 2, 3  Next
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
BeeElectronic



Joined: 19 Jul 2017
Posts: 27

View user's profile Send private message

PostPosted: Thu Sep 05, 2019 3:06 am     Reply with quote

Seriously there should not be any detectable ripple on the Vbat connection. 2 or 3mV at most.
-> yes I have ripple on Vbat juste enough for stop my scope with a 2.9V trig level, this is the MCU regulator
switching (between VDD and VBAT). But it's the same ripple for a VBAT BOR and normal power up, NOT more or worth.

How long is the connection?.
-> 35mm

Is the battery ground connected to the same point as the processor ground?.
-> GND Plane

How it the battery connection physically made?.
-> Through a S8411 harwin holder

Do you have any capacitor on the Vbat connection?.
-> No
Ttelmah



Joined: 11 Mar 2010
Posts: 19539

View user's profile Send private message

PostPosted: Thu Sep 05, 2019 3:24 am     Reply with quote

Generally, every 'supply' pin, should always have something like a 0.1uF
capacitor close to the pin. In their own recommendations for other chips
Microchip show one.
Add one.
BeeElectronic



Joined: 19 Jul 2017
Posts: 27

View user's profile Send private message

PostPosted: Thu Sep 05, 2019 4:02 am     Reply with quote

I never use an internal RTCC with a PIC but regularity with STM32.
On STM32 I used ST never put a capacitor on Vbat pin.

I don't find this information on the PIC16F19176 datasheet but I tried with
a 100nF X7R and it's worst. I have Vbat BOR at nearly every power up...
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Sep 05, 2019 4:31 am     Reply with quote

MCP79400 resets occasionally after power loss
https://www.microchip.com/forums/m1084666.aspx
BeeElectronic



Joined: 19 Jul 2017
Posts: 27

View user's profile Send private message

PostPosted: Thu Sep 05, 2019 5:49 am     Reply with quote

Thanks for your time PCM programmer and Ttelmah but I will not use the internal RTCC because of the poor reliability.
Ttelmah



Joined: 11 Mar 2010
Posts: 19539

View user's profile Send private message

PostPosted: Thu Sep 05, 2019 7:22 am     Reply with quote

BeeElectronic wrote:
I never use an internal RTCC with a PIC but regularity with STM32.
On STM32 I used ST never put a capacitor on Vbat pin.

I don't find this information on the PIC16F19176 datasheet but I tried with
a 100nF X7R and it's worst. I have Vbat BOR at nearly every power up...


That's quite funny, since ST's own application note specifically says
a capacitor is 'required'... Smile

It really does suggest something about your wiring is peculiar. How fast does
the main supply rail drop?.
BeeElectronic



Joined: 19 Jul 2017
Posts: 27

View user's profile Send private message

PostPosted: Thu Sep 05, 2019 8:06 am     Reply with quote

The last one I use is the STM32F746BET6. On the "Power supply scheme" they don't use capacitor on Vbat. On my biggest STM32 dev board, STM3240G-EVAL, they don't use capacitor on Vbat.

Do you have this application note? Is it for the new STM32?

I can do 2 power off:
- slow -> When the MCU restart I have a BOR resart cause
- Fast (disconnect the board) -> When the MCU restart I have a normal power up or a Vbat BOR (1 every 20 startup / 16 every 20 startup with a 100nF capacitor)

The last time I post to the CCS forum for a I2C problem and after a few days it appears the problem came from CCS, a bug with there library or routines. I don't know what happen
in the setup_rtc function but I think something weird...
Ttelmah



Joined: 11 Mar 2010
Posts: 19539

View user's profile Send private message

PostPosted: Thu Sep 05, 2019 8:36 am     Reply with quote

That is interesting. Suggests it is the period spent in the transition
(deciding whether to switch to battery or not), that is causing the issue.
Do you have the brownout enabled?. What voltage it it set to?.
Obviously it is vital that code cannot actually 'run' during the period
when the supply is going off. Do you have PUT enabled?. What period for?.
Again it is vital that things don't happen in code terms until the supply is
fully 'up'.
temtronic



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

View user's profile Send private message

PostPosted: Thu Sep 05, 2019 9:55 am     Reply with quote

Assuming that the 'RTCC module' in that PIC is common to others, it's hard to believe the problem is 'in the die' rather a software bug. If it was a common issue, there'd be a lot of Google hits and MC errata updates.
None of the PICs I use have the RTCC,so I can't test, but I suspect a minor code change(like timing or sequence) may resolve the issue.
It could be your power supply doesn't conform to the standard, or EMI from the on/off switch.

Jay
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Sep 05, 2019 10:17 am     Reply with quote

My suspicion is either a hidden errata or poor board layout, or something
wrong with the power supply circuit. It's something that we can't see,
so far.
Ttelmah



Joined: 11 Mar 2010
Posts: 19539

View user's profile Send private message

PostPosted: Thu Sep 05, 2019 10:31 am     Reply with quote

We have seen oddities in the past when supply rails rise slower than
allowed. It is common not to realise that there is a minimum specification
for this time.
BeeElectronic



Joined: 19 Jul 2017
Posts: 27

View user's profile Send private message

PostPosted: Fri Sep 06, 2019 1:01 am     Reply with quote

Ttelmah wrote:
That is interesting. Suggests it is the period spent in the transition
(deciding whether to switch to battery or not), that is causing the issue.
Do you have the brownout enabled?. What voltage it it set to?.
Obviously it is vital that code cannot actually 'run' during the period
when the supply is going off. Do you have PUT enabled?. What period for?.
Again it is vital that things don't happen in code terms until the supply is
fully 'up'.


Yes I have BOR at 2.7V. But same issue with NOBOR or BOR at 2.4V
Yes I have PUT at 16ms. I try without quickly...
BeeElectronic



Joined: 19 Jul 2017
Posts: 27

View user's profile Send private message

PostPosted: Fri Sep 06, 2019 1:08 am     Reply with quote

I don't think I have any problem with my power supply because this PSU is common for a lot of our projects and we have certification for it.

I can't have board layout issue because I use a 4 layers board (Signal/VDD/GND/Signal). The main supply come from a +12V battery and my
+5V (VDD) regulation is made by a LDO regulator (LM317T) with varistor/fuse/diode protection and low ESR tantalum+X7R decoupling.
BeeElectronic



Joined: 19 Jul 2017
Posts: 27

View user's profile Send private message

PostPosted: Fri Sep 06, 2019 1:13 am     Reply with quote

Same without PUT...
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Sep 06, 2019 2:31 am     Reply with quote

He didn't mean to try it without PUT. He wondered if you had it at all.

I would try it with PUT_64MS.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2, 3  Next
Page 2 of 3

 
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