New USB Device Library Released!

General discussion on Libstock website & codes posted on this website.
Author
Message
p.erasmus
Posts: 3391
Joined: 05 Mar 2009 10:28

Re: New USB Device Library Released!

#16 Post by p.erasmus » 25 Mar 2013 13:18

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
P.Erasmus
Saratov,Russia
--------------------------------------------------------------

erpay
Posts: 32
Joined: 11 Nov 2012 00:03

Re: New USB Device Library Released!

#17 Post by erpay » 25 Mar 2013 20:33

Thanks :) What about dsPic and pic24 ?

gabs
Posts: 10
Joined: 05 Jul 2011 15:58

Re: New USB Device Library Released!

#18 Post by gabs » 26 Mar 2013 08:50

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
Best regards

User avatar
dejan.odabasic
mikroElektronika team
Posts: 2649
Joined: 30 Apr 2012 14:20

Re: New USB Device Library Released!

#19 Post by dejan.odabasic » 26 Mar 2013 09:02

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.

gabs
Posts: 10
Joined: 05 Jul 2011 15:58

Re: New USB Device Library Released!

#20 Post by gabs » 26 Mar 2013 09:17

Hello Dejan

The compiler is mikroBasic PRO for Pic32 v3.3.0

Thank you.
Best regards

User avatar
dejan.odabasic
mikroElektronika team
Posts: 2649
Joined: 30 Apr 2012 14:20

Re: New USB Device Library Released!

#21 Post by dejan.odabasic » 26 Mar 2013 09:50

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.

gabs
Posts: 10
Joined: 05 Jul 2011 15:58

Re: New USB Device Library Released!

#22 Post by gabs » 26 Mar 2013 18:49

Hi Dejan

thanks for the tip, that did the trick :D
Best regards

Const50
Posts: 124
Joined: 28 Oct 2010 15:08
Location: West Siberia, Tomsk

Re: New USB Device Library Released!

#23 Post by Const50 » 28 Mar 2013 10:40

Congratulation!
But how to implement it in compiler?

User avatar
dejan.odabasic
mikroElektronika team
Posts: 2649
Joined: 30 Apr 2012 14:20

Re: New USB Device Library Released!

#24 Post by dejan.odabasic » 28 Mar 2013 10:45

Hello,

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

Best regards.

Const50
Posts: 124
Joined: 28 Oct 2010 15:08
Location: West Siberia, Tomsk

Re: New USB Device Library Released!

#25 Post by Const50 » 28 Mar 2013 12:12

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?

Toley
Posts: 922
Joined: 03 Sep 2008 16:17

Re: New USB Device Library Released!

#26 Post by Toley » 28 Mar 2013 12:57

Open the exemples then you'll see what is required.
Serge T.
Learning is an endeless process but it must start somewhere!

Const50
Posts: 124
Joined: 28 Oct 2010 15:08
Location: West Siberia, Tomsk

Re: New USB Device Library Released!

#27 Post by Const50 » 28 Mar 2013 13:17

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?

User avatar
anikolic
mikroElektronika team
Posts: 1775
Joined: 17 Aug 2009 16:51
Location: Belgrade
Contact:

Re: New USB Device Library Released!

#28 Post by anikolic » 12 Apr 2013 15:09

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.
Web Department Manager

lpmsr
Posts: 117
Joined: 17 Jul 2009 02:10

Re: New USB Device Library Released!

#29 Post by lpmsr » 14 Apr 2013 20:24

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?
Last edited by lpmsr on 14 Apr 2013 20:33, edited 1 time in total.

LGR
Posts: 3204
Joined: 23 Sep 2004 20:07

Re: New USB Device Library Released!

#30 Post by LGR » 14 Apr 2013 20:26

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.
If you know what you're doing, you're not learning anything.

Post Reply

Return to “Libstock Discussion”