MikroC ARM USB Interrupt Problem

General discussion on mikroC PRO for ARM.
Author
Message
maytere
Posts: 85
Joined: 04 Mar 2009 14:19

MikroC ARM USB Interrupt Problem

#1 Post by maytere » 25 Nov 2018 08:44

I wrote a code for my customer at 2013 which uses USB hid interrupt and it worked like a charm but now i want to make some improvements in my code but if i compile my code in newer versions of mikroC pro for ARM 4.20, usb communication doesn't work.

If I take HID_Read and HID_write funstions out of interrupt routine it works but i have tou use them in interrupt routine.

Could you please correct this problem in new versions of compiler?

Code: Select all

void USB_Intr() iv IVT_INT_OTG_FS ics ICS_AUTO {
 USB_Interrupt_Proc();
 kk=HID_Read();
 if(kk!=0)
                {
                 veri_1=readbuff[0];
                 veri_2=readbuff[1];
                 veri_Role=readbuff[2];
                 lo(frekans)=readbuff[4];
                 hi(frekans)=readbuff[5];
                 lo(genlik)=readbuff[6];
                 hi(genlik)=readbuff[7];
                 XR2206_Mod=readbuff[8];
                 frek_araligi=readbuff[9];
                 SayiciDegeri2=readbuff[10];
                 if(readbuff[3]=='o')
                 HID_Write(&writebuff,64);
                }
}
Mikro Dunya || MikroC PIC and ARM Articles
http://mikrodunya.wordpress.com

User avatar
petar.suknjaja
mikroElektronika team
Posts: 683
Joined: 05 Mar 2018 09:44
Location: Belgrade

Re: MikroC ARM USB Interrupt Problem

#2 Post by petar.suknjaja » 26 Nov 2018 17:10

Hi,
Please post the project here or on the petar.suknjaja@mikroe.com
so we could see what's causing the problem.
Kind regards,
Petar

maytere
Posts: 85
Joined: 04 Mar 2009 14:19

Re: MikroC ARM USB Interrupt Problem

#3 Post by maytere » 26 Nov 2018 18:00

Hi Petar. Thanks for reply. I sent you my test project via e-mail.
Here is my code which works with v4.2 but doesnt work with v 6.0.0.
Best regards.

Code: Select all

char cnt;
char kk;
char readbuff[64];
char writebuff[64]="Hello";
unsigned long int i = 0;

void main(void){
  HID_Enable(&readbuff,&writebuff);
  while(1)
          {
           delay_ms(100);
          }
}


void USB() iv IVT_INT_OTG_FS ics ICS_AUTO {
USB_Interrupt_Proc();
kk = HID_Read();
if(kk != 0)HID_Write(&writebuff,64);
}
Mikro Dunya || MikroC PIC and ARM Articles
http://mikrodunya.wordpress.com

User avatar
petar.suknjaja
mikroElektronika team
Posts: 683
Joined: 05 Mar 2018 09:44
Location: Belgrade

Re: MikroC ARM USB Interrupt Problem

#4 Post by petar.suknjaja » 27 Nov 2018 14:13

Hi,
I confirm the reception of the code.
I'll review it and let you know what I found out, I just need to clear some of my previous tasks and assignments.
Kind regards,
Petar

maytere
Posts: 85
Joined: 04 Mar 2009 14:19

Re: MikroC ARM USB Interrupt Problem

#5 Post by maytere » 27 Nov 2018 15:36

Thanks.
I will be waiting for result.
Mikro Dunya || MikroC PIC and ARM Articles
http://mikrodunya.wordpress.com

User avatar
petar.suknjaja
mikroElektronika team
Posts: 683
Joined: 05 Mar 2018 09:44
Location: Belgrade

Re: MikroC ARM USB Interrupt Problem

#6 Post by petar.suknjaja » 29 Nov 2018 17:18

Hi,
I've tried the example and I see that it's recognized but as you said, the communication is not working.
I reckon it has something to do with changes in the libraries.
Will it be able to run on 6.0, I don't know, I'm yet to investigate the library code, but I suggest you to
use the base of the compiler examples that work on the 6.0.0 for new project.

I'll let you know if I find something new.

Kind regards,
Petar

maytere
Posts: 85
Joined: 04 Mar 2009 14:19

Re: MikroC ARM USB Interrupt Problem

#7 Post by maytere » 29 Nov 2018 19:30

Hi Petar.
If i cant use Hid_read or Hid_Write functions under interrupt routine then interrupt routine doesnt mean anything.
Please make again hid library as version 4.2. My customers are having problems.
Thanks.
Mikro Dunya || MikroC PIC and ARM Articles
http://mikrodunya.wordpress.com

maytere
Posts: 85
Joined: 04 Mar 2009 14:19

Re: MikroC ARM USB Interrupt Problem

#8 Post by maytere » 08 Dec 2018 17:04

Hi.
Is there any news with this problem?
Where can I find mikroc pro for ARM v4.2?
Mikro Dunya || MikroC PIC and ARM Articles
http://mikrodunya.wordpress.com

User avatar
petar.suknjaja
mikroElektronika team
Posts: 683
Joined: 05 Mar 2018 09:44
Location: Belgrade

Re: MikroC ARM USB Interrupt Problem

#9 Post by petar.suknjaja » 10 Dec 2018 10:24

Hi,
The version 4.2 is no longer available to download.
The oldest version I could find in the archives is 4.5
If you're sure you want to keep the old version of the compiler, I could upload the version 4.5 to
my dropbox account and share the link.
However, I strongly advise you to use the latest version of the compiler.
Regarding the USB hid library, I can't influence changing the library back to
old version, but I believe I'll have the solution or at least the explanation of your
problem in a couple of days.
Kind regards,
Petar

maytere
Posts: 85
Joined: 04 Mar 2009 14:19

Re: MikroC ARM USB Interrupt Problem

#10 Post by maytere » 12 Dec 2018 07:37

Hi.
I found ver 4.2.
You can download it from this link: http://s7.dosya.tc/server11/6dg4mi/mikr ... p.zip.html
Mikro Dunya || MikroC PIC and ARM Articles
http://mikrodunya.wordpress.com

qweiczz
Posts: 8
Joined: 04 Dec 2018 07:13

Re: MikroC ARM USB Interrupt Problem

#11 Post by qweiczz » 13 Dec 2018 03:53

Hi.
Is there any news with this problem?
Where can I find mikroc pro for ARM v4.2?


https://allicdata.com

User avatar
petar.suknjaja
mikroElektronika team
Posts: 683
Joined: 05 Mar 2018 09:44
Location: Belgrade

Re: MikroC ARM USB Interrupt Problem

#12 Post by petar.suknjaja » 13 Dec 2018 12:15

qweiczz wrote:Hi.
Is there any news with this problem?
Where can I find mikroc pro for ARM v4.2?


https://allicdata.com
Hi,
Please make sure you've read the post above so we don't make the confusion.
There's no problem with the USB HID here,only a difference in the libraries between version
4.2 and the latest one 6.0.

As soon as we finish some previous assignments I will test thoroughly these two libraries.
Until then, my recommendation is to recreate the project with the new version of the mikroC,
make sure that you setup the configuration bits correctly, especially the USB frequency.

Kind regards,
Petar

maytere
Posts: 85
Joined: 04 Mar 2009 14:19

Re: MikroC ARM USB Interrupt Problem

#13 Post by maytere » 24 Dec 2018 16:18

Hi Petar.
Is there any progress new?
Thanks.
Mikro Dunya || MikroC PIC and ARM Articles
http://mikrodunya.wordpress.com

maytere
Posts: 85
Joined: 04 Mar 2009 14:19

Re: MikroC ARM USB Interrupt Problem

#14 Post by maytere » 30 Dec 2018 09:02

Hi.
I confirm usb interrupt problem is solved in version 6.1.0.
Thanks for all MikroE team.
I wish you all a happy new year.

King regards.
Mikro Dunya || MikroC PIC and ARM Articles
http://mikrodunya.wordpress.com

User avatar
petar.suknjaja
mikroElektronika team
Posts: 683
Joined: 05 Mar 2018 09:44
Location: Belgrade

Re: MikroC ARM USB Interrupt Problem

#15 Post by petar.suknjaja » 03 Jan 2019 13:59

Hi,
I'm glad to hear that :D

Happy New Year and we wish you the best in 2019,

Kind regards,
Petar

Post Reply

Return to “mikroC PRO for ARM General”