proteus error: Invalid opcode 0x000D at PC=0x0118

11.3k views Asked by At

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: enter image description here

and as I click on keypad I see this: enter image description here

I do not have any idea what have happen there. any help would be appreciated.

2

There are 2 answers

0
Nizar Habash On

Probably it's the .include at the first I faced this problem while programing in assembly avr on the same program (proteus) using the atmega328p. I fortgot to put the inculde at 1st and i had a demo version of the proteus (which requires to be run as administrator every time you launch the application again). Try this and let me know it it worked.

0
Cristian On

It is because of the version of the PIC or of its type. For example when using it with arduino you have to specify the type (UNO, NANO, MEGA).