Home › Forums › Project Discussions › Digital Clock using PIC microcontroller and ds1307
Tagged: 16F877, Digital Clock, DS1307, PIC
- This topic has 7 replies, 2 voices, and was last updated 7 years, 7 months ago by Ligo George.
-
AuthorPosts
-
July 5, 2015 at 7:06 pm #11561DmitryParticipant
I try to change PIC16F877. I need use PIC16F887, but i can’t get properly data of time/date. Although for PIC16F877 everything fine. What i need to do to use PIC16F887 microcontroller?
July 5, 2015 at 10:50 pm #11563Ligo GeorgeKeymasterI guess that you are referring to my article, Digital Clock using PIC Microcontroller.
As that project using MikroC compiler, it should work without any changes in the program. But you should change the microcontroller in the MikroC project setting and REBUILD the project.
July 5, 2015 at 11:16 pm #11566DmitryParticipantYes, i mean that article. I changed microcontroller in the MikroC project, also i changed //CMCON = 0x07; // To turn off comparators for PIC16F877
and insert C1ON_bit = 0; C2ON_bit = 0; // Disable comparators for PIC16F887 and ANSEL = 0x04; ANSELH = 0; // Configure AN pins as digital I/O for PIC16F887. But nothing. Could you have a look at my code
July 6, 2015 at 6:57 am #11568Ligo GeorgeKeymasterIt should work without any problems.
Actually what are the problems that you are facing now ?
July 6, 2015 at 7:39 pm #11570DmitryParticipantIt works without problems for PIC16F877A, but when i changed controller to PIC16F887 i get an error “Undeclared identifier CMON in expression”. Because PIC16F887 has no CMON register to turn off comparators. I inserted C1on.bit=0 and C2on_bit=0 to disable comparators for PIC16F887, but nothing. I still get not proper date/time on LCD. Do you have any idea?
July 7, 2015 at 10:03 am #11572Ligo GeorgeKeymasterI can’t find any problems in the program.
July 30, 2015 at 1:15 pm #11629DmitryParticipantI need use 24-hour mode for digital clock. But i can’t change code properly.From datasheet for DS1307 to select 24-hour mode i need set bit 6 to low. But nothing. How i can set bit 6 of timekeeper register to low or make other changes?
August 6, 2015 at 9:42 am #11634Ligo GeorgeKeymasterYou need to change reading hour and setting hour part of my code also.
-
AuthorPosts
- You must be logged in to reply to this topic.