tahap-tahap
dalam
membuat
Calculator
Digital
dengan
AVR
ATMEGA-16
2.
Keypad-Small-Calc
3.
LM016 (LCD)
Langkah selanjutnya adalah melakukan simulasi dengan menggunakan beberapa software pendukung, software
yang dibutuhkan adalah:
1.
Proteus(ISIS 7 Professional)
2.
Bascom-AVR
Mari kita mulai untuk melakukan simulasi terlebih dahulu:
1.
Buatlah rangkaian sesuai dengan gambar di bawah ini dengan menggunakan Software Proteus(ISIS 7
Profesional):
2.
setelah selesai merangkai gunakan software Bascom-AVR dengan mengetikkan kode sebagai berikut:
$regfile
$crystal
Config
Config
m16def.dat
=
Kbd
=
Lcd
Portd
=
1000000
,
Debounce
16
=
*
30
2
Config Lcdpin = Pin , Db4 = Portb.4 , Db5 = Portb.5 , Db6 = Portb.6 , Db7 = Portb.7 , Rs = Portb.3 , E = Portb.2
Dim
As
Byte
Dim
As
Byte
Dim
Key
Dim
Dim
As
Byte
Dim
As
Byte
Dim
As
Byte
As
Byte
As
Byte
Cls
Cursor
Off
Locate
Lcd
calculator
dig
Q:
Waitms
200
If
Getkbd()
>
15
Then
Goto
Else
Key
If
Lookup(a
Key
<=
Dta)
Then
10
Key
If
Then
If
Then
Cls
Elseif
:
Key
Lcd
=
B
10
Then
Cls
F
B
Elseif
=
Key
0
11
Then
Cls
E
Elseif
Key
12
Then
Cls
E
Elseif
Key
15
Then
Cls
E
Elseif
Key
13
Then
Cls
E
Elseif
If
Key
14
Then
Then
Cls
Select
Case
Case
Case
B
2:
=
Case
B
D
3:
Case
B
D
4:
End
Select
Lcd
End
If
End
If
End
If
Locate
Lcd
,
"calculator
Goto
End
Dta:
Data 7 , 8 , 9 , 10 , 4 , 5 , 6 , 11 , 1 , 2 , 3 , 12 , 13 , 0 , 14 , 15
1
dig"
Q