سلام لدفا زود کمک کنید
من یه برنامه ای نوشتم ک تو پروتوس اجراء میکنم درسته اما میام مدارش رو میبدم مشکل داره
متن برنامه اینه:
پایه های c.7وc.1وc.0رو یک میکنم به زیر برنامه خودش میره ولی اما پایه های c.6وc.5وc.4وc.3وc.2رو 1 میکنم به زیر برنامه خوش نمیره نمیره چیکاری کنم مشکل از چیه ؟؟
در ضمن من از کریستال خارجی هم استفاده کردم
دلیل: ادغام دو پست برای جلوگیری از اسپم
کمکم کنید خیلی خیلی واجبه
من یه برنامه ای نوشتم ک تو پروتوس اجراء میکنم درسته اما میام مدارش رو میبدم مشکل داره
متن برنامه اینه:
$regfile = "m32def.dat"
$crystal = 8000000
Config Timer1 = Pwm , Pwm = 8 , Compare A Pwm = Clear up , Compare B Pwm = Clear up , Prescale = 8
Config Pinc.0 = Input
Config Pinc.1 = Input
Config Pinc.2 = Input
Config Pinc.3 = Input
Config Pinc.4 = Input
Config Pinc.5 = Input
Config Pinc.6 = Input
Config Pinc.7 = Input
Config Portd.0 = Output
Config Portd.1 = Output
Config Portd.2 = Output
Config Portd.3 = Output
Config Pind.6 = Input
Config Pind.7 = Input
Dim a as Word
a=900
Pwm1a = a
Pwm1b = a
min:
do
If Pinc.7 = 0 And Pinc.6 = 0 And Pinc.5 = 0 And Pinc.4 = 0 And Pinc.3 = 0 And Pinc.2 = 0 And Pinc.1 = 0 And Pinc.0 = 0 Then Goto jolo
If Pinc.0 = 1 then goto rast
If Pinc.1 = 1 then goto rast
If Pinc.2 = 1 then goto rast
If Pinc.3 = 1 then goto rast
If Pinc.4 = 1 then goto rast
If Pinc.5 = 1 then goto rast
If Pinc.6 = 1 then goto rast
If Pinc.7 = 1 then goto rast
loop
end
rast:
portd.0=1
portd.1=0
portd.2=0
portd.3=0
waitms 200
goto min
jolo:
portd.0=1
portd.1=0
portd.2=1
portd.3=0
waitms 200
goto min
مشکلش اینهکه $crystal = 8000000
Config Timer1 = Pwm , Pwm = 8 , Compare A Pwm = Clear up , Compare B Pwm = Clear up , Prescale = 8
Config Pinc.0 = Input
Config Pinc.1 = Input
Config Pinc.2 = Input
Config Pinc.3 = Input
Config Pinc.4 = Input
Config Pinc.5 = Input
Config Pinc.6 = Input
Config Pinc.7 = Input
Config Portd.0 = Output
Config Portd.1 = Output
Config Portd.2 = Output
Config Portd.3 = Output
Config Pind.6 = Input
Config Pind.7 = Input
Dim a as Word
a=900
Pwm1a = a
Pwm1b = a
min:
do
If Pinc.7 = 0 And Pinc.6 = 0 And Pinc.5 = 0 And Pinc.4 = 0 And Pinc.3 = 0 And Pinc.2 = 0 And Pinc.1 = 0 And Pinc.0 = 0 Then Goto jolo
If Pinc.0 = 1 then goto rast
If Pinc.1 = 1 then goto rast
If Pinc.2 = 1 then goto rast
If Pinc.3 = 1 then goto rast
If Pinc.4 = 1 then goto rast
If Pinc.5 = 1 then goto rast
If Pinc.6 = 1 then goto rast
If Pinc.7 = 1 then goto rast
loop
end
rast:
portd.0=1
portd.1=0
portd.2=0
portd.3=0
waitms 200
goto min
jolo:
portd.0=1
portd.1=0
portd.2=1
portd.3=0
waitms 200
goto min
پایه های c.7وc.1وc.0رو یک میکنم به زیر برنامه خودش میره ولی اما پایه های c.6وc.5وc.4وc.3وc.2رو 1 میکنم به زیر برنامه خوش نمیره نمیره چیکاری کنم مشکل از چیه ؟؟
در ضمن من از کریستال خارجی هم استفاده کردم
دلیل: ادغام دو پست برای جلوگیری از اسپم
کمکم کنید خیلی خیلی واجبه
دیدگاه