Troubleshooting USB communications on 18F2550

General discussion on mikroC.
Post Reply
Author
Message
BlackBird
Posts: 6
Joined: 22 Jun 2010 22:19

Troubleshooting USB communications on 18F2550

#1 Post by BlackBird » 30 Jun 2010 05:09

Hi

I have some questions related to HID library on Mikroc 8.2 compiler and to HID terminal also.
It suposes the host can initiate the communication process with a Device and it can do that by interruption signal or message, isn't it?
As far as I see in the HDI library does not exist a function that handles this event, so the user has to write it?
The function HID_Enable prepares de USB to get interruptions ?
How to test if the USB device port is attached to the host port?
Another fact is the HID can transmit or receive data on 2 modes- Control or by Interruptions - How do I know in wich mode I'm transmiting and how to switch from one to another one.

Seeking hints on the mikroC examples I`ve found a function named "HID_InterruptProc();" it appears at the interrupt section of program - Where can I see the source code of this function?

On the last place I would like to read about how to use the HID terminal. I think it is very intuitive on use, but I`m new to USB and feel myself a bit insecure yet on this field, so if there is an article or notes talking on how to use that terminal eficiently I would appreciate it if you show where.

Kind regards, :mrgreen:

User avatar
tihomir.losic
mikroElektronika team
Posts: 2138
Joined: 02 Dec 2009 14:16
Location: Serbia
Contact:

Re: Troubleshooting USB communications on 18F2550

#2 Post by tihomir.losic » 19 Jul 2010 12:59

BlackBird wrote:I have some questions related to HID library on Mikroc 8.2 compiler and to HID terminal also.
Hello,

first of all, I want to recommend you the newer version of our mikroC compiler:
mikroC PRO for PIC: http://www.mikroe.com/eng/downloads/get ... _setup.zip
It suposes the host can initiate the communication process with a Device and it can do that by interruption signal or message, isn't it?
Example HID Read Write Interrupt
This example establishes connection with the HID terminal that is active on the PC. Once the connection is established,
the HID Device Name will appear in the respective window. USB servicing is done inside the interrupt.
As far as I see in the HDI library does not exist a function that handles this event, so the user has to write it?
USB_Interrupt_Proc
This routine is used for servicing various USB bus events. It should be called inside USB interrupt routine. Do not use this function with USB_Polling_Proc, only one should be used.
To enable servicing through interrupt, USB_INTERRUPT constant should be set (it is set by default in descriptor file).
The function HID_Enable prepares de USB to get interruptions ?
Enables USB HID communication, and this function needs to be called before using other routines of USB HID Library.
How to test if the USB device port is attached to the host port?
In our tool HID terminal, your HID device will be listed with other USB devices attached to your computer.
Seeking hints on the mikroC examples I`ve found a function named "HID_InterruptProc();" it appears at the interrupt section of program - Where can I see the source code of this function?
Our source codes are not open source and they are not available for viewing or editing.
Our libraries come with our compilers in compiled form (source code hidden). We decided to do this because if we allow our costumers to change source codes we would not be able to provide technical support for it.
You can, however, search throughout Forum where some pieces of our libraries are posted for viewing, so you may be able to find what you are looking for.
On the last place I would like to read about how to use the HID terminal. I think it is very intuitive on use, but I`m new to USB and feel myself a bit insecure yet on this field, so if there is an article or notes talking on how to use that terminal eficiently I would appreciate it if you show where.
For now, all available information about our tools is on this page:
http://www.mikroe.com/esupport/index.ph ... ticleid=17, but we are working on revision of our help files and other guides,
and I hope that we will have little more documentation about every of our tool.

Best regards,

Losic Tihomir
mikroElektronika [Support team]

Post Reply

Return to “mikroC General”