Hello sir,
I have changed some code!
actually i am once writing the time in micro. after that i am removing/re programming the micro by deleting the write function.
so, it run internally the ds1307 chip...
it is working is it fine procedure to run ds1307??
Hello,
The Clock is running internaly i have set the time one and removed the write function for making update from outter switch!
i have place the up and down switch with pull ups at RD4-5 . but it is not responding here is if code parrts
C:
if(RD4==0|| RD5==0){
//Time[] = {0x05, 0x30 ,0x08, 0x22 , 0x10, 0x4, 0x15};
if(RD4==0) // UP MIN HOUR
{
up_min= up_min+1;
up_hour=up_hour+1;
Time[1]=up_min;
Time[2]=up_hour;
WriteClock(&Time[0]);
}
if(RD5==0) // UP MIN HOUR
{
up_min= up_min-1;
up_hour=up_hour-1;
Time[1]=up_min;
WriteClock(&Time[0]);
Time[2]=up_hour;
}
}
void WriteClock(char *array) // Not used
{
char x;
int tmp;
for(x=0;x<7;x++)
{
tmp = array[x] / 10;
tmp << = 4;
tmp += array[x] % 16;
WriteRTC(x,tmp);
}
}
This function takes care of writing to the RTC... The array is pointing to the Time[] array.. Whatever is in that array will be written to the RTC... The function also takes care of the BIN / BCD conversion, so you don't need to!!