Hi All,

I have placed my code below, does anyone know how can I put milli-second's in the tmer as well?,
as currently I have seconds, minutes and hours but I need to show miilisconds as well, any help
would be appreciated ;-)

Include "modedefs.bas" ' Include shift modes

Define OSC 10 ' Set Xtal Frequency
' ** Setup the Debug Defines **
Define LCD_DREG PORTD ' Define LCD connections
Define LCD_DBIT 0
Define LCD_RSREG PORTH
Define LCD_RSBIT 4
Define LCD_EREG PORTH
Define LCD_EBIT 5
DEFINE LCD_BITS 4 'LCD bus size 4 or 8
DEFINE LCD_LINES 2 'Number lines on LCD
DEFINE LCD_COMMANDUS 2000 'Command delay time in us
DEFINE LCD_DATAUS 50 'Data delay time in us
Define ADC_BITS 10 ' Set number of bits in result
Define ADC_CLOCK 0 ' Set clock source (3=rc)
Define ADC_SAMPLEUS 50 ' Set sampling time in uS


' ** Declare the Variables **


B0 VAR BYTE
B1 VAR BYTE
B2 VAR BYTE


RST var PORTJ.2
IO var PORTJ.1
SCLK var PORTJ.0

' Allocate variables
rtcyear var byte
rtcday var byte
rtcmonth var byte
rtcdate var byte
rtchr var byte
rtcmin var byte
rtcsec var BYTE
rtcssec var BYTE
rtccontrol var byte


ADCON1 = 15 ' PORTA and E digital
ADCON2.7 = 1
Low RST ' Reset RTC
Low SCLK

pause 100

st:
Lcdout $fe, 1, "Waiting..."
rtchr = 0
rtcmin = 0
rtcsec = 0
rtcssec = 00
pause 100

pause 500
start:

if portb.2 = 0 then goto main
if portb.2 = 1 then goto start


main:

Gosub settime ' Set the time

Goto mainloop ' Skip subroutines


' Subroutine to write time to RTC
settime:

RST = 1 ' Ready for transfer
' Enable write
Shiftout IO, SCLK, LSBFIRST, [$8e, 0]

RST = 0 ' Reset RTC

RST = 1 ' Ready for transfer

' Write all 8 RTC registers in burst mode
Shiftout IO, SCLK, LSBFIRST, [$be, rtcsec, rtcmin, rtchr, rtcdate, rtcmonth, rtcday, rtcyear, 0]

RST = 0 ' Reset RTC
Return

' Subroutine to read time from RTC
gettime:
RST = 1 ' Ready for transfer

Shiftout IO, SCLK, LSBFIRST, [$bf] ' Read all 8 RTC registers in burst mode
Shiftin IO, SCLK, LSBPRE, [rtcsec, rtcmin, rtchr, rtcdate, rtcmonth, rtcday, rtcyear, rtccontrol]

RST = 0 ' Reset RTC
Return

' Main program loop - in this case, it only updates the LCD with the time
mainloop:

Gosub gettime ' Read the time from the RTC

' Display time on LCD
Lcdout $fe, 1, hex2 rtchr, ":", hex2 rtcmin, ":", hex2 rtcsec
PAUSE 500
' Do it about 3 times a second

if portb.2 = 1 then goto loop1
if portb.2 = 0 then goto mainloop

Goto mainloop ' Do it forever


loop1:


Low RST ' Reset RTC
Low SCLK

' Display time on LCD
Lcdout $fe, 1, hex2 rtchr, ":", hex2 rtcmin, ":", hex2 rtcsec

PAUSE 250

goto loop3

loop3:

pause 500

if portb.3 = 1 then goto loop3
if portb.3 = 0 then goto st

goto loop3

end