bianchi77
Advanced Member level 4
- Joined
- Jun 11, 2009
- Messages
- 1,313
- Helped
- 21
- Reputation
- 44
- Reaction score
- 20
- Trophy points
- 1,318
- Location
- California
- Activity points
- 9,442
Guys,
Does anyone of you have experience on wrting into DS1307 ?
Here's my issue,
Any ideas will be very appreciated,
Thanks in advance
I did :
but when :
it gave me a complain :
I supposed to be able on writing it directly,
The function ,
it works allright when I do :
Perhaps I need to convert :
but I defined it already
Do you guys have any clues ?
Thanks in advance....
Have a good day
Does anyone of you have experience on wrting into DS1307 ?
Here's my issue,
Any ideas will be very appreciated,
Thanks in advance
I did :
Code:
weekday_increase = ds1307_addr[3] +1;
but when :
Code:
i2c_write(weekday_increase);
it gave me a complain :
Code:
Error 142 conflicting types for 'i2c_write' C:\Users\Antonius\Documents\Atmel Studio\6.1\Clock_DS1307_V1_0\Clock_DS1307_V1_0\Clock_DS1307_V2_0.c 777 6 Clock_DS1307_V1_0
I supposed to be able on writing it directly,
The function ,
Code:
char i2c_write(char data)
{
unsigned char twi_status;
char r_val = -1;
// Send the Data to I2C Bus
TWDR = data;
// Transmit I2C Data
twi_status=i2c_transmit(I2C_DATA);
// Check the TWSR status
if (twi_status != TW_MT_DATA_ACK) goto i2c_quit;
r_val=0;
i2c_quit:
return r_val;
}
it works allright when I do :
Code:
ds1307_addr[0] = 0x00;
i2c_write(ds1307_addr[0]);//second
Perhaps I need to convert :
Code:
weekday_increase = ds1307_addr[3] +1;
Code:
char weekday_increase;
Do you guys have any clues ?
Thanks in advance....
Have a good day