سلام
من میخوام یک برنامه بیسیک بنویسم برای میکرو مگا 32 که مثلا اگر portd.2 یک شد مقدار پالس ورودی به portd.3 را جمع بزند و در یک ال سی دی نمایش دهد و این شمارش با کمترین خطا باشد ازتون ممنون میشم کمک کنید
من خودم قبلا یه چیزی رو نوشتم ولی در ÷رتیوس جواب نمی گیرم
$regfile = "m32def.dat"
$crystal = 1000000
'Config Int0 = Rising
Config Int1 = Rising
'On Int0 Interrupt0
On Int1 Interrupt1
Config Portd.2 = Input
Config Portd.3 = Input
Dim Count As Long
Config Lcd = 16 * 2
Config Lcdpin = Pin , Db4 = Portc.4 , Db5 = Portc.5 , Db6 = Portc.6 , Db7 = Portc.7 , E = Portc.3 , Rs = Portc.2
'Main Body of Program
Enable Int0
Enable Interrupts
Main:
Do
If Pind.2 = 1 Then
Enable Int1
Elseif Pind.2 = 0 Then
Disable Int1
If Portd.3 <> 0 Then
Lcd Count
Count = 0
End If
End If
Loop
End
Interrupt0:
Enable Int1
Return
Interrupt1:
Incr Count
Return
من میخوام یک برنامه بیسیک بنویسم برای میکرو مگا 32 که مثلا اگر portd.2 یک شد مقدار پالس ورودی به portd.3 را جمع بزند و در یک ال سی دی نمایش دهد و این شمارش با کمترین خطا باشد ازتون ممنون میشم کمک کنید
من خودم قبلا یه چیزی رو نوشتم ولی در ÷رتیوس جواب نمی گیرم
$regfile = "m32def.dat"
$crystal = 1000000
'Config Int0 = Rising
Config Int1 = Rising
'On Int0 Interrupt0
On Int1 Interrupt1
Config Portd.2 = Input
Config Portd.3 = Input
Dim Count As Long
Config Lcd = 16 * 2
Config Lcdpin = Pin , Db4 = Portc.4 , Db5 = Portc.5 , Db6 = Portc.6 , Db7 = Portc.7 , E = Portc.3 , Rs = Portc.2
'Main Body of Program
Enable Int0
Enable Interrupts
Main:
Do
If Pind.2 = 1 Then
Enable Int1
Elseif Pind.2 = 0 Then
Disable Int1
If Portd.3 <> 0 Then
Lcd Count
Count = 0
End If
End If
Loop
End
Interrupt0:
Enable Int1
Return
Interrupt1:
Incr Count
Return
دیدگاه