أنا أحتاج مساعدتك ضروري جدا ...
لأن الــ Interrupt دة جنني ....
يا أخي مش المفروض إن الأنتربت (في حالة ربطة بالـTimer0) يشتغل عند وصول العد لأقصاة مهما كان البرنامج الأصلي طويل أو قصير .... المفروض إن الإنتربت ملوش دعوة ... فقط لما التايمر يصل للنهاية ساعتها فقط يعمل ...

المشكلة إن البرنامج أطولة ..ألاقي حدوث الإنتربت يتأخر ....أقصرة .. ألاقي حدوث الإنتربت يبقى سريع .... هو مال طول البرنامج و قصرة بالإنتربت ....

الكود هنا
كود:
'Set the registers*****************************
option_reg=%00000111
intcon=%10100000
TRISB = 0
TRISA = %11001
DEFINE LCD_DREG PORTB
DEFINE LCD_DBIT 0
DEFINE LCD_RSREG PORTA
DEFINE LCD_RSBIT 1
DEFINE LCD_EREG PORTA
DEFINE LCD_EBIT 2
DEFINE LCD_BITS 4
DEFINE LCD_LINES 2
DEFINE LCD_COMMANDUS 10
DEFINE LCD_DATAUS 10
'Set the Variables******************************
flowin var word
flowinrem var word
type var byte
BUTTONX VAR BYTE
tempCount Var Byte
array var byte[5]
tempArray0 var byte
tempArray1 var byte
tempArray2 var word
'Reset the Variables**************************
temparray0=-1
temparray1=0
temparray2=0
BUTTONX=0
tempCount=0
'Start & Calculate the Pulses*******************
Start: 'START PROGRAM HERE
count PORTA.0,500,flowin 'calculate Pulses
'Take the average vaule*************************
tempArray0 = tempArray0+1 'tempArray0 for New Values
if tempArray0 <= 4 then
array[temparray0]=flowin
else
tempArray0=-1 'To start from 0
endif
for temparray1=0 to 4 'tempArray1 for Acomulation Proccess
temparray2=temparray2 + array[temparray1] 'tempArray2
next temparray1
flowin=temparray2/5 'the average value of the flowin
temparray2=0 'to Rest the accumulator
pause 10
'Matrial Type***********************************
IF PORTA.3 = 0 THEN buttonx=buttonx+1
select case BUTTONX
CASE 1
HIGH PORTB.7
TYPE = 10
pause 20
CASE 2
LOW PORTB.7 ' NOT PRESSED
TYPE = 11
buttonx=0
PAUSE 20
END SELECT
'Calculate the Flow Equation*******************
flowin= (flowin*36*type)/100
flowinrem = (flowin*36*type)//100
'The LCD Value************************************
Lcdout $FE, $80, dec FLOWIN ,".",dec1 FLOWINREM ," ",dec tempcount
on interrupt goto yahoo
GOTO Start
'Interrupte*************************************
Disable
yahoo:
tempcount=tempCount+1
if tempCount <=61 then
Portb.4=1
else
if tempcount <=122 then
portb.4=0
else
tempcount=0
endif
endif
resume
enable
END
ممكن تنسخة زي ما هو ...و تجربة ...
بس جرب البرنامج في وجود الأمر Count وشوف السرعة
و مرة من غيرة ....و شوف السرعة (سرعة الأستجابة للإنتربت)
[IMG]file:///C:/Documents%20and%20Settings/Administrator/Desktop/aaaa.jpg[/IMG][IMG]file:///C:/Documents%20and%20Settings/Administrator/Desktop/aaaa.jpg[/IMG]
ربنا يكرمك على مجهودك و يجعلة في ميزان حسناتك
مش عارف أحمل صورة البرنامج على البروتس