thanks mister very much for your trying to help me again.

Quote Originally Posted by mister_e
You really should think about the zero crossing stuff i stated before. Better chance to reduce noise, AND increase the contactor contacts lifetime
the load is 3-ph heater, so how can i make zero crossing on 3-ph load !!!

this error (stuck in sht code) is happened one time every 2-3 days,so at this time i want code to detect any stuck will happen in this code.

i process some code like that
Quote Originally Posted by microkam
While dta=1
Wend
i put a maximum time to stay in this loop , over this time the program reset and read the sensor second time >

the problem here
Quote Originally Posted by microkam
ShiftIn dta,clk,0,[result.highbyte\8]
i cant put a maximum time for this command ..

any soluation can help me to pass this problem without changing in hardware.