Internal Real Time Clock RTCC PIC8 & PIC16
Moderator: Benj
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Internal Real Time Clock RTCC PIC8 & PIC16
Hello,
I've managed to spend some time investigating the RTCC peripheral on board the PIC 8-bit and 16-bit devices and think I now have it cracked.
Below are a set of files designed to allow you to test out the new functionality.
Simply extract the files into your "Flowcode 7" folder and restart Flowcode to apply the changes.
The updated Real Time Clock (RTC) component is then available from the storage component category.
If you have a go then let us know how you get on.
If all is well then I will add these files to the main updates archive.
I've managed to spend some time investigating the RTCC peripheral on board the PIC 8-bit and 16-bit devices and think I now have it cracked.
Below are a set of files designed to allow you to test out the new functionality.
Simply extract the files into your "Flowcode 7" folder and restart Flowcode to apply the changes.
The updated Real Time Clock (RTC) component is then available from the storage component category.
If you have a go then let us know how you get on.
If all is well then I will add these files to the main updates archive.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
- QMESAR
- Valued Contributor
- Posts: 1287
- Joined: Sun Oct 05, 2014 3:20 pm
- Location: Russia
- Has thanked: 384 times
- Been thanked: 614 times
- Contact:
Re: Internal Real Time Clock RTCC PIC8 & PIC16
Thank you very much Ben highly apprecaited
https://www.flowcodexchange.com/
Regards QMESAR
Regards QMESAR
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Internal Real Time Clock RTCC PIC8 & PIC16
Currently no alarm support, let me know if this is a requirement for anyone and what you would need the alarm to be able to do.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 190
- Joined: Mon Jul 07, 2014 9:38 am
- Has thanked: 30 times
- Been thanked: 77 times
- Contact:
Re: Internal Real Time Clock RTCC PIC8 & PIC16
The Alarms would be useful.
I intend to use DSPIC33FJ64GP802 or DSPIC33FJ128GP802. They have inside RTCC and Alarms.
https://eu.mouser.com/search/ProductDet ... 64GP802ISP
https://eu.mouser.com/search/ProductDet ... 28GP802ISP
Microchip info about RTCC for dsPIC33F/PIC24H Family:
http://ww1.microchip.com/downloads/en/D ... 70301C.pdf
http://ww1.microchip.com/downloads/en/D ... 05193a.pdf
The Alarm macro when is called, it should provide a test bit true if the alarms take/took place and false before that time – that for simple test in a loop. And additional to that it would be useful to provide an interrupt, which would not require any loop for test. In the interrupt macro the user cam then write his code. That is described in the above pdf files. The alarm is also mentioned to be “ONE-SHORT ALARM” and with “CHIME DISABLE/ENABLE”:
Is it any “RTCC CALIBRATION” implemented in the RTCC component?
I intend to use DSPIC33FJ64GP802 or DSPIC33FJ128GP802. They have inside RTCC and Alarms.
https://eu.mouser.com/search/ProductDet ... 64GP802ISP
https://eu.mouser.com/search/ProductDet ... 28GP802ISP
Microchip info about RTCC for dsPIC33F/PIC24H Family:
http://ww1.microchip.com/downloads/en/D ... 70301C.pdf
http://ww1.microchip.com/downloads/en/D ... 05193a.pdf
The Alarm macro when is called, it should provide a test bit true if the alarms take/took place and false before that time – that for simple test in a loop. And additional to that it would be useful to provide an interrupt, which would not require any loop for test. In the interrupt macro the user cam then write his code. That is described in the above pdf files. The alarm is also mentioned to be “ONE-SHORT ALARM” and with “CHIME DISABLE/ENABLE”:
Is it any “RTCC CALIBRATION” implemented in the RTCC component?
-
- Posts: 190
- Joined: Mon Jul 07, 2014 9:38 am
- Has thanked: 30 times
- Been thanked: 77 times
- Contact:
Re: Internal Real Time Clock RTCC PIC8 & PIC16
Does anyone tried the RTC component and it works?
If yes, then with what MCU? Do you have a test program?
I have tried RTC with dsPIC33FJ128GP802 and for me it does not work. I opened up a question here:
viewtopic.php?f=7&t=19621
If yes, then with what MCU? Do you have a test program?
I have tried RTC with dsPIC33FJ128GP802 and for me it does not work. I opened up a question here:
viewtopic.php?f=7&t=19621
-
- Posts: 190
- Joined: Mon Jul 07, 2014 9:38 am
- Has thanked: 30 times
- Been thanked: 77 times
- Contact:
Re: Internal Real Time Clock RTCC PIC8 & PIC16
Would be possible to share the source code of the RTC, so we can start debug it, because it seems it has errors, I think in initialization, in some cases as dsPIC33FJ128GP802 for example?
If not, can you debug it or try to find out what other settings, C code must be added to the existing component to make it run properly with dsPIC33FJ128GP802 for example?
If not, can you debug it or try to find out what other settings, C code must be added to the existing component to make it run properly with dsPIC33FJ128GP802 for example?
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Internal Real Time Clock RTCC PIC8 & PIC16
Hi Viki,
I've sent you a PM with the component source so you can have a look. Could it be a chip configuration issue?
I've sent you a PM with the component source so you can have a look. Could it be a chip configuration issue?
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Valued Contributor
- Posts: 654
- Joined: Fri Aug 19, 2016 2:09 pm
- Location: switzerland
- Has thanked: 182 times
- Been thanked: 179 times
- Contact:
Re: Internal Real Time Clock RTCC PIC8 & PIC16
Hi Ben
I have a Pic32MZ2048 with a internal RTCC. But if I use component RTC from FC7.3, I can only choose DS1307 or DS3231.
How can I choose the internal RTCC from the PIC?
I have a Pic32MZ2048 with a internal RTCC. But if I use component RTC from FC7.3, I can only choose DS1307 or DS3231.
How can I choose the internal RTCC from the PIC?
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Internal Real Time Clock RTCC PIC8 & PIC16
Hi Stefan,
What's the rest of the PIC32 part number so I can look at the specific definition file?
Pic32MZ2048...... Matches with 24 devices.
What's the rest of the PIC32 part number so I can look at the specific definition file?
Pic32MZ2048...... Matches with 24 devices.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Valued Contributor
- Posts: 654
- Joined: Fri Aug 19, 2016 2:09 pm
- Location: switzerland
- Has thanked: 182 times
- Been thanked: 179 times
- Contact:
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Internal Real Time Clock RTCC PIC8 & PIC16
Hello,
I have added the RTCC definition to the FCDX file and hopefully that is all that's required.
Simply copy the attached file to your "Flowcode 7/FCD/PIC32" folder and restart Flowcode and the Internal option should then be available for you.
Let us know how you get on.
I have added the RTCC definition to the FCDX file and hopefully that is all that's required.
Simply copy the attached file to your "Flowcode 7/FCD/PIC32" folder and restart Flowcode and the Internal option should then be available for you.
Let us know how you get on.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Valued Contributor
- Posts: 654
- Joined: Fri Aug 19, 2016 2:09 pm
- Location: switzerland
- Has thanked: 182 times
- Been thanked: 179 times
- Contact:
Re: Internal Real Time Clock RTCC PIC8 & PIC16
Hi Ben
Now I can choose the internal RTCC.
But I can only choose the external osci on the componet properties.
Even if the external clock for the RTCC is selected I think the internal osci is connected.
good that I need the internal osci anyway.
It's working nice.
Now I can choose the internal RTCC.
But I can only choose the external osci on the componet properties.
Even if the external clock for the RTCC is selected I think the internal osci is connected.
good that I need the internal osci anyway.
It's working nice.
-
- Valued Contributor
- Posts: 654
- Joined: Fri Aug 19, 2016 2:09 pm
- Location: switzerland
- Has thanked: 182 times
- Been thanked: 179 times
- Contact:
Re: Internal Real Time Clock RTCC PIC8 & PIC16
Hi Ben
The component RTC from FC7 is a very nice way to use a timer, alarm and RAM (buffered with a battery)
It's support the very accurate time chip DS3231 and the "old" DS1307 with a RAM.
Is it possible soon to include the Chip DS3232 that has both, very accurate time and RAM?
The component RTC from FC7 is a very nice way to use a timer, alarm and RAM (buffered with a battery)
It's support the very accurate time chip DS3231 and the "old" DS1307 with a RAM.
Is it possible soon to include the Chip DS3232 that has both, very accurate time and RAM?
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Internal Real Time Clock RTCC PIC8 & PIC16
Hello,
I've now added the option to allow you to switch between external and internal clock sources. You were right that it showed the external clock but actually used the internal clock.
If you want to try the latest for me then please follow the steps below.
The attached file needs to be placed into the "Flowcode 7/CAL/PIC32" folder. Then these updated definition files must be extracted to the "Flowcode 7/FCD/PIC32" folder before restarting Flowcode. I'll add the DS3232 to the list, should be fairly simple to add when we next get some free time.
I've now added the option to allow you to switch between external and internal clock sources. You were right that it showed the external clock but actually used the internal clock.
If you want to try the latest for me then please follow the steps below.
The attached file needs to be placed into the "Flowcode 7/CAL/PIC32" folder. Then these updated definition files must be extracted to the "Flowcode 7/FCD/PIC32" folder before restarting Flowcode. I'll add the DS3232 to the list, should be fairly simple to add when we next get some free time.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Valued Contributor
- Posts: 654
- Joined: Fri Aug 19, 2016 2:09 pm
- Location: switzerland
- Has thanked: 182 times
- Been thanked: 179 times
- Contact:
Re: Internal Real Time Clock RTCC PIC8 & PIC16
Hi Ben
Thank for all the infos.
I tried and it's working to switch to the extern OSCI.
But it's not alway starting the OSCI
The quarz is like on picture Q1 connected
to Pin C13 and C14.
I tried all gain and kickstart of the SOSC but still not stable.
Next week I will trie on an another board with a Pic and a different way to connect the OSCI
Thank for all the infos.
I tried and it's working to switch to the extern OSCI.
But it's not alway starting the OSCI
The quarz is like on picture Q1 connected
to Pin C13 and C14.
I tried all gain and kickstart of the SOSC but still not stable.
Next week I will trie on an another board with a Pic and a different way to connect the OSCI
-
- Valued Contributor
- Posts: 654
- Joined: Fri Aug 19, 2016 2:09 pm
- Location: switzerland
- Has thanked: 182 times
- Been thanked: 179 times
- Contact:
Re: Internal Real Time Clock RTCC PIC8 & PIC16
Hi Ben
The DS3232 is working with the DS3231 componet except the RAM.
Is it possible to have it soon for FC8?
It helps me to save a few configurations bytes
The DS3232 is working with the DS3231 componet except the RAM.
Is it possible to have it soon for FC8?
It helps me to save a few configurations bytes
I'll add the DS3232 to the list, should be fairly simple to add when we next get some free time.
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Internal Real Time Clock RTCC PIC8 & PIC16
Hello,
Thanks for reminding me
I've pushed a v8 update now with a mod to the RTC component for the DS3232.
Let me know how you get on.
Thanks for reminding me
I've pushed a v8 update now with a mod to the RTC component for the DS3232.
Let me know how you get on.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Valued Contributor
- Posts: 654
- Joined: Fri Aug 19, 2016 2:09 pm
- Location: switzerland
- Has thanked: 182 times
- Been thanked: 179 times
- Contact:
Re: Internal Real Time Clock RTCC PIC8 & PIC16
Hi Ben
Thank you for the help.
Set and get of time of the DS3232 is working still fine.
Set and get of RAM is not working. It's not freezing but if I set the Ram-addres 1 to value 65, I always read an 0.
Also the number ram of 55 is not like in the data sheet ...
But 55 would be enough....
♦ 236 Bytes of Battery-Backed SRAM
Thank you for the help.
Set and get of time of the DS3232 is working still fine.
Set and get of RAM is not working. It's not freezing but if I set the Ram-addres 1 to value 65, I always read an 0.
Also the number ram of 55 is not like in the data sheet ...
But 55 would be enough....
♦ 236 Bytes of Battery-Backed SRAM
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Internal Real Time Clock RTCC PIC8 & PIC16
Hi Stefan,
Many thanks for letting me know. I've fixed the tool tips so they now correct show the right address range and also found and also hopefully fixed the bug stopping the RAM from being accessed.
Let us know how you get on.
Many thanks for letting me know. I've fixed the tool tips so they now correct show the right address range and also found and also hopefully fixed the bug stopping the RAM from being accessed.
Let us know how you get on.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Valued Contributor
- Posts: 654
- Joined: Fri Aug 19, 2016 2:09 pm
- Location: switzerland
- Has thanked: 182 times
- Been thanked: 179 times
- Contact:
Re: Internal Real Time Clock RTCC PIC8 & PIC16
Hi Ben
Thank you Ben. It's perfect now.
something to smile
How to set the time if there is no keyboard or comunication or for the prototype.....
If both (string) format are the same then it would be even easier
Thank you Ben. It's perfect now.
something to smile
How to set the time if there is no keyboard or comunication or for the prototype.....
If both (string) format are the same then it would be even easier
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: Internal Real Time Clock RTCC PIC8 & PIC16
If you're interested, I used to set time and date via PC (from the PC clock time) and UART to USB converter.stefan.erni wrote:How to set the time if there is no keyboard or comunication or for the prototype.....
I also created an Android mobile app which can set the time and date of RTC to the time on the phone via Bluetooth.
I could help you with that.
Martin
-
- Valued Contributor
- Posts: 654
- Joined: Fri Aug 19, 2016 2:09 pm
- Location: switzerland
- Has thanked: 182 times
- Been thanked: 179 times
- Contact:
Re: Internal Real Time Clock RTCC PIC8 & PIC16
Thank you Martin for the help
Unfortunately, I have no uart or bluetooth available on this board. What I have is the ESP8266 wifi module. To creat a wifi and accessing it from an Internet explorer works fine. somehow I will transmit the time this way.
regards
Stefan
Unfortunately, I have no uart or bluetooth available on this board. What I have is the ESP8266 wifi module. To creat a wifi and accessing it from an Internet explorer works fine. somehow I will transmit the time this way.
regards
Stefan
- AbhijitR
- Posts: 300
- Joined: Fri Nov 07, 2014 12:48 pm
- Location: Pune, India
- Has thanked: 283 times
- Been thanked: 80 times
- Contact:
Re: Internal Real Time Clock RTCC PIC8 & PIC16
Hello! Martinmedelec35 wrote:If you're interested, I used to set time and date via PC (from the PC clock time) and UART to USB converter.stefan.erni wrote:How to set the time if there is no keyboard or comunication or for the prototype.....
I also created an Android mobile app which can set the time and date of RTC to the time on the phone via Bluetooth.
I could help you with that.
I was trying to search something relevant to your post, is it possible in FC8 to use some function so that the actual date and time from the computer will be transferred or programmed while compelling the flow chart, more or less like programming the "Programmable Relay" like ZELIO or LOGO manufactured by Schneider or Siemens.
Thank you.
Regards
Abhi
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Internal Real Time Clock RTCC PIC8 & PIC16
Hello Abhi,
Here is the Wiki page on the component.
https://www.matrixtsl.com/wiki/index.ph ... 91fb19f63f
The "Auto Version Identifier" component available from the Storage component category (now Data -> Storage) will do this for you.is it possible in FC8 to use some function so that the actual date and time from the computer will be transferred or programmed while compelling the flow chart
Here is the Wiki page on the component.
https://www.matrixtsl.com/wiki/index.ph ... 91fb19f63f
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
- AbhijitR
- Posts: 300
- Joined: Fri Nov 07, 2014 12:48 pm
- Location: Pune, India
- Has thanked: 283 times
- Been thanked: 80 times
- Contact:
Re: Internal Real Time Clock RTCC PIC8 & PIC16
Hello! Ben
Good morning
Many thanks for the reply, I will try that out today and keep you posted.
Regards
Abhi
Good morning
Many thanks for the reply, I will try that out today and keep you posted.
Regards
Abhi