{"id":21755103,"url":"https://github.com/ashvnv/8051-digitalclock-rtc","last_synced_at":"2025-06-13T07:36:18.787Z","repository":{"id":184761071,"uuid":"349636552","full_name":"ashvnv/8051-digitalclock-rtc","owner":"ashvnv","description":"24hr digital clock using 8051 and RTC DS1307","archived":false,"fork":false,"pushed_at":"2021-06-03T12:08:01.000Z","size":1013,"stargazers_count":15,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-13T09:09:10.540Z","etag":null,"topics":["8051-projects","digitalclock","ds1307"],"latest_commit_sha":null,"homepage":"","language":"Assembly","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ashvnv.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null},"funding":{"custom":["buymeacoffee.com/ashvnv"]}},"created_at":"2021-03-20T05:30:22.000Z","updated_at":"2024-12-07T09:40:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"660d63db-7942-48a2-9918-936e8c18c80b","html_url":"https://github.com/ashvnv/8051-digitalclock-rtc","commit_stats":null,"previous_names":["ashvnv/8051-digitalclock-rtc"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashvnv%2F8051-digitalclock-rtc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashvnv%2F8051-digitalclock-rtc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashvnv%2F8051-digitalclock-rtc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashvnv%2F8051-digitalclock-rtc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ashvnv","download_url":"https://codeload.github.com/ashvnv/8051-digitalclock-rtc/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248688565,"owners_count":21145766,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["8051-projects","digitalclock","ds1307"],"created_at":"2024-11-26T09:16:38.576Z","updated_at":"2025-04-13T09:09:17.474Z","avatar_url":"https://github.com/ashvnv.png","language":"Assembly","funding_links":["buymeacoffee.com/ashvnv"],"categories":[],"sub_categories":[],"readme":"# 8051-digitalclock-rtc #\n24Hr digital clock using 8051 and RTC DS1307\n\nProgram is written in Assembly Language on Keil uVision 5 and simulation was done on Proteus 8.9 using AT89C51\n\n![proteus-simulation](https://raw.githubusercontent.com/ashvnv/8051-digitalclock-rtc/main/temp/Proteus%20sim.PNG)\n\n\nOperation of the clock in brief:\n\u003eI2C protocol is used for communication between 8051 and DS1307. Initially 8051 enables the 1Hz Clock output on RTC chip. This 1Hz clock is used to interrupt 8051 every second. 8051 does not keep the track of time but instead outsources it to the RTC chip. At each interrupt, 8051 reads the time information present in the RTC chip and updates it's own time registers which is used to show information on the Groove 4 digit 7 segment display. 7447 BCD to 7 segment display is in multiplexing configuration for driving 4 7-seg display simultaneously. Switch bouncing is ignored in the simulation. Use debounce circuit while practically implementing the project.\n\nRTC time can be manually adjusted using the Time Set Mode Switches, Switch A and Switch B\n\n# Setting the time using switches #\n\nSwitches used:\n* set time/next bit -\u003e switch A  *Interrupt switch to 8051*\n* toggle current bit -\u003e switch B  *Used by the program to choose proper interrupt operation*\n\n\n### Important: Switch A is the interrupt switch. Interrupt program determines what operation to do based on the state of switch B. So make switch B on or off according to the requirement before toggling switch A ###\n\n\n# Switch combinations\n\n**To enter the time set mode:**\n* Toggle **switch A on-off** while **switch B is on**\n\n\n**To change current time bit**\n* Toggle **switch A on-off** while **switch B is off**\n\n\n**Go to next bit**\n* Toggle **switch A on-off** while **switch B is on**\n* Previous bit is saved\n\n\n**To come out of set time mode**\n* After setting the last bit **use #go to next bit# switch combination twice** to come out of the time set mode\n\n\n### In Time Set Mode LED is on ###\n![ledon](https://raw.githubusercontent.com/ashvnv/8051-digitalclock-rtc/main/temp/onmode.PNG)\n\n### In Normal Mode LED is off ##\n![ledoff](https://raw.githubusercontent.com/ashvnv/8051-digitalclock-rtc/main/temp/offmode.PNG)\n\n------------------------------------------------------------------------------------------\n# 8051 Registers used:\n* R1 -\u003e ACCUMULATOR BACKUP\n* R2 -\u003e MICRO_DELAY FUNCTION\n* R3 -\u003e TEMPORARY STORAGE IN TIMESETMODE SUBROUTINE\n\n* R4 -\u003e HOURS REGISTER\n    * 0x(MSB)(LSB)\n \n* R5 -\u003e MINUTES REGISTER\n    * 0x(MSB)(LSB)\n\n* R6 -\u003e STORE WHICH TIME SET MODE 8051 IS CURRENTLY OPERATING\n   *     0x00: Normal Mode\n   *     0x01: MSB HOUR SET\n   *     0x02: LSB HOUR SET\n   *     0x03: MSB MINUTES SET\n   *     0x04: LSB MINUTES SET\n\n\n------------------------------------------------------------------------------------------\n# 8051 Subroutine addresses:\n* (150H)SETTIMEMODE -\u003e INT1 CALLS THIS ADDRESS FOR MANUALLY SETTING TIME\n* (260H)DISPLAY -\u003e 8051 DRIVING 7447 BCD TO 7SEG DISPLAY DECODER IN MULTIPLEX MODE\n* (300H)UPDATETIME -\u003e CALL TO UPDATE 8051 INTERNAL TIME REGISTERS R4 AND R5\n* (2F0)MICRO_DELAY -\u003e CALL A SMALL DELAY\n* (400H)RTCTIMEUPDATE -\u003e CALLED WHILE MANUALY UPDATING TIME IN RTC CHIP\n* (510H)RSTART -\u003e I2C RESTART CONDITION\n* (520H)STARTC -\u003e I2C START CONDITION\n* (530H)STOP -\u003e I2C STOP CONDITION\n* (540H)SEND -\u003e I2C SEND DATA\n* (600H)ACK -\u003e I2C ACKNOWLEDGEMENT (M TO S)\n* (610H)NAK -\u003e I2C N-ACKNOWLEDGEMENT (M TO S)\n* (620H)RECV -\u003e I2C RECEIVE DATA\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fashvnv%2F8051-digitalclock-rtc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fashvnv%2F8051-digitalclock-rtc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fashvnv%2F8051-digitalclock-rtc/lists"}