EasyHID and USB for Newbies?? - Page 2


Closed Thread
Page 2 of 2 FirstFirst 12
Results 41 to 69 of 69
  1. #41
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,961

    Default

    I had tried with VB Express but had quickly ditched it for VB6 from EBay. There were several things about VB Express; it lacks several features like Package Deployment which I require. I don't remember all the other reasons why I dropped it, but I "REALLY" didn't like it.

    Check out EBay for VB6, there were several cheap auctions for the academic versions of VB6. I ended up getting the full corporate version for just a bit more, with all the manuals and tutorials.


    Here's a NEW package for $125USD:
    http://cgi.ebay.ca/ws/eBayISAPI.dll?...m=160004563299

    This kit includes:
    *Microsoft Visual Basic 6.0 Learning Edition
    *Learn Microsoft Visual Basic 6.0 Now
    *Microsoft Visual Basic 6.0 step by step
    *Microsoft Visual Basic 6.0 Programmer's Guide
    *The MSDN Library on two CD-ROMs


    Some more learning editions:
    http://cgi.ebay.ca/ws/eBayISAPI.dll?...m=250004751173
    http://cgi.ebay.ca/ws/eBayISAPI.dll?...m=160005627793


    Here's a professional edition:
    http://cgi.ebay.ca/ws/eBayISAPI.dll?...m=300005730012

    The action includes:
    Microsoft Visual Basic 6.0 Professional Edition. One CD in Original Case.
    Microsoft Visual Studio 6.0 Service Pack 5.0 One CD in a jewled case.
    MS MSDN Libray-Visual Studio 6.0. 2 CDs in the original case.
    MS Visual Studio 6.0 PLUS PACK. 4 CDs in the original case.
    These are the full functional sets, not educational settings or demos.

    Good luck!

    Robert
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

  2. #42
    Join Date
    Feb 2005
    Location
    Essex, UK
    Posts
    94

    Default Easy Hid Problems

    Hi,

    I suspect a lot of you that have posted on this thread are subscribed to it. I'm having problems with Easy HID and have posted a new subject. Obviously a lot of you guys have used it and I'm wondering what I'm doing wrong. Please chack my post out - it's driving me mad:

    http://www.picbasic.co.uk/forum/showthread.php?t=4304

    I am ONLY having problems with the PIC program on compile

    Thanks a lot

    Rob

  3. #43
    skimask's Avatar
    skimask Guest

    Default VB6 vs. VB Express

    I just got an started using VB Express. Yes, it's a bit different, but it works great. You do have to learn a new way of writing things, but it's "the new way of doing things" according to Micro$oft.

    If you use the "Upgrade Wizard", you can take your older VB6 type programs and import them into VB Express without much problem at all. VB Express uses a bunch of compatibility files to make it work with the old code just fine. Took me about 2 minutes to get an old serial port program with with VB Express...and the price was right too...
    JDG

  4. #44
    bigbear's Avatar
    bigbear Guest

    Default

    I am working to convert the VB file from easyHID to a REALBASIC file. I am almost there but need some help. Anyone here do anywork in realbasic? You can check out the thread here:

    http://forums.realsoftware.com/viewt...b170185ab69b24

    I will post the files for anyone who wants them when the conversion is done. Advantage of RB is it compiles into Windows, Mac OS, and Linix. Not sure if the app will work in non windows apps, but I'll find out. Looks like it should work.

  5. #45
    bigbear's Avatar
    bigbear Guest

    Default

    Also ordered free samples from microchip! Great deal!!!!!

  6. #46
    bigbear's Avatar
    bigbear Guest

    Default

    Do you guys recommend PicBasic or PIcbasic PRO? I know pro is better, but do I need it?

  7. #47
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898

    Default

    It's up to you to decide but for the price difference between the two... it worth to invest a bit much and save tons of headaches... even if Aspirins, Advil or else are cheap
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  8. #48
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,961

    Default

    Quote Originally Posted by bigbear
    Do you guys recommend PicBasic or PIcbasic PRO? I know pro is better, but do I need it?
    It depends on what you want to do. Take a look at the commands available in each and decide:
    http://www.melabs.com/resources/pbpmanual/
    http://www.melabs.com/resources/pbcmanual/

    Robert
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

  9. #49
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,961

    Default

    Quote Originally Posted by sean-h
    Hi rocky
    ...
    USBBufferSizeMax con 64 ' maximum buffer size
    USBBufferSizeTX con 64 ' input
    USBBufferSizeRX con 64 ' output

    I think min is 8 bytes and max 64.
    ...
    Sean.
    Nope, 1 to 64 bytes for both input and output buffers according to EasyHID help files under Configuration Details.

    Robert
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

  10. #50
    bigbear's Avatar
    bigbear Guest

    Default

    Is there somewhere that I can see a list of the assembly codes for a PIC such as the 18F4550? From what I understand there are not a huge list of them. It has been a while since I did assembler, but I would like to have the ability to combine PBP and assembler.

  11. #51
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,961

    Default

    You'll have better luck getting an answer to an Assembler-related question if you start a new thread in the General forum:
    http://www.picbasic.co.uk/forum/forumdisplay.php?f=7

    This thread is about EasyHID and interfacing via USB.

    Robert
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

  12. #52
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898

    Default

    Quote Originally Posted by bigbear
    Is there somewhere that I can see a list of the assembly codes for a PIC such as the 18F4550? From what I understand there are not a huge list of them. It has been a while since I did assembler, but I would like to have the ability to combine PBP and assembler.
    you can mix both of them using ASM and ENDASM. You can have the asm list if you open the .COD file or the .LST file
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  13. #53
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,961

    Default

    Ok, I've reread this thread hoping to find a hint why the device is not recognized by windows.

    I had it working using HIDMaker FS, but I'm trying to use EasyHID since the resulting code is MUCH more compact. Here's what I've done so far:

    - generated code with EasyHID, 1 byte to PC, 30 bytes to PIC.
    - modified generated PBP program to include an LCD, that works great.
    - move MCHID.dll to VB6 working folder.
    - compiled the generated VB code using VB6.
    - started up the executable.
    - reset the PIC and that's when the error appears in Windows.

    Can the generated VB6 code work without doing any input or output? I was trying to just get a skeleton VB6 program working first, and then add 1 feature at a time.

    Robert
    Last edited by Demon; - 17th August 2006 at 01:12.
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

  14. #54
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898

    Default

    Sure the VB program can work without any in/out.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  15. #55
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,961

    Default

    Well that's good news.

    One thing that I find strange is that I don't get the same number of generated files between each software. I would have expected that both would have to override the same number of files.

    EasyHID:
    - DESCProject.ASM
    - USBDESC.ASM
    - Project.ASM
    - Project.PBP

    HIDMaker:
    - descript.ASM
    - usb18.ASM
    - usb18.INC
    - usb18mem.ASM
    - usbdesc.ASM
    - Project.BAS

    Is that normal?

    Robert
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

  16. #56
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898

    Default

    sure it is as log it's two diferent company.

    Let's see a common example.. Darrel's codes have more INCLUDE than mine and all other folks here... is it normal? Sure
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  17. #57
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,961

    Default

    Yup, the includes are normal. I compiled the original generated code from EasyHID and the device is recognized. I'm in the process of trying to get an interrupt working for USBSERVICE. After that I'll add basic I/O between the PC and PIC and then I'll post the results.

    Robert
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

  18. #58
    bigbear's Avatar
    bigbear Guest

    Default

    I have converted the easy HID VB template to a RealBasic Template, and it was tested by Sean (thanks again) and it works. You can download the template here.

    http://www.members.cox.net/walachcnc/usb.html

  19. #59
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,961

    Default

    Quote Originally Posted by sean-h
    Using easyhid is not that bad.

    ...

    If you wanted to receive say 10 bytes ... Just tell it to jump off to that routine and as soon as data is received it will come back from that routine with the usbbuffer(0) to usbbuffer(63) filled as such.
    So if your PC sent 10 bytes then the variables usbbuffer(0-9) will hold those 10 bytes, if your pc sent 20 bytes then usbbuffer(0-19) will hold those bytes.

    ...

    Hope this helps.

    Regards Sean.

    (yup, I saw the correction in another post about byte 0 containing the endpoint and the data being in bytes 1 to 10.)


    So if I understand this properly, we don't have to worry about any of the USB registers when we receive data. I assume this is all done by the generated assembler code?

    The important thing is for us to know the exact length of our transferred data and that's it. We don't need any interrupt either, the USBIN command will execute until all the bytes are received (returning to the label DoUSBIn until complete).

    That leaves one thing, how do we handle an error? Are we to assume everything will always work? Are there flags provided by the assembler routines? Or are we supposed to use the USB error registors described in the PIC datasheet?

    Robert
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

  20. #60
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898

    Default

    Quote Originally Posted by rocky79 View Post
    I am using easyHID sofware to generate a Visual basic code 6.0. I have the visual basic .net installed. So when i copy the file from vb.6 to vb.net , Vb.net upgrades the file to the .net configuration.Except for one thing that gave me an error:it's the upgrade warning about adding a delegate.

    I couldn't figure out how to fix it, Any idea??
    Sorry for the about 1 year later reply but anyways, this will be handy for new VBExpress 2005 user... probably .NET ones too.

    Today, while trying to port USBDemo From VB6 to VBExpress, i came across the same issue. The simple fix is to add those 2 lines bellow in the mcHIDInterface.vb module, right under all Declare statement
    Code:
        '
        '   adding delegate to suite VBExpress 2005 requirement
        '   ===================================================
        Delegate Function SubClassProcDelegate(ByVal hwnd As Integer, ByVal msg As Integer, ByVal wParam As Integer, ByVal lParam As Integer) As Integer
        Declare Function SetWindowLong Lib "USER32.DLL" Alias "SetWindowLongA" (ByVal hwnd As Integer, ByVal attr As Integer, ByVal lVal As SubClassProcDelegate) As Integer
    HTH
    Last edited by mister_e; - 27th May 2007 at 23:07.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  21. #61
    T.Jackson's Avatar
    T.Jackson Guest

    Post

    .net No way for me! I will be using .com (VB5 & 6) for life. There will always be backwards compatibility for .com, no matter what. Out of interest, even the latest versions of MS Office still use .com Microsoft will never completely abandon .com, willing to bet my life on it.

  22. #62
    Join Date
    Apr 2008
    Posts
    3

    Unhappy

    Like a lot of you I’m just starting to migrate some of my applications to USB. I’ve tried to us EasyHID to help me get started. I’ve read threw this post and it makes sense what I’m reading. My problem is that when I try to compile the PBP file it creates I get the compilation error

    ERROR: Macro USBINIT? not found in macro file.
    ERROR: Macro USBSERVICE? not found in macro file.
    ERROR: Macro USBIN?CBBL not found in macro file.
    ERROR: Macro USBOUT?CBBL not found in macro file.

    I’ve seen several posts’ that ask this question and I haven’t seen a good answer to what is causing it and how to fix it. I suspect it has to do with directory structure.

    I’m using MCSP 3.0.0.5 and PBP 2.47.
    PIC18F4550

    Please help,

  23. #63
    Join Date
    Feb 2005
    Location
    Essex, UK
    Posts
    94

    Default

    Hi mjwaldner,

    Using Microcode Studio, make sure you have the correct chip selected, 18F4550. The editor sometimes defaults to a different IC when you open it - this has caught me out a couple of times!

    Make sure that all the files that were generated by EasyHID are in the same folder as the file you are trying to compile - see attached image

    Let us know how you get on

    Cheers

    Rob
    Attached Images Attached Images  

  24. #64
    Join Date
    Apr 2008
    Posts
    3

    Red face

    Thanks Rob,
    I started over form scratch and it worked this time. I must have moved something to the wrong directory.
    My next question is. Should the computer recognize the USB device and try to install it automatically? I understand that I will need to work on the PC software to make it work but when I plug the USB cable into the PC nothing happens. It doesn’t try to install. I haven’t modified the software the Easy HID created. I just programmed it to the PIC 18F4550. Is there more code needed to initialize it.
    I’m just taking baby steps threw this. Any information is helpful.
    Thanks
    Matt

  25. #65
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898

    Default

    In case it have already worked and if you haven't change the PID, VID and all other settings, if you plug the device you're not going to have any bubbles on the task bar.

    If you want some, you'll need to uninstall the device. That's pretty easy to do with USBDeview
    http://www.nirsoft.net/utils/usb_devices_view.html
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  26. #66
    Join Date
    Apr 2008
    Posts
    3

    Default

    I found out what was going wrong. It was a hardware problem. I did not turn on the USB Voltage Regulator in the melabs programmer. So now my PC is recognizing the USB HID.
    The problem I’m having now is that I can’t seem to get any data from the PIC to the VB.Net application. My VB application is recognizing that the device is plugged in or unplugged but nothing else. The application never seems to jump into the OnRead event.
    I must be missing something. What tells the VB aplication to jump to the OnRead event?

    Any suggestions.
    Thanks,
    Matthew

    This is what I have.
    Code:
     
    VB.Net----------------------------------------------------------------
        '*****************************************************************
        ' on read event...
        '*****************************************************************
        Public Sub OnRead(ByVal pHandle As Integer)
    
            ' read the data (don't forget, pass the whole array)...
            If hidRead(pHandle, BufferIn(0)) Then
                ' ** YOUR CODE HERE **
                ' first byte is the report ID, e.g. BufferIn(0)
                ' the other bytes are the data from the microcontrolller...
                TextBox1.Text = Chr(Val(BufferIn(1)))
            End If
        End Sub
    
    PICB----------------------------------------------------------------------
    
    ' ************************************************************
    ' * main program loop - remember, you must keep the USB      *
    ' * connection alive with a call to USBService every couple  *
    ' * of milliseconds or so...                                 *
    ' ************************************************************
    usbinit ' initialise USB...
    ProgramStart: 
       gosub DoUSBIn
    USBBuffer(0)=32
    USBBuffer(1)=16
       gosub DoUSBOut
       goto ProgramStart

  27. #67
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898

    Default

    Comment out the GOSUB DoUSBIn and see if works better.

    I suggest you to have a look on USBDemo.
    http://www.picbasic.co.uk/forum/showthread.php?t=5418

    Maybe this one too
    http://www.picbasic.co.uk/forum/showthread.php?t=6463&
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  28. #68
    Join Date
    Nov 2015
    Posts
    13

    Default Re: EasyHID and USB for Newbies??

    Hello. I'm making a program who include easyhid for the 18f4550 but I have some questions:
    I want to pass 10 decimal 2 digit variables and 11 bit variables from the PIC to the PC, then something simmilar in return. Do the usb buffers support this just declaring de proper variables?
    Or I need some kind of conversion or trick?
    Thank you for your help.
    Luis

  29. #69

    Default Re: EasyHID and USB for Newbies??

    USB doesn't really work like that. The buffer is just a string of bytes, the significance is determined by your application. For instance the first byte could be the status of a LED or the first digit of a number.

    George

Similar Threads

  1. Simple USB Comms Problem
    By awmt102 in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 6th January 2010, 21:17
  2. EasyHID max usb buffer size
    By jizyjuice in forum USB
    Replies: 4
    Last Post: - 29th November 2007, 06:12
  3. Speed of USB EasyHID and Time problem
    By sjohansson in forum USB
    Replies: 10
    Last Post: - 18th January 2007, 23:21
  4. USB and EasyHID Problems
    By Rob in forum USB
    Replies: 8
    Last Post: - 6th January 2007, 19:19
  5. USB PIC without USB Connection
    By Tissy in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 26th December 2005, 18:39

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts