EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise
You are here: Home / Topics / how to set time and date in rtc ds12c887

how to set time and date in rtc ds12c887

|

Microcontroller › 8051 › how to set time and date in rtc ds12c887

  • This topic has 3 replies, 2 voices, and was last updated 11 years, 4 months ago by AJISH ALFRED.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • January 3, 2014 at 1:43 pm #2795
    chaitali
    Participant

    I am making a digital calender using ds12c887 and at89c52. I can read the time from rtc properly. But i cannot write to rtc RAM.

     

    code fragment i am using for writing is as follows:

     

    void rtc_set()
    {
        delay_ms(20);   // it provide 20ms delay
        PBYTE[0x0a]=0x20;    //make oscilator on
        PBYTE[0x0b]=0x83;   // disable updates
        PBYTE[0x04]=0x16;   //set hours
        PBYTE[0x02]=0x58;   //set mins
        PBYTE[0x00]=0x55;   // set secs
        PBYTE[0x07]=0x19;   //set date
        PBYTE[0x08]=0x10;   //set month
        PBYTE[0x09]=0x04;   //set year
        PBYTE[0x0b]=0x03;   //enable updates
    }

     

     

    Plz help me to find the problem in my code.

     

    January 4, 2014 at 6:57 pm #10823
    AJISH ALFRED
    Participant

    Hi,

    Which microcontroller?

    This is not the function which actually do write something to thr RTC !

    January 5, 2014 at 4:53 am #10826
    chaitali
    Participant

    microcontroller is atmel 89c52.

     

    hey , then plz tell me the function which will write to RTC.

    Plz.. Plz…..

    January 14, 2014 at 8:26 am #10843
    AJISH ALFRED
    Participant

    Hi Chaitali,

    Sorry for the late response. The entire code is with you only, so there must be a function in your code which sends data and receives data from the serial pins of the microcontroller and hence does the writing to the RTC.

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.
Log In

RSS Recent Posts

  • Behringer MX 1602 mixer - reading block diagram May 23, 2025
  • STM32 checking self-written delay function May 23, 2025
  • Reclaiming missing motherboard header May 23, 2025
  • 12v battery, 18v magic May 23, 2025
  • Actin group needed for effective PCB software tutorials May 23, 2025

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2025 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise