Excerpts from the datasheet for Microchip to consider before withdrawing there excuse and issuing an apology:
Description
They are especially suited for battery-powered LCD applications due to an integrated charge pump, high current I/O drive for backlighting, and battery backup of the Real-Time Clock/Calendar (RTCC).
8.1 VBAT
This device is equipped with a VBAT pin that allows the user to connect an external battery or an external supply. In the event of the VDD supply failing, the power source connected to the VBAT pin will keep the SOSC and RTCC modules running.
8.17 VBAT System
The VBAT subsystem allows the RTCC and SOSC to run from a battery connected to the VBAT pin in the
event of a VDD failure. Typically, the battery is a 3V coin cell, however the system is designed to operate over the entire VDD voltage range. If VDD is greater than VBAT, the RTCC and SOSC will be powered by VDD. If VDD is less than VBAT, the RTCC and SOSC will switch over to VBAT. See Table 4-5 and Table 4-8 for more information on the VBAT registers.
From datasheet DS40001923A-page 144 diagram, my understanding is that CLKOUT is not part of SOSC.
The datasheet said that during VBAT operation only SOSC and RTCC will work.
This could explain the device behavior.
My response.
To clear.
The clock should continue when VBAT is operating. With the clock maintaining real time during VBAT. Go and ask product support how to do this.
and, please, please, please do not use your understanding. Escalate. As the RTCC that stops and restarts with same time is not what is expected from the description.
No other [RTCC]product does this.
Please escalate. I need to sort this out. This microcontroller and the RTCC has been an issue for many months.
No response as yet.
Last edit: Anobium 2018-07-14
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Support tickets with Microchip are #00308634 and #00258560 are still unresolved.
Nagged on 19th July 2018 for progress update.
Summary
Microchip have provided lots of source code, guidance and MPLAB-X projects. However, all efforts have failed to maintain the RTCC operating as expected. Either the clock does not start or the clock does not maintain time when operating with VBAT (essentially SOCS stops operating).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Pleasure. We may be able to sort. Clint has a16f19176 and he is now experiencing similar issues but with more brains looking at the issue we may resolve ourselves.
But, when I nagged today. I was very forceful as we now have three projects with similar RTCC issues.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
One more thing to add. On my chip it looks like when you have a battery hooked up (mine is 3 AA which is 4.5v) and disconnect power, it back feeds to the power lines which read around 1.9v. My Timer keeps running blinking my LED though it is very faint. Unplug the battery and everything goes dead.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Nagged. Got a call!! Amazing. New engineer allocated.
Transcript of conversation. This has been added to the case notes.
Susmitha Galla (Microchip)
Thank you for calling in. I’ve just read through your case and have some questions.
Please explain what are your expectations from the PIC. Can you please give me more details regarding your application? Also, what are you trying to do during Vbat operation?
From my understanding you are trying to blink an LED during VBAT usage. What is the frequency you are blinking the LED at?
Me (Evan),
To be sure of no misunderstanding.
TheMPLAB-X project posted by Daniel (of Microchip) stops the RTCC and SOSC when VCC is removed. This is NOT the expected operation.
Serial output (in theMPLAB-X project) is ok. But, when VCC is removed then the RTCC and SOSC should maintain real time not loose time!
If engineering or the product team confirm this cannot be done then I will need confirmation as this will be a real issue for the users.
I am not going to repeat all the issues, as these are well documented in this case notes.
But, to
keep things simple. Using the project attached, created by Daniel. All we need to do initially is to keep the RTCC and SOSC running during main VCC lost therefore we are using VBAT. Currently, the RTCC clock stops.
So, resolve this issue to show how this can be done. Then, we can resolve any other issues.
So, we may get some action soon.
Last edit: Anobium 2018-08-01
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Another engineer has been allocated. This time he knows his stuff. So, we need to send him information as he thinks he has the solution.
Please send me your circuit schematic, the layout of the PCB, the BOM file, a photo of the microcontroller with the markings visible (so that he can check the date code) and also an invoice for the PIC that shows the supplier. (required to check the lot code. A photo of the anti-static bag label that the parts came in may also work) and the capacitors used with the SOSC crystal.
@ashimotok0 and @Clint Koehn. PleasegGather up this information and send to me directly via email.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I just looked at the video but it doesn't really show what he did, or did I miss something. It would be nice to have some written down instructions to follow.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Looks like serial through ttl converter and power from pickit and removing pickit stops serial but reconnecting restarts serial.
2 wires to ttl converter..IT gets power via usb
or does it drag all down when pwr removed.
this is guessing.
whatever was shown was consistant.
Last edit: stan cartwright 2018-08-06
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
How many microchip pics have been found to be faulty and who found the fault?
There should be an incentive to report faults.
Can't they help towards pickitplus certification if you have discovered a problem for them?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I did the same thing he did, only when I plugged my power back in, my time was like it was when I unplugged it. So what did he do different? How are his settngs? How can I duplicate what he did?
Last edit: Clint Koehn 2018-08-09
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
OK.. This sort of works with the MicrochipRTCC.h file included. I had to extend some time durations in it. I'll explain what I mean by sort of. I start it, set the time, and let it run a little. Turned off the power for 30 sec. Turned the power back on. It by-passed my startup routine and started counting time again. The clock was right! It worked! But... it looks like it also stores the program pointer and it picks up where the power was removed from. I can live with that. So I shut it off before I went to bed. Turned it on this morning. The chip fired up and displayed a time that was about 2 minutes after I shut it off, and it continued to display that same time every second. The program pointer worked but the clock didn't get re-enabled. This morning I'm working on seeing how long I can leave it off before it quits working. The last I tried was 5 min. It still worked. Here is the code and file I'm using. I also think that it uses Timer0 because I can't seem to get both of them working at the same time.
#chip 16F19176, 16#option Explicit#config BODEN = Off, VBATEN = Off, CLKOUTEN = On, CSWEN = On, FCMEN = On, FEXTOSC = Off, LCDPEN = On, RSTOSC = HFINT1;-----Includelibrary#include<SoftSerial.h>#include<MicroChipRTCC.h>'----------EmulateHSerReceivewithSoftSerialusingInterrupt-------------#startup InitPPS, 85SubInitPPSUNLOCKPPS'Module:EXT_INTINTPPS=0x0008'RB0>INTLOCKPPSEndSub#define LED PORTB.5dirLEDout'===========InterruptHandler3forcommunications===================#define SER1_TXPORT PORTB#define SER1_TXPIN 1#define SER1_RXPORT PORTB#define SER1_RXPIN 0#define SER1_BAUD 9600'SetpindirectionsdirPORTB.1OutdirPORTB.0In#define SOFTWARE_BUFFER1 60dimrxbuf3asstring*SOFTWARE_BUFFER1dimrxflag3asIntegerdimrxbuf3lenasbyterxflag3=0rxbuf3=""INTEDG=0'InterruptonfallingedgeOnInterruptExtInt0CallRxInt3'=====SETUPTHERTCC===============================#define rtcc_TimeDelay 200 'this is in usrtcc_InitializesetLEDonwait2s'alittledelayforthingstostabalize'printsomethingtoterminalSer1Print"+---------------------+"+Chr(13)Ser1Print"| Test RTCC |"+Chr(13)Ser1Print"+---------------------+"+Chr(13)dimscntasWordscnt=0doscnt++'counthundrethsofasecondifscnt>9Thenscnt=0rtcc_ReadTime(tm_hour,tm_min,tm_sec)Ser1Printright("00"+Str(tm_hour),2)+":"Ser1Printright("00"+Str(tm_min),2)+":"Ser1Printright("00"+Str(tm_sec),2)+Chr(13)endif'-------communications----------ifrxflag3=1Then'currentlygoestoterminalrxflag3=0SetLEDOnif(rxbuf3(1)="?")thenrxbuf3len=rxbuf3(0)ifrxbuf3(rxbuf3len)=13ThenSer1Printrxbuf3tm_hour=val(mid(rxbuf3,2,2))tm_min=val(mid(rxbuf3,5,2))tm_sec=val(mid(rxbuf3,8,2))rtcc_SetTime(tm_Hour,tm_Min,tm_Sec)Ser1Print"----< "Ser1Printright("00"+Str(tm_hour),2)+":"Ser1Printright("00"+Str(tm_min),2)+":"Ser1Printright("00"+Str(tm_sec),2)Ser1Print" >-----"+Chr(13)rxbuf3len++rxbuf3=mid(rxbuf3,rxbuf3len)endifElserxflag3=1rxbuf3=mid(rxbuf3,2)endifendifwait100msloopsubRxInt3rxbuf3(0)++ifrxbuf3(0)>SOFTWARE_BUFFER1thenrxbuf3(0)=1endifrxbuf3(rxbuf3(0))=Ser1Receiverxflag3=1setLEDOffEndSub
I cannot seem to use Timer0 with the RTCC. I will try to set it up again a little later to be sure.
Yes, it seems to keep time. The thing that supprised me was that the program counter was also saved, and restarted at the point where the power was turned off. It did not go through my init routine. I didn't see that in the data sheet at all.
Later,
Clint
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am running this off of a breadboard and I think I may need a better setup. My on/off power switch appears to have a bounce and it locks the processor up when I turn the switch on (at least I think that is what is happening). It'll start when I turn it back off then on but then it doesn't read right after that. The setup and program posted above is the closest I've come to making this work.
Later,
Clint
Last edit: Clint Koehn 2018-08-13
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Excerpts from the datasheet for Microchip to consider before withdrawing there excuse and issuing an apology:
Description
They are especially suited for battery-powered LCD applications due to an integrated charge pump, high current I/O drive for backlighting, and battery backup of the Real-Time Clock/Calendar (RTCC).
8.1 VBAT
This device is equipped with a VBAT pin that allows the user to connect an external battery or an external supply. In the event of the VDD supply failing, the power source connected to the VBAT pin will keep the SOSC and RTCC modules running.
8.17 VBAT System
The VBAT subsystem allows the RTCC and SOSC to run from a battery connected to the VBAT pin in the
event of a VDD failure. Typically, the battery is a 3V coin cell, however the system is designed to operate over the entire VDD voltage range. If VDD is greater than VBAT, the RTCC and SOSC will be powered by VDD. If VDD is less than VBAT, the RTCC and SOSC will switch over to VBAT. See Table 4-5 and Table 4-8 for more information on the VBAT registers.
FIGURE 9-1: SIMPLIFIED PIC® MCU CLOCK SOURCE BLOCK DIAGRAM
Secondary Oscillator (SOSC)
Let em have it.....................
Just fired another broadside at them!
News from Microchump Support.
My response.
No response as yet.
Last edit: Anobium 2018-07-14
I really appreciate your efforts chaps. I only just picked up on this as I only work 3 days/week here and consequently missed the latest posts.
Current status
Support tickets with Microchip are #00308634 and #00258560 are still unresolved.
Nagged on 19th July 2018 for progress update.
Summary
Microchip have provided lots of source code, guidance and MPLAB-X projects. However, all efforts have failed to maintain the RTCC operating as expected. Either the clock does not start or the clock does not maintain time when operating with VBAT (essentially SOCS stops operating).
I really appreciate your efforts Evan.
Pleasure. We may be able to sort. Clint has a16f19176 and he is now experiencing similar issues but with more brains looking at the issue we may resolve ourselves.
But, when I nagged today. I was very forceful as we now have three projects with similar RTCC issues.
One more thing to add. On my chip it looks like when you have a battery hooked up (mine is 3 AA which is 4.5v) and disconnect power, it back feeds to the power lines which read around 1.9v. My Timer keeps running blinking my LED though it is very faint. Unplug the battery and everything goes dead.
@Clint. Agree. I have already reported parasitic usage of VBAT.
No news. Time to nag .
Short update. Microchip called to tell me than the engineer assigned has gone on holiday! He will be back soon.
I will nag daily.
News
Nagged. Got a call!! Amazing. New engineer allocated.
Transcript of conversation. This has been added to the case notes.
Susmitha Galla (Microchip)
Thank you for calling in. I’ve just read through your case and have some questions.
Please explain what are your expectations from the PIC. Can you please give me more details regarding your application? Also, what are you trying to do during Vbat operation?
From my understanding you are trying to blink an LED during VBAT usage. What is the frequency you are blinking the LED at?
Me (Evan),
To be sure of no misunderstanding.
TheMPLAB-X project posted by Daniel (of Microchip) stops the RTCC and SOSC when VCC is removed. This is NOT the expected operation.
Serial output (in theMPLAB-X project) is ok. But, when VCC is removed then the RTCC and SOSC should maintain real time not loose time!
If engineering or the product team confirm this cannot be done then I will need confirmation as this will be a real issue for the users.
I am not going to repeat all the issues, as these are well documented in this case notes.
But, to
keep things simple. Using the project attached, created by Daniel. All we need to do initially is to keep the RTCC and SOSC running during main VCC lost therefore we are using VBAT. Currently, the RTCC clock stops.
So, resolve this issue to show how this can be done. Then, we can resolve any other issues.
So, we may get some action soon.
Last edit: Anobium 2018-08-01
News
Another engineer has been allocated. This time he knows his stuff. So, we need to send him information as he thinks he has the solution.
Please send me your circuit schematic, the layout of the PCB, the BOM file, a photo of the microcontroller with the markings visible (so that he can check the date code) and also an invoice for the PIC that shows the supplier. (required to check the lot code. A photo of the anti-static bag label that the parts came in may also work) and the capacitors used with the SOSC crystal.
@ashimotok0 and @Clint Koehn. PleasegGather up this information and send to me directly via email.
Just got this from Microchip.
Demostration of RTCC:
http://microchip.app.box.com/s/fyueqxcv2gn4ghlqlajcg6w6p9bcxyw7/file/309402721017
Last edit: Anobium 2018-08-04
Hi Evan,
I can do that but it will take couple of days as I not back in the office until Wednesday.
Thanks for your efforts ....much appreciated
I just looked at the video but it doesn't really show what he did, or did I miss something. It would be nice to have some written down instructions to follow.
@Clint...et moi
Looks like serial through ttl converter and power from pickit and removing pickit stops serial but reconnecting restarts serial.
2 wires to ttl converter..IT gets power via usb
or does it drag all down when pwr removed.
this is guessing.
whatever was shown was consistant.
Last edit: stan cartwright 2018-08-06
How many microchip pics have been found to be faulty and who found the fault?
There should be an incentive to report faults.
Can't they help towards pickitplus certification if you have discovered a problem for them?
I did the same thing he did, only when I plugged my power back in, my time was like it was when I unplugged it. So what did he do different? How are his settngs? How can I duplicate what he did?
Last edit: Clint Koehn 2018-08-09
OK.. This sort of works with the MicrochipRTCC.h file included. I had to extend some time durations in it. I'll explain what I mean by sort of. I start it, set the time, and let it run a little. Turned off the power for 30 sec. Turned the power back on. It by-passed my startup routine and started counting time again. The clock was right! It worked! But... it looks like it also stores the program pointer and it picks up where the power was removed from. I can live with that. So I shut it off before I went to bed. Turned it on this morning. The chip fired up and displayed a time that was about 2 minutes after I shut it off, and it continued to display that same time every second. The program pointer worked but the clock didn't get re-enabled. This morning I'm working on seeing how long I can leave it off before it quits working. The last I tried was 5 min. It still worked. Here is the code and file I'm using. I also think that it uses Timer0 because I can't seem to get both of them working at the same time.
Later,
Clint
So far I'm up to:
09:39:04 - stopped
10:50:55 - restarted
10:51:45 - stopped
12:51:45 - restarted
Later,
Clint
Last edit: Clint Koehn 2018-08-11
Not sure I am following.
Timer0 is independent of the RTCC surely?
Not sure whether the stop and restart is good. Is it?
I cannot seem to use Timer0 with the RTCC. I will try to set it up again a little later to be sure.
Yes, it seems to keep time. The thing that supprised me was that the program counter was also saved, and restarted at the point where the power was turned off. It did not go through my init routine. I didn't see that in the data sheet at all.
Later,
Clint
OK... here is the latest
12:52:10 - turned off the power
15:59:12 - turned the power back on FAILED should have read 19:22:40
Looks like it worked for a little over 3 hrs. I'm using 3 AAA batteries and the voltage is still at 4v.
I'm going to reset the time and see what happens overnignt.
Later,
Clint
I am running this off of a breadboard and I think I may need a better setup. My on/off power switch appears to have a bounce and it locks the processor up when I turn the switch on (at least I think that is what is happening). It'll start when I turn it back off then on but then it doesn't read right after that. The setup and program posted above is the closest I've come to making this work.
Later,
Clint
Last edit: Clint Koehn 2018-08-13