Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

DS1307 and PIC16F877A using MPLAB High Tech C Problem..

Status
Not open for further replies.

jeyes56

Member
Hi all,

i would like to use the DS1307 as my RTC for my MCU,(PIC16F877A).
But it seems that i don't understand how to Configure and Read the DS1307.

I've found its datasheet, but i don't understand it either..
Here the Datasheet

Please help me on this..
 
Everyone uses this clock... In My tutorial 6 (derived from Nigel Goodwin's tutorials) you will find the I2C routines...
Just remember that all RTC's use packed BCD... ie..

Internal address 1 contains seconds and the on/off flag " 1 111 1111 " bit 7 = on/off.. bits 6,5,4 = tens (0 - 5) ans bits 3,2,1,0 are units.

Most of the 7 internal registers are setup this way
2 = minutes "x 111 1111" (bit 7 not used ) tens, units
3 = hours "x 11 1 1111" (bit 7 not used ) am/pm or 24 hour , ten, units
etc.. etc..
 
Hi, tnx for your reply..

i am using MPLAB v8.50, it seems that i cant find an I2C routine there,, is there any module on MPLAB?

can you please give me example code that stores hours, min, day, month on there variables?

thank you in advance..
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top