Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
just for basic ideaWhy pseudo code? Send bits or bytes level?
Mike.
void main ()
{
start();
for ( i = 0; i <5; i++ )
{
}
}
char I2cSendByte(unsigned char data){
SSPBUF=data;
WaitSSP();
return(!SSPCON2bits.ACKSTAT);
}
I got idea from your exampleMike.
Edit, some bitbanged code may help you.
char I2cSendByte(unsigned char data){
for ( i = 0; i <5; i++ )
{
}
if (conition() = A);
return A;
else
return N
}
slave address is 1101 0000 given in datasheet
That's okay but practically Which one would DS1337 accept ?It's 8 bits of data. In pseudo code you can call it whatever you want.
Mike.
Given in datasheetsThe DS1337 doesn't care how you store it on the master end. It just wants a 7 bit address followed by a R/W bit. Note, technically the address is 0x68 not 0xD0 as you show above.
Personally, I'd store it as an unsigned char or uint8_t or byte etc.
Mike.
unsigned char SecondsRegister = 0x00H
unsigned char MinutesRegister = 0x00H
Yes i understand. first post show my understanding to write operation. In this I have shown how to send byte from master to DS1337. I have to store this data in the master first. Only then I can send this data to Slave. I stored the address of Slave and address of seconds register.Do you understand how I2C works as your questions make no sense.
Mike.
Master would send value from 0 to 59 in Register zero.It's a real time clock! Register zero contains the seconds and can only contain values between 0 and 59.
Mike.
for (N=0; N<59; N++)
{
SecondRegister = SecondValue;
}
I give up. Your questions suggest you shouldn't attempt this.
Mike.
No I am not,Sorry jab99407, are you member Gajyamadake in the AAC forum? Pretty much your same style.