Disini akan dibahas mengenai bagaimana cara mengakses IC DECODER dan ENCODER, secara garis besar DECODER yaitu merubah dari biner menjadi bilangan desimal, jika ENCODER sebaliknya yaitu mengubah dari bilangan desimal ke biner, berikut penjelasan masing-masingnya
IC 74LS138 DECODER
PROGRAM BASCOM AVR
$regfile = "m16def.dat"
$crystal = 12000000
Ddrd = &B11111111
Do
Portd = &B00000000
Wait 1
Portd = &B00000001
Wait 1
Portd = &B11111101
Wait 1
Portd = &B11111100
Wait 1
Portd = &B11111011
Wait 1
Loop
$crystal = 12000000
Ddrd = &B11111111
Do
Portd = &B00000000
Wait 1
Portd = &B00000001
Wait 1
Portd = &B11111101
Wait 1
Portd = &B11111100
Wait 1
Portd = &B11111011
Wait 1
Loop
IC 74LS148 ENCODER
PROGRAM BASCOM AVR
$regfile = "m16def.dat"
$crystal = 12000000
Ddrd = &B11111111
Do
Portd = &B11111110
Wait 1
Portd = &B11111101
Wait 1
Portd = &B11111011
Wait 1
Portd = &B11110111
Wait 1
Portd = &B11101111
Wait 1
Portd = &B11011111
Wait 1
Portd = &B10111111
Wait 1
Portd = &B01111111
Wait 1
Loop
$crystal = 12000000
Ddrd = &B11111111
Do
Portd = &B11111110
Wait 1
Portd = &B11111101
Wait 1
Portd = &B11111011
Wait 1
Portd = &B11110111
Wait 1
Portd = &B11101111
Wait 1
Portd = &B11011111
Wait 1
Portd = &B10111111
Wait 1
Portd = &B01111111
Wait 1
Loop
No comments:
Post a Comment