You are here

CY8CKIT-044 PSoC 4200M Real-Time Clock | Cypress Semiconductor

CY8CKIT-044 PSoC 4200M Real-Time Clock

[re-printed from iotexpert.com]

In my article entitled “FreeRTOS FAT SL – Musing on my Implementation“, I lamented that I was supposed to implement a Real Time Clock so that the reads and writes of files could be timestamped, but didnt.  I knew that the PSoC4200M Real Time Clock is actually really easy to use.  But, I didn’t because I didn’t want to fix the command line interface that I was using.  In this article I will show you how to implement a PSoC4200M Real Time Clock in FreeRTOS.  Then in the next article Ill show you how to implement the FreeRTOS Command Line Interface to set the time and turn on the FreeRTOS FAT SL Clock Driver.

PSoC4200M Real Time Clock Schematic

The first thing to do is copy the FreeRTOS Template project.  Then add the UART and RTC components to the project schematic from the PSoC Creator Component Catalog.

PSoC 4200M Real Time Clock Schematic

The PSoC4200M Real Time Clock will have the default settings for the component.

PSoC 4200M Real Time Clock Configuration

To make an accurate clock, I want to turn on the Watch Crystal Oscillator which drives the Watch Dog Timers.  To do this, click on the “Clocks” tab of the Design Wide Resources.  Then press edit clock.

PSoC 4200M Real Time Clock Configuration DWR

Once you are on the clock editor page, turn on the WCO (by pressing the checkmark in the upper left hand corner).  Then turn on the WDT Timer 0 in the Periodic Timer Mode.  Set the divider to 32768 so that the RTC will get 1 interrupt per second.  You also need to select the source of the RTC to be Timer 0.

PSoC 4200M Real Time Clock Low Frequency Clock Configuration

Firmware

In the firmware I create a new task called “uartTask” which just starts the RTC, then prints out the time when the user presses ‘t’.  Obviously I didnt set the clock, so it starts from 12:00:00.  Ill fix that in the next post after I get the FreeRTOS Command Line Interpreter working.

void uartTask(void *arg)
{
    (void)arg;
    UART_Start();
    clearScreen();
    UART_UartPutString("Start Real Time Clock Demo\n");
    UART_SetCustomInterruptHandler(uartISR);
    uint32 timeBCD;
    char buff[32];
    
    RTC_Start();
    
    while(1)
    {
        ulTaskNotifyTake(pdTRUE,portMAX_DELAY);
        
        while(UART_SpiUartGetRxBufferSize()) // if there is data then read and process
        {
            char c;
            
            c= UART_UartGetChar();
            switch(c)
            {
                case 't':
                    
                    timeBCD = RTC_GetTime();
                    sprintf(buff,"%d:%d:%d\n",(int)RTC_GetHours(timeBCD),(int)RTC_GetMinutes(timeBCD),(int)RTC_GetSecond(timeBCD));
                    UART_UartPutString(buff);
                    
                break;

You can find this project called RTC-Example in the workspace PSoC-Filesystem on the IoT Expert GitHub site or git@github.com:iotexpert/PSoC-FileSystem.git

 

Blog: 

Comments

jessicaober_3067061's picture

I really like these types of posts which are written in simple writing so that everyone can understand it, and everyone can understand what message does author wants to convey. The style of your is very unique but easy to understand what you want to say in this discussion. Feel free to visit top custom essay writing service for any king of essay writing. Thanks a lot for sharing.

bocikokire_3089496's picture

The DS1307 constant clock RTC IC is a 8 stick gadget utilizing an I2C interface. The DS1307 is a low-control clock/schedule with 56 bytes of battery reinforcement SRAM. The clock/schedule gives seconds, minutes, hours, day, date, month and year qualified information. essay writers world

jordanyoung192_3098461's picture

This is an amazing framework of time and I really appreciate you for making this. It will be very vital for people. There are some more things you can add in this but I hope you will add them soon. Custom Dissertation Help

download freemusicsit's picture

The best thing about free mp3 skull music downloader free is that you are getting the music for free. If you have some select songs from a music CD.http://www.downloadfreemusicsit.com/skull-music-downloader-free/

 

download freemusicsit's picture

You know how sometimes nothing is more romantic and relaxing than listen Romantic Era music together with your loved one. http://www.downloadfreemusicsit.com/romantic-era-music/

 

JWeaver's picture

Mark, thanks for the article.  Its a shame about these spam comments...

Anna Howze's picture

I think this is an informative post and it is very useful and knowledgeable. I really enjoyed reading this post. big fan, thank you! router login

fayebdaniel_3152456's picture

After last year's major mix-up, which resulted in the wrong film being called for Best Picture Award, fans probably wondered who would be up for the challenge of being the host of the 2018 Oscars. That said, it seems that the Academy didn't have to l…

praveenpolishetty10_3134711's picture

gmail email login
gmail mail
gmail sign in new account
gmail..com
www,gmail.com
gamil log in

 Ill fix that in the next post after I get the FreeRTOS Command Line Interpreter working.

Arsh Sran's picture

DOWNLOAD YOWHATSAPP & SMS BOMBER FOR ANDROID !

vinnuchinnu.1105_3168896's picture

The Tamilnadu Board of Secondary Education will be releasing the TN SSLC Result 2018 this May Month on its official organizational portal page wwW tnresults nic in and Most of the students searching on the internet to know their marks, here we provide all the details about  SSLC Result 2018 Tamilnadu and all the details.

 

www.tnresults.nic.in

barnettdonald6_3171476's picture

Aug 2, 2016 - NEW DELHI: The SBI Clerk Mains Results 2018 are likely to be declared by the State Bank of India in the first week of August on its official website: sbi.co.in The candidates, who.

https://sbiclerkresult2018.in/
https://sbiclerkresult2018.in/sbi-clerk-exam-result/

lioneljohn247_3164626's picture

I have got a lot of useful details regarding the PSOC elements and its applications from your site. You guys have been doing a really commendable job by sharing all these useful details with us. Thanks for the share and keep sharing more of these.    chrome constantly crashing    

islamaria.660_3211676's picture

From your post, I came to know about the real time clock schematic. Since it is explained with a pictorial representation, the concept is clear to all. Thank you for this valuable piece of information. Expecting more useful blogs like this. clipping path company

abhishekkumar512484_3214881's picture

I am inspired after seeing and reading his historical it, and looking forward to grow by following it honestly. You would love to read our article psn live chat Additionally, you may have look  video compression software 

abhishekkumar0984_3227291's picture

Nice Post. I strongly agree with your last point you I really appreciate your hard work would love to read Freedom APK & Nova launcher prime apk

r3646416_2927806's picture

The detailed instructions along with the image helped to understand the CY8CKIT-044 PSOC 4200M REAL-TIME CLOCK. The codes offered through the blogs had helped in making the project all by me. The site has been providing a lot of such interesting topics regarding PSOC 6 Software Enablement.  van gogh museum tour

everettbesyuchsymp_3248451's picture

Iceland on TV Listings: TV schedule, Live Stream & Kick Off Time for Iceland's next Russia 2018 World Cup game and all of their live football fixtures on TV including Sky Sports and BT Sport.

aadhaarashok90_3251026's picture

Very useful information and Best Articles In CYpress.

Yowhatsapp 

joyaljhon321_3311776's picture

Download GBWhatsApp APK for Android. Finish Info on GBWhatsApp 6.25 is here. View GB WhatsApp highlights, authorizations and Steps to Install GBWhatsApp in addition to. visit here

helensyrmor_3311871's picture

Thanks for this beautiful post. Check out NFL Draft 2018 Live Here.

ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.