interrupt handler (Interrupt at 0x0008) error for USB code

General discussion on mikroBasic PRO for PIC.
Post Reply
Author
Message
arvinfx
Posts: 115
Joined: 22 Feb 2010 18:44

interrupt handler (Interrupt at 0x0008) error for USB code

#1 Post by arvinfx » 09 Oct 2019 07:08

Hi I try to check mikrobasic sample code for USB in PIC18F4550
I exactly copy and paste the code in help file of mikrobasic but HEX file not generate . please find the code and error message blow:

Code: Select all

program HID_Read_Write_Interrupt

dim cnt as char
dim readbuff as byte[64] absolute 0x500           ' Buffers should be in USB RAM, please consult datasheet
dim writebuff as byte[64] absolute 0x540

sub procedure Interrupt()
   USB_Interrupt_Proc()                           ' USB servicing is done inside the interrupt
end sub

main:
  ADCON1 = ADCON1 or 0x0F                         ' Configure all ports with analog function as digital
  CMCON  = CMCON or 7                             ' Disable comparators

  HID_Enable(@readbuff,@writebuff)                ' Enable HID communication

  while TRUE
    while(HID_Read() = 0)
    wend

    for cnt=0 to 63
      writebuff[cnt] = readbuff[cnt]
    next cnt

    while(HID_Write(@writebuff,64) = 0)
    wend
  wend
end.
Attachments
New Bitmap Image.jpg
New Bitmap Image.jpg (37.45 KiB) Viewed 1729 times

User avatar
stefan.filipovic
mikroElektronika team
Posts: 1135
Joined: 18 Dec 2018 10:30

Re: interrupt handler (Interrupt at 0x0008) error for USB co

#2 Post by stefan.filipovic » 09 Oct 2019 16:16

Hi,

Have you tried to run the project from the following path?
C:\Users\Public\Documents\Mikroelektronika\mikroBasic PRO for PIC\Examples\Development Systems\EasyPic7\USB\HID Read Write Interrupt

Kind regards,
Stefan Filipović

arvinfx
Posts: 115
Joined: 22 Feb 2010 18:44

Re: interrupt handler (Interrupt at 0x0008) error for USB co

#3 Post by arvinfx » 09 Oct 2019 16:54

Thanks , Now it is working!

User avatar
stefan.filipovic
mikroElektronika team
Posts: 1135
Joined: 18 Dec 2018 10:30

Re: interrupt handler (Interrupt at 0x0008) error for USB co

#4 Post by stefan.filipovic » 10 Oct 2019 08:02

Hi,

You're welcome.

Kind regards,
Stefan Filipović

arvinfx
Posts: 115
Joined: 22 Feb 2010 18:44

Re: interrupt handler (Interrupt at 0x0008) error for USB co

#5 Post by arvinfx » 11 Oct 2019 14:48

another same error happen in V7.5.0 .when i copy a project from another folder to a new folder ! why ?

for ex:

C:\Users\Public\Documents\Mikroelektronika\mikroBasic PRO for PIC\Examples\Other\Sound

I copy "Sound" to my desktop and run it , but compiler error is this:
Attachments
New Bitmap Image.jpg
New Bitmap Image.jpg (44.35 KiB) Viewed 1688 times

User avatar
stefan.filipovic
mikroElektronika team
Posts: 1135
Joined: 18 Dec 2018 10:30

Re: interrupt handler (Interrupt at 0x0008) error for USB co

#6 Post by stefan.filipovic » 14 Oct 2019 14:48

Hi,

Does it happens if you do it with the "Export Project" feature? You can try it by pressing Ctrl+Alt+E in the compiler.

Kind regards,
Stefan Filipović

arvinfx
Posts: 115
Joined: 22 Feb 2010 18:44

Re: interrupt handler (Interrupt at 0x0008) error for USB co

#7 Post by arvinfx » 16 Oct 2019 11:19

stefan.filipovic wrote:Hi,

Does it happens if you do it with the "Export Project" feature? You can try it by pressing Ctrl+Alt+E in the compiler.

Kind regards,
Dear Stefan

I checked but same Error reported. :(

User avatar
stefan.filipovic
mikroElektronika team
Posts: 1135
Joined: 18 Dec 2018 10:30

Re: interrupt handler (Interrupt at 0x0008) error for USB co

#8 Post by stefan.filipovic » 16 Oct 2019 13:20

Hi,

Unfortunately, I've not managed to reproduce the same issue.
Could you please zip and attach that project here?

Have you tried reinstalling the compiler (please install the compiler with administrator privileges, right-click on the icon -> run as administrator)?
Also, how have you run the compiler? Please run it also as an administrator.

Kind regards,
Stefan Filipović

Post Reply

Return to “mikroBasic PRO for PIC General”