Page 2 of 4

Re: New USB Device Library Released!

Posted: 25 Mar 2013 13:18
by p.erasmus
I will be the first one to lift my hat and say Thank you mE after many years of waiting it seems usb is becomeing a reality :D

Re: New USB Device Library Released!

Posted: 25 Mar 2013 20:33
by erpay
Thanks :) What about dsPic and pic24 ?

Re: New USB Device Library Released!

Posted: 26 Mar 2013 08:50
by gabs
Thanks for the library :D

I am trying to compile the example project: USB Hid Device right as it is and I have the following error:

Code: Select all

Incompatible function pointers (function prototypes do not match): R25 vs ?T27 HIDDevice.mbas
and it is pointing at :

Code: Select all

USBDev_RegisterDataReceivedHandler(@USBDev_HIDReceivedPacketHandler)
in the following sub:

Code: Select all

' Registering callback functions
sub procedure USBDev_HIDInit()
  USBD_HID_Protocol = 0
  USBD_HID_IdleState = 0
  USBD_HID_AltSet = 0
  USBDev_RegisterDataReceivedHandler(@USBDev_HIDReceivedPacketHandler)
  USBDev_RegisterDataSentHandler(@USBDev_HIDPacketSentHandler)
  USBDev_RegisterGetDescHandler(@USBDev_HIDGetDescHandler)
  USBDev_RegisterSetupReqHandler(@USBDev_HIDSetupHandler)
  USBDev_RegisterEventHandler(@USBDev_HIDEventHandler)
end sub
I have mention that also for the other two examples in this library I get similar "Incompatible function pointers (function prototypes do not match) :Rxx vs ?T27)" errors.

Any pointers on how to get these examples to compile?

Thanks

Re: New USB Device Library Released!

Posted: 26 Mar 2013 09:02
by dejan.odabasic
Hello,
@erpay
We are working on USB support for 16-bit MCUs and as soon as we complete all tests, we will be glad to share that information with you.

Thank you for you patience.

@ gabs
Which version of compiler are you using?

Best regards.

Re: New USB Device Library Released!

Posted: 26 Mar 2013 09:17
by gabs
Hello Dejan

The compiler is mikroBasic PRO for Pic32 v3.3.0

Thank you.

Re: New USB Device Library Released!

Posted: 26 Mar 2013 09:50
by dejan.odabasic
Hello,

I was not able to replicate issue that you reported with latest version of mikroBasic PRO for PIC32 compiler.
Please try to reinstall compiler and USB library.

Best regards.

Re: New USB Device Library Released!

Posted: 26 Mar 2013 18:49
by gabs
Hi Dejan

thanks for the tip, that did the trick :D

Re: New USB Device Library Released!

Posted: 28 Mar 2013 10:40
by Const50
Congratulation!
But how to implement it in compiler?

Re: New USB Device Library Released!

Posted: 28 Mar 2013 10:45
by dejan.odabasic
Hello,

You need to install the library package(.mpkg) using Package Manager:
http://www.mikroe.com/package-manager/

Best regards.

Re: New USB Device Library Released!

Posted: 28 Mar 2013 12:12
by Const50
After installation I have two libraries in Library Manager section, USB and USB_Device_PIC32. What library I must mark: USB, or USB_Device_PIC32, or both?

Re: New USB Device Library Released!

Posted: 28 Mar 2013 12:57
by Toley
Open the exemples then you'll see what is required.

Re: New USB Device Library Released!

Posted: 28 Mar 2013 13:17
by Const50
O'K. As I see old USB library is been doesn't used. But what for I need mark libraries C_Stllib and C_Type? What method it uses, Polling or Interrupt?
Is this procedure from Help file

Code: Select all

sub procedure USB1Interrupt() iv IVT_ADDR_USB1INTERRUPT
  USB_Interrupt_Proc()
end sub
really working?
I can't understand, allows the new library to work with Interrupt or not? In Help file I see only Polling_Proc and no Interrupt_Proc sample...



And more: Touch panel uses mouse with absolute coordinates. On the video I see it works as a mouse with relative coordinates. What's wrong?

Why do you present so complicated HID device sample program, which I (we) will use never but spend a lot of time to understand how to use USB interrupt procedure??
May be it should be much effective and simpler for use and understanding to present some source sample similar for USB_Polling_Proc in the Manual (p. 576)??

In short: how I can translate three words from a mouse to PC over USB with interrupt procedure?

Re: New USB Device Library Released!

Posted: 12 Apr 2013 15:09
by anikolic
USB Device and Host libraries for dsPIC30/33 and PIC24 released!

Image

We're happy to present you with the new USB Device and
USB Host libraries for our dsPIC/PIC24 compilers.
They are available for download on Libstock website.

Re: New USB Device Library Released!

Posted: 14 Apr 2013 20:24
by lpmsr
I would like to use a USB port in my device for both communicating with a PC application and for programming using the bootloader. Can the PIC32MX7 bootloader be used with the Fusion v7 board? It appears that the wiring is the same for the USB Device port, except for the USB-ID pin. I would like to test all my functions on one platform, emulating the final project where there will only be one USB port.

I would need bi-directional comms, like would typically be done with a UART. Are there any plans for an example which would emulate a typical serial comms scenario?

This is probably a silly question, but since I already have my PC host app written for control of the device using serial comms, is there any version of the bootloader which would work with a UART port (ie, through serial port or an FT232) instead of through native USB port?

Re: New USB Device Library Released!

Posted: 14 Apr 2013 20:26
by LGR
I just attempted to recompile the example for the LV32MX v6, and it's not working.
  • I changed the processor to PIC32MX460F512L
    I turned all the dip switches off (left) except for USB-PSW
When I plug the "USB COMM" port into the computer, Windows says that an unknown device has been connected. HID terminal doesn't recognize anything.

I tried with and without 12x USB PLL, and got the same result.

I don't see anywhere in the example code where the "USB-PSW" is referenced. On the LV32MX v6, it's at RB14. Is this the problem?

======================================

Nevermind. It works when I set USB PLL to 2x.