Thanks Steve... I had the TRISO for port D set so no Idea !

One last thing (for tonight)

I added a section for minutes too and could get the LED to come on at say 22:34 and go out at 22:35.

Code:
AlarmH1=(RTCHour>>4)
AlarmH1=(AlarmH1&$03)*10
AlarmH1=AlarmH1+(RTCHour&$0F)

AlarmM1=(RTCMin>>4)
AlarmM1=(AlarmM1&$03)*10
AlarmM1=AlarmM1+(RTCMin&$0F)
    
AlarmHour1 = 22
Alarmmin1 = 34
	
	LCDOut ":",#(RTCMin>>4)&$0F,#RTCMin&$0F,":"
	LCDOut #(RTCSec>>4)&$0F,#RTCSec&$0F," "
	LCDOut $FE, $D4,"value = ",  # alarmh1, #alarmhour1

If AlarmH1 = AlarmHour1 and AlarmM1 = alarmmin1 then
HIGH PortD.7
else
LOW PortD.7
endif
So I added a a few more variables to try and set a time range but whilst it compiles it no longer lights the LED.


Code:
AlarmH1=(RTCHour>>4)
AlarmH1=(AlarmH1&$03)*10
AlarmH1=AlarmH1+(RTCHour&$0F)

AlarmM1=(RTCMin>>4)
AlarmM1=(AlarmM1&$03)*10
AlarmM1=AlarmM1+(RTCMin&$0F)
    
AlarmHour1 = 22
Alarmmin1 = 53
alarmhour2 = 22
Alarmmin2 = 55
	
	LCDOut ":",#(RTCMin>>4)&$0F,#RTCMin&$0F,":"
	LCDOut #(RTCSec>>4)&$0F,#RTCSec&$0F," "
	LCDOut $FE, $D4,"value = ",  # alarmh1, #alarmhour1

If AlarmH1 >= AlarmHour1 and AlarmH1 <= alarmhour2 and AlarmM1=>alarmmin1 and alarmM1<= alarmmin2 then
HIGH PortD.7
else
LOW PortD.7
endif
Any ideas ?