I wrote this code on Bascom
but as I run and click on keypad on Proteus
I see this error:
Invalid opcode 0x000D at PC=0x0118
this is my code on Bascom
$regfile = "m16def.dat"
$crystal = 1000000
Config Kbd = Portd , Debounce = 30
Config Lcd = 16 * 2
Config Lcdpin = Pin , Db4 = Portb.4 , Db5 = Portb.5 , Db6 = Portb.6 , Db7 = Portb.7 , Rs = Portb.3 , E = Portb.2
Dim Adad As Byte
Dim Andis As Byte
Dim Lable As Byte
Scan1:
Waitms 200
Adad = 0
Andis = Getkbd()
If Andis > 15 Then Goto Scan1
Lable = Lookup(andis , Dta)
If Lable < 10 Then
Adad = Adad * 10
Adad = Adad + Lable
Lcd Adad
End If
Dta:
Data 7 , 8 , 9 , 10 , 4 , 5 , 6 , 11 , 1 , 2 , 3 , 12 , 13 , 0 , 14 , 15
and this is my proteus
simulation for simple calculation
:
and as I click on keypad I see this:
I do not have any idea what have happen there. any help would be appreciated.