
i2c_init(DS1337, 1);  // store slave address, gral call
i2c_transmit(DS1337); // transmit slave address
i2c_getstatus();      // get status while(SI);
i2c_transmit(0x0E);   // write to register control address

// after the first transmit "i2c_transmit(DS1337);" I get 
    case 0x08:	// Start condition Xmitted
    case 0x10:	// Repeat Start condition Xmitted
      I2DAT = mslaveaddress;
      STA = 0;
      STO = 0;
	  SI = 0;
      mbytenum = 0;
      break;

// then I get this 

// ACK for slave address + W
    case 0x18: 	// SLA + W Transmitted; Ack has been received
    I2DAT = i2c_master_getbyte(mbytenum);// Data transmitted 
    STA = 0;
    STO = 0;
    break;

// then I get this over & over

case 0x40:// Slave address + R transmitted, Ack received
      STA = 0;
      STO = 0;
      if (i2c_master_islastrxbyte(mbytenum))
      {
        AA = 0;	// return NACK for data byte, two more bytes 
      }
      else
      {
        AA = 1;	 // return ACK for data byte
      } // if
      	  break;

