Ok,
The chips are working but my outputs are erronous. I just want to record time, store it, and then replay it. I am getting all kinds of numbers on the LCD.
here is my latest code:
Code:
'/////////////////////////
'// DS1337 and test program
'//	Using the PIC16F887
'//           From Dave Mackarit     FUNCTIONAL
'/////////////////////////

'/////////////////////////
'// Define section //
'/////////////////////////

'@ __config _CONFIG1, _INTRC_OSC_NOCLKOUT & _WDT_ON & _MCLRE_OFF & _LVP_OFF & _CP_OFF
OSCCON = %01110000 '8 Mhz
DEFINE OSC 8
ANSELH = 0


'/////////////////////////
'// LCD configuration //
'/////////////////////////

DEFINE LCD_DREG PORTB 	' Set LCD Data port
DEFINE LCD_DBIT 4 		' Set starting Data bit (0 or 4) if 4-bit bus  RB.4, RB.5, RB.6, RB.7
DEFINE LCD_RSREG PORTB 	' Set LCD Register Select port
DEFINE LCD_RSBIT 1 		' Set LCD Register Select bit
DEFINE LCD_EREG PORTB	' Set LCD Enable port
DEFINE LCD_EBIT 0 		' Set LCD Enable bit
DEFINE LCD_BITS 4 		' Set LCD bus size (4 or 8 bits) '4 therefore put wire at 4, 5, 6 and 7 of LCD
DEFINE LCD_LINES 2 		' Set number of lines on LCD
DEFINE LCD_COMMANDUS 2500
DEFINE LCD_DATAUS 250
DEFINE CHAR_PACING 2000
pause 1000

              DPIN    VAR PORTC.4    'I2C DATA PIN
              CPIN    VAR PORTC.3    'I2C CLOCK PIN
              Write_Address    VAR WORD
			  i var byte
			  j var byte
			  bat var byte
			Battery_Charge_Counter var byte
              ' -------------- RTC definitions -----------------
          RTC CON     %11010000
          SecReg CON $00 ' seconds Write_Addressess (00 - 59) ' MSB of SecReg must be set to a 0 to enable RTC
          ContReg CON $0E ' control register
          cntrl CON %00000000 ' sets the SQW/OUT to 1Hz pulse, logic level low
          I2CWRITE DPIN, CPIN, RTC, ContReg, [cntrl]
          ' The variable below holds the values entered:
          ' entered by the user
          sec VAR BYTE : mins VAR BYTE : hr VAR BYTE : day VAR BYTE :date VAR BYTE : mon VAR BYTE : yr VAR BYTE 
Battery_Charge_Counter = 0
		
          PAUSE 1000
          GOSUB SET_RTC
           			Write_Address = 0    
			  Mainloop:
	
	lcdout $FE,1, "Appuye sur Record"
	lcdout $FE,$C0, "ou sur Show"
	pause 100
	
		if PORTC.6 =0 then  
			GOSUB READ_RTC
			Write_Address =0
				I2CWRITE DPIN,CPIN,$A0,Write_Address,[sec,mins,hr]
				PAUSE 10
				Write_Address = Write_Address +7
					Battery_Charge_Counter = Battery_Charge_Counter + 1
		Endif	
			
		if PORTC.7 =0 then
					bat = 0
					j=1
                    for i=0 to Battery_Charge_Counter
						I2CREAD DPIN,CPIN,$A0,bat,[sec,mins,hr]
						PAUSE 10
						LCDOUT $FE,1," Time  ",DEC3 j
						LCDOUT $FE,$C0,"time ",DEC Battery_Charge_Counter,":", HEX2 hr, ":", HEX2 mins, ":", HEX2 sec
						PAUSE 2000
						bat = bat +7
						j= j + 1
					next i
					

		Endif
		
GOTO Mainloop
End
			
          READ_RTC:
          I2CREAD DPIN, CPIN, $D0, SecReg, [sec,mins,hr,day,date,mon,yr]
          RETURN

          SET_RTC:		' Do once at startup
          yr = $3
          mon = $5
          date = $05
          sec = $09
          mins = $04
          hr = $02
          I2CWRITE DPIN, CPIN, $D0, SecReg, [sec,mins,hr,day,date,mon,yr]
          RETURN