Menghitung lebar pulsa mengggunakan mikrokontroler dengan bascom dan at mega 8535 Blog Adi Sanjaya Global Techno Solution - AS-GTS

Menghitung lebar pulsa mengggunakan mikrokontroler dengan bascom dan at mega 8535 Blog Adi Sanjaya Global Techno Solution - AS-GTS

Size
Price:

Read more


Menghitung lebar pulsa mengggunakan mikrokontroler dengan bascom dan at mega 8535

Skema rangkaian Menghitung lebar pulsa mengggunakan mikrokontroler dengan bascom dan at mega 8535




Source code Menghitung lebar pulsa mengggunakan mikrokontroler dengan bascom dan at mega 8535


$regfile = "m8535.dat"
$crystal = 16000000
Dim Pulsa As Long , Arah As Byte
Dim Pulsa_high As Long
Dim S As String * 10
Const _rising = 11
Const _falling = 22
Config Lcdpin = Pin , Rs = Portc.0 , E = Portc.1 , Db4 = Portc.2
Config Lcdpin = Pin , Db5 = Portc.3 ,Db6 = Portc.4 , Db7 = Portc.5
Config Lcd = 16 * 2
Cursor Off
Cls
Lcd "Lebar Pulsa"
Config Timer1 = Timer , Prescale = 1024
Config Int0 = Rising
On Int0 Int_x0
Enable Int0
Enable Interrupts
Arah = _rising
Portd.2 = 1
Ddrd.2 = 0
Do
Pulsa_high = Pulsa * 64
Locate 2 , 6
Lcd Pulsa_high ; " us "
Loop
End
Int_x0:
Gicr = 0
If Arah = _rising Then
Start Timer1
Arah = _falling
Mcucr = &H02
Elseif Arah = _falling Then
Stop Timer1
Pulsa = Timer1
Timer1 = 0
Arah = _rising
Mcucr = &H03
End If
Gicr = &H40
Return

0 Reviews

Contact form

Name

Email *

Message *