did finally get something to work attached program but for some reason i am unable to duplicate this again seems to be the clock wont start
using pbp and mcs tried using mpspam with this but too many errors to count if someone could look over this listing and explain why the clock is not starting once itruns which i dont know how i got there it does what i want


thanks

' PicBasic Pro program to display result of
' 8-bit A/D conversion on LCD
'
' Connect analog input to channel-0 (RA0)
@ DEVICE pic16f877a, HS_OSC, WDT_ON, PWRT_ON, LVP_OFF, PROTECT_OFF

' Define LCD registers and bits
Define LCD_DREG PORTB ' Port for LCD Data
Define LCD_DBIT 4 ' Use upper 4 bits of Port
Define LCD_RSREG PORTB ' Port for RegisterSelect (RS) bit
Define LCD_RSBIT 3 ' Port Pin for RS bit
Define LCD_EREG PORTB ' Port for Enable (E) bit
Define LCD_EBIT 2 ' Port Pin for E bit
Define LCB_BITS 4 ' Using 4-bit bus
Define LCD_LINES 2 ' Using 2 line Display
Define LCD_COMMANDUS 2000 ' Command Delay (uS)
Define LCD_DATAUS 50 ' Data Delay (uS)




DEFINE OSC 20
' Define ADCIN parameters
Define ADC_BITS 8 ' Set number of bits in result
Define ADC_CLOCK 3 ' Set clock source (3=rc)
Define ADC_SAMPLEUS 50 ' Set sampling time in uS
define loader_used 1
adval var byte ' Create adval to store result
AD33 VAR BYTE
W1 VAR WORD 'PUSHBUTTON
I VAR WORD
TRISA = %11111111 ' Set PORTA to all input
TRISD = %11111111 ' SET PORTD TO INPUT
ADCON1 = %00000010 ' Set PORTA analog
' Low PORTE.2 ' LCD R/W line low (W)
' Define I2C bus ports
B0 VAR BYTE
B1 VAR BYTE
B2 VAR BYTE
SDA VAR PORTC.4 'DS1307 SDA pin
SCL VAR PORTC.3 'DS1307 SCL pin
DEFINE I2C_SLOW 1
DEFINE I2C_HOLD 1
DEFINE I2C_SCLOUT 1
Pause 500 ' Wait .5 second
ADDR VAR BYTE
ADDR = 0
PAUSE 1000
CONT CON %11010000

secs var byte
mins var byte
hrs var byte
day var byte
date var byte
month var byte
year var byte
ctrl var byte



I2CWRITE SDA,SCL,CONT,ADDR,[$00,$59,$11,$03,$25, $12 ,$03, $10]
PAUSE 5000
I2CREAD SDA,SCL,CONT,ADDR ,[b2]
loop:

COUNT portd.1,750,w1
lcdout $fe,1
pause 1000

lcdout $fe,$80+4 ,"count: ", dec w1
pause 500
I2CREAD SDA,SCL,CONT,ADDR ,[secs,mins,hrs,day,date,month,year,ctrl]
pause 500
ADCIN 0, adval ' Read channel 0 to adval
ADCIN 1, AD33
Lcdout $fe, 1 ' Clear LCD
Lcdout "Value: ", # adval ' Display the decimal value
LCDOUT $FE,$C0, "VALUE : ", DEC AD33
Pause 500 ' Delay for .5 seconds
lcdout $fe,1 ' clear display
lcdout "min: ", hex mins
lcdout $FE,$C0,"secs: ",hex secs
pause 1000



Goto loop ' Do it forever
End