USBDemo, something to learn USB a little bit


Closed Thread
Results 1 to 40 of 279

Hybrid View

  1. #1
    Join Date
    Oct 2007
    Posts
    26


    Did you find this post helpful? Yes | No

    Default

    I am using the 18F4550 pic, Picbasic Pro 2.50 and MicroCode Studio Plus 3.0.0.5

    When I compile it gives the following errors.

    Error[118] c:\progr~1\mecani~1\mcs\usbdemo.asm 87 : Overwriting previous address contents (0000)
    Error[118] c:\progr~1\mecani~1\mcs\usbdemo.asm 87 : Overwriting previous address contents (0001)
    Error[118] c:\progr~1\mecani~1\mcs\usbdemo.asm 93 : Overwriting previous address contents (0000)
    Error[118] c:\progr~1\mecani~1\mcs\usbdemo.asm 93 : Overwriting previous address contents (0001)
    Error[118] c:\progr~1\mecani~1\mcs\usbdemo.asm 98 : Overwriting previous address contents (0002)
    Error[118] c:\progr~1\mecani~1\mcs\usbdemo.asm 98 : Overwriting previous address contents (0003)
    Error[118] c:\progr~1\mecani~1\mcs\usbdemo.asm 99 : Overwriting previous address contents (0004)
    Error[118] c:\progr~1\mecani~1\mcs\usbdemo.asm 99 : Overwriting previous address contents (0005)
    Error[118] c:\progr~1\mecani~1\mcs\usbdemo.asm 100 : Overwriting previous address contents (0006)
    Error[118] c:\progr~1\mecani~1\mcs\usbdemo.asm 100 : Overwriting previous address contents (0007)

    Are these errors anything to be concerned with?

    Also out of interest, I am using a 4Mhz Resonator but in the code it is: DEFINE OSC 48

    What is that about?

    However, I seem to be making progress because when I plug it into the USB of the computer. I get the message found new hardware "USB Demo" but then it gives a message There were problems ........ etc etc.

    The VB Application is not picking it up yet.

  2. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by kiwipiper View Post
    When I compile it gives the following errors.

    Error[118] c:\progr~1\mecani~1\mcs\usbdemo.asm 87 : Overwriting previous address contents (0000)
    ...
    What to do if i get "overwriting previous address content" error message?
    http://www.picbasic.co.uk/forum/showthread.php?p=6775

    Also out of interest, I am using a 4Mhz Resonator but in the code it is: DEFINE OSC 48

    What is that about?
    The 18F/USB PIC's have an amazing oscillator/PLL structure.

    With the proper CONFIG settings, You can use any crystal that's a multiple of 4mhz (4,8,12,16,20) and still have a system clock of 48mhz.

    If the timing doesn't work well with your program, you can also have 48mhz going to the USB module, and 4/8/12/16/20/24/32 mhz going to the system clock.

    It all depends on the CONFIG's.
    <br>
    DT

  3. #3
    Join Date
    Oct 2007
    Posts
    26


    Did you find this post helpful? Yes | No

    Default

    I commented out the four offending lines in the 18F4550.INC file and now don't get any errors. However, still get a error message from windows when I attach the PIC

    Messages are: Found New Hardware. USB Device
    USB Human Interface Device
    A problem occurred during hardware installation. Your new hardware might not work properly.

    I have tried USBDemo.exe and HIDmonitor.exe neither of these seems to see the PIC.

    Any suggestions as to what I should try to do now to find the fault. At this stage I have not connected the push buttons or the trim pot to the breadboard but this shouldn't affect the pic being recognised as a USB device.

    P.S. I have the USB connected to 18F4550 in the following way. D- to pin 23, D+ to pin 24 and the -ve usb connection and the USB case connected to vss. I have not connected the +ve usb connection to anything.
    Last edited by kiwipiper; - 25th January 2008 at 02:20.

  4. #4
    Join Date
    Oct 2007
    Posts
    26


    Did you find this post helpful? Yes | No

    Smile

    Forget my last I have figured it out ....... a very happy man here.

    I had left out the .47uF cap on Vusb. Connected this and all is working.

    Will now have a serious play with it, which I sure will create a bunch more questions.

    Thanks for all your help Darrel.

  5. #5
    Join Date
    Oct 2007
    Posts
    26


    Did you find this post helpful? Yes | No

    Default

    This One for Darrel Taylor. My question is how did you get on modifying the USBDemo program from VB to Delphi. I am much more comfortable working in Delphi than VB and would be really interested in any examples of Delphi Code for this project. I found a good component at http://www.soft-gems.net/index.php?o...d=14&Itemid=33 and have had some success in using it to connect to my PIC but my limited programming ability slows me down a fair bit, although I am learning a lot. If I had a working example in Delphi I am sure it would help me understand what is going on much better.

    A second question is how do you put a serial number into the program. I have been playing around with the DESCUSBDemo.asm
    file and tried to put a serial number into the code. Here is what I did:

    ; serial number
    String3
    retlw (String4-String3)/2
    retlw DSC_STR

    retlw '4'
    retlw 0x00
    retlw '3'
    retlw 0x00
    retlw '2'
    retlw 0x00
    retlw '0'
    retlw 0x00
    retlw '8'
    retlw 0x00
    retlw '8'
    retlw 0x00
    retlw '8'
    retlw 0x00

    Not working. Any suggestions.

  6. #6
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Both questions can be answered with EasyHID.

    The serial number is entered on one of the setup screens.

    And EasyHID will make a "Starting" program for either VB or Delphi.
    <br>
    DT

  7. #7
    Join Date
    Oct 2007
    Posts
    26


    Did you find this post helpful? Yes | No

    Default

    Thanks for that Darrel .... I did not understand the significance of EasyHID when it was being discussed in this thread earlier on. Making some real progress now and think I should be able to recreate the VB USBDemo.exe in Delphi. Very exciting stuff this USB.

Similar Threads

  1. Bits, Bytes Words and Arrays
    By Melanie in forum FAQ - Frequently Asked Questions
    Replies: 24
    Last Post: - 14th June 2016, 08:55
  2. How to receive stream of bytes using PIC USART
    By unifoxz in forum mel PIC BASIC Pro
    Replies: 34
    Last Post: - 20th June 2009, 11:38
  3. Replies: 9
    Last Post: - 31st July 2008, 09:56
  4. PICBasic newbie problem
    By ELCouz in forum mel PIC BASIC Pro
    Replies: 32
    Last Post: - 12th February 2008, 01:55
  5. USART interrupt not interrupting right
    By Morpheus in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 6th March 2005, 02:07

Members who have read this thread : 1

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

Tags for this Thread

Posting Permissions

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