Microcontroller › PIC › Reg-RTC
- This topic has 11 replies, 2 voices, and was last updated 9 years ago by Prabakaran P M.
Viewing 12 posts - 1 through 12 (of 12 total)
-
AuthorPosts
-
August 20, 2015 at 5:23 am #3913karthick.vParticipant
Hai buddy,
I can able to program in i2c but i can able to read and write in RTC,what are all procedures to program rtc and how to program.
August 20, 2015 at 12:06 pm #13188Prabakaran P MParticipantHi Karthick
what microcontroller have you choosed to read the RTC register.
August 21, 2015 at 6:22 am #13190karthick.vParticipantHai Prabha,
Iam working in pic16f877a
August 21, 2015 at 7:36 am #13191Prabakaran P MParticipantHi karthick
I'm not sure about what compiler you are using, my suggestion for you is to use MikroC for pic google it you can find sample code to read RTC register. It is a free software with 2KB of Code limitation.
August 21, 2015 at 9:38 am #13192karthick.vParticipanthai duddy,The following is the rtc program i have an doubt in this program that why we are giving for hours sendi2c(0x02);//////for minutes sendi2c(0x01);////for seconds sendi2c(0x00);//////date sendi2c(0x04);/////month sendi2c(0x05);//////year sendi2c(0x07);///////// RTC Interface with PIC 16F877A:#include<pic.h>void portconfig();void sendi2c(char x);char receivei2c();void start();void stop();void rpstart();void delay();void lcd_cmd();void cmd(char , char );//void lcd_data(char);char arr[ ]="TIME : : : .";char arr1[ ]="DATE : – – . ";void lcd_con(int );void time();void date();int conv(int i);void rtc_write();void rtc_read();int h,y;void main(){int h,y,D2;portconfig();ADCON1=0X07;lcd_cmd();SSPCON=0X38;SSPCON2=0X00;SSPSTAT=0X80;SSPADD=9;cmd(0X80,0);for(h=0;arr[h]!='