Digital Clock using PIC microcontroller and ds1307

Home Forums Project Discussions Digital Clock using PIC microcontroller and ds1307

This topic contains 7 replies, has 2 voices, and was last updated by  Ligo George 1 year, 5 months ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #11561

    Dmitry
    Participant

    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?

    #11563

    Ligo George
    Keymaster

    I 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.

    #11566

    Dmitry
    Participant

    Yes, 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

    Attachments:
    You must be logged in to view attached files.
    #11568

    Ligo George
    Keymaster

    It should work without any problems.

    Actually what are the problems that you are facing now ?

    #11570

    Dmitry
    Participant

    It 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?

    #11572

    Ligo George
    Keymaster

    I can’t find any problems in the program.

    #11629

    Dmitry
    Participant

    I 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?

    #11634

    Ligo George
    Keymaster

    You need to change reading hour and setting hour part of my code also.

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.