Descriptor USB CDC for mikrobasic

General discussion on mikroBasic PRO for dsPIC30/33 and PIC24.
Post Reply
Author
Message
Prof.Wagner
Posts: 126
Joined: 25 Mar 2011 04:35

Descriptor USB CDC for mikrobasic

#1 Post by Prof.Wagner » 03 Oct 2012 20:40

Hi Everyone
I developed a product with mikrobasic using USB HID interface. It runs very good, now I need to change it to work like USB CDC and I need a descriptor to CDC.
I found a descriptor in the libstock, but it is to Mikro Pascal and for me is dificult to translate it.
Somebody knows how to change the Descriptor USB HID from mikrobasic to USB CDC descriptor? Or somebody has a USB CDC descriptor to mikrobasic?

Thanks a lot

Prof. Wagner

Dany
Posts: 3854
Joined: 18 Jun 2008 11:43
Location: Nieuwpoort, Belgium
Contact:

Re: Descriptor USB CDC for mikrobasic

#2 Post by Dany » 06 Oct 2012 17:00

Prof.Wagner wrote:Hi Everyone
I developed a product with mikrobasic using USB HID interface. It runs very good, now I need to change it to work like USB CDC and I need a descriptor to CDC.
I found a descriptor in the libstock, but it is to Mikro Pascal and for me is dificult to translate it.
Somebody knows how to change the Descriptor USB HID from mikrobasic to USB CDC descriptor? Or somebody has a USB CDC descriptor to mikrobasic?
Hi Prof, I do not know if CDC is possible with the mE USB library, that exercise has never been made. It is not sufficient (I think) to use (translated) CDC descriptors to make it work (again, I think).
The CDC descriptors you have seen, were they meant for usage with the mE USB library?
Kind regards, Dany.
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)

Prof.Wagner
Posts: 126
Joined: 25 Mar 2011 04:35

Re: Descriptor USB CDC for mikrobasic

#3 Post by Prof.Wagner » 12 Dec 2012 18:30

Dear Danny ,

I think that you didnt understand my question.

Today I have another basic compiler (Proton) that it has USB CDC descriptor and it runs very good in 18F4550 micro controler.

Now I changed the compiler (I am using mikrobasic pro dspic with 24F), but this compiler doesnt have USB CDC descriptor yet, it has only USB HID descriptor.

I didnt get to change this descriptor from HID to CDC.

I found in the Libstock a lib with USB CDC descriptor, I think that this aplication was made by you, I am not sure. I can see that this lib is wrote in Pascal and I tried to modify to mikro basic but I have no sucess.

My question is if somebody has USB CDC descriptor to mikrobasic pro dspic 24f family.

Best regards

Prof. Wagner

Dany
Posts: 3854
Joined: 18 Jun 2008 11:43
Location: Nieuwpoort, Belgium
Contact:

Re: Descriptor USB CDC for mikrobasic

#4 Post by Dany » 12 Dec 2012 18:56

Hi Prof,
Prof.Wagner wrote:I think that you didnt understand my question.
If so, then I am sorry.
Prof.Wagner wrote:I found in the Libstock a lib with USB CDC descriptor, I think that this aplication was made by you, I am not sure. I can see that this lib is wrote in Pascal and I tried to modify to mikro basic but I have no sucess.
The library USB_CDC_OA in the package mikrobasic_PIC24.mpkg (the bottom one on http://www.libstock.com/projects/view/71/usb-oa) should be perfectly usable in mikroBasic (not tested by me however). The interface (in mB) of the library can be found in the attached file. To be able to use this library you may also need others...
Prof.Wagner wrote:My question is if somebody has USB CDC descriptor to mikrobasic pro dspic 24f family.
You do not only need the CDC descriptor, you need also an USB library that is capable of processing CDC (which is rather different than HID). The mE USB library is made for HID only (as far as I can tell).
So, the answer to your question will be "no" if you want to use the mE USB HID library, "yes" if you use the library in http://www.libstock.com/projects/view/71/usb-oa, with its own type of descriptor.
Attachments
USB_CDC_OA.zip
(1.35 KiB) Downloaded 376 times
Kind regards, Dany.
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)

Prof.Wagner
Posts: 126
Joined: 25 Mar 2011 04:35

Re: Descriptor USB CDC for mikrobasic

#5 Post by Prof.Wagner » 10 Jan 2013 20:21

Hi Danny,

I installed your library, but I can not understand how to assembly the routines to read and write in USB CDC.

In my another project I put the USB HID descriptor in the beginning of the program and use the commands USB_INT, USB_read, USB_write and works very well.

What different would be to use the USB CDC?

I developed a product for PIC 18F4550 interface USB CDC with other basic compiler (Proton) and the above process is the same for the USB HID mikroeletronika. They worked very good.

I do not wanna use the BASIC PROTON more, I want to use MIkrobrasic so please,could you help me and show me the way to use your library properly?

thank you

Prof. Wagner

Dany
Posts: 3854
Joined: 18 Jun 2008 11:43
Location: Nieuwpoort, Belgium
Contact:

Re: Descriptor USB CDC for mikrobasic

#6 Post by Dany » 11 Jan 2013 17:11

Prof.Wagner wrote:Hi Danny,

I installed your library, but I can not understand how to assembly the routines to read and write in USB CDC.

In my another project I put the USB HID descriptor in the beginning of the program and use the commands USB_INT, USB_read, USB_write and works very well.

What different would be to use the USB CDC?

I developed a product for PIC 18F4550 interface USB CDC with other basic compiler (Proton) and the above process is the same for the USB HID mikroeletronika. They worked very good.

I do not wanna use the BASIC PROTON more, I want to use MIkrobrasic so please,could you help me and show me the way to use your library properly?

thank you

Prof. Wagner
Hi Prof, at this moment there are some problems when using mP libraries (.mcl files) with mB (at least with my environment there are). So, I think you should better wait until I know where the problems come from. Sorry. :?

To answer your question: You can find the CDC USB descriptor in the project "USB_CDC_Project_Example", file "USB_CDC_ProjectItems" in the "Examples" directory of the package. This discriptor is written in mikroPascal, so you will have to translate it to mikroBasic, that should not be so hard to do.
Do not forget to install the drive (usbser.sys and .inf file) before you try to connect your CDC device to the PC.
I want to use Mikrobrasic so please,could you help me and show me the way to use your library properly?
Look to the mikroPascal example, translate it to mikroBasic. See also the file "USB_CDC_Library_Details.htm" for the library usage.
Kind regards, Dany.
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)

Prof.Wagner
Posts: 126
Joined: 25 Mar 2011 04:35

Re: Descriptor USB CDC for mikrobasic

#7 Post by Prof.Wagner » 11 Jan 2013 19:49

Hi Danny,

I am going to USA to training in the company that I work. When I return I will check your explanations.

Thank you a lot.

Prof. Wagner

Post Reply

Return to “mikroBasic PRO for dsPIC30/33 and PIC24 General”