1. Penyusunan Program Percobaan
Running LED
Rizqun Nad Putra (1710501072)
R. Suryoto Edy Raharjo, S.T., M.Eng.
Teknik Elektro
Fakultas Teknik
Universitas Tidar
2. Program Coba 1
$regfile = "m16def.dat"
$crystal = 8000000
Config Porta = Output
Config Portb = Output
Do
Porta = &B11111111
Portb = &B11110000
Waitms 100
Porta = &B00000000
Portb = &B00000000
Waitms 100
Loop
End
Start
Compiler setup
Hardware setup
Do
LED Terhubung PortA
bit 0 – 7 dan PortB bit
0 – 3 ON
Wait 100 ms
LED Terhubung PortA
bit 0 – 7 dan PortB bit
0 – 3 OFF
Wait 100 ms
Loop
End
3.
4. Program Coba 2
$regfile = "m16def.dat"
$crystal = 8000000
Config Porta = Output
Config Portb = Output
Do
Porta = &B00000000
Portb = &B11000000
Waitms 300
Porta = &B00000000
Portb = &B00110000
Waitms 300
Porta = &B11000000
Portb = &B00000000
Waitms 300
Porta = &B00110000
Portb = &B00000000
Waitms 300
Porta = &B00001100
Portb = &B00000000
Waitms 300
Porta = &B00000011
Portb = &B00000000
Waitms 300
Loop
End
5. Start
Compiler setup
Hardware setup
Do
LED Terhubung PortB
bit 0 dan 1 ON
Wait 300 ms
LED Terhubung PortB
bit 2 dan 3 ON
Wait 300 ms
LED Terhubung PortA
bit 0 dan 1 ON
Wait 300 ms
LED Terhubung PortA
bit 2 dan 3 ON
LED Terhubung PortA
bit 4 dan 5 ON
LED Terhubung PortA
bit 6 dan 7 ON
Wait 300 ms
Wait 300 ms
Wait 300 ms
Loop
End
6.
7. Program Coba 3
$regfile = "m16def.dat"
$crystal = 8000000
Config Porta = Output
Config Portb = Output
Do
Porta = &B10000000
Portb = &B00010000
Waitms 300
Porta = &B01000000
Portb = &B00100000
Waitms 300
Porta = &B00100000
Portb = &B01000000
Waitms 300
Porta = &B00010000
Portb = &B10000000
Waitms 300
Porta = &B00001001
Portb = &B00000000
Waitms 300
Porta = &B00000110
Portb = &B00000000
Waitms 300
Porta = &B00000000
Portb = &B00000000
Waitms 300
Porta = &B00000110
Portb = &B00000000
Waitms 300
Porta = &B00001001
Portb = &B00000000
Waitms 300
Porta = &B00010000
Portb = &B10000000
Waitms 300
Porta = &B00100000
Portb = &B01000000
Waitms 300
Porta = &B01000000
Portb = &B00100000
Waitms 300
Porta = &B10000000
Portb = &B00010000
Waitms 300
Loop
End
8. Start
Compiler setup
Hardware setup
Do
LED Terhubung PortA bit 0 dan PortB bit 3 ON
Wait 300 ms
LED Terhubung PortA bit 1 dan PortB bit 2 ON
Wait 300 ms
LED Terhubung PortA bit 2 dan PortB bit 1 ON
Wait 300 ms
LED Terhubung PortA bit 3 dan PortB bit 0 ON
Wait 300 ms
LED Terhubung PortA bit 4 dan PortA bit 7 ON
Wait 300 ms
AB
9. LED Terhubung PortA bit 5 dan PortA bit 6 ON
Wait 300 ms
LED Terhubung PortA dan PortB OFF
Wait 300 ms
LED Terhubung PortA bit 5 dan PortA bit 6 ON
LED Terhubung PortA bit 4 dan PortA bit 7 ON
LED Terhubung PortA bit 3 dan PortB bit 0 ON
LED Terhubung PortA bit 2 dan PortB bit 1 ON
Wait 300 ms
Wait 300 ms
Wait 300 ms
Wait 300 ms
AB
AB
10. AB
LED Terhubung PortA bit 1 dan PortB bit 2 ON
Wait 300 ms
Wait 300 ms
LED Terhubung PortA bit 0 dan PortB bit 3 ON
End
Loop