Looking for library or code for M41T00 C (ht-picc)

Status
Not open for further replies.

neuralc

Full Member level 4
Joined
Nov 6, 2001
Messages
236
Helped
9
Reputation
18
Reaction score
3
Trophy points
1,298
Activity points
2,202
M41T00 C code (ht-picc)

Hi all,

Some one have a library/c code for ht-picc to read and write time's and data to the M41T00 RTC ?

ThX

NeuralC
 

Hi all,

Working C code for PIC16F87x (100Khz for XTAL 10Mhz).
Configure:
InitI2C();

Read RTC:
aux_buff[0]=1;
GetI2C(0xD0, 1, 2, aux_buff);
seconds=0;
minutes=BcdToDecimal(aux_buff[0]&0x7f);
hours=BcdToDecimal(aux_buff[1]&0x3f);

Write RTC:
aux_buff[0]=1;
aux_buff[1]=DecimalToBcd(minutes);
aux_buff[2]=DecimalToBcd(hours);
SendI2C(0xD0,3,aux_buff);

NOTE:
RC3 and RC4 should be Outputs.

Hope Helps,

NeuralC
 

I need to write to and read from an external EEPROM ( AT24C512 ) using PIC16F877.
I am having a project, please help.......
I use HI-TECH C COMPILER......
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…