USBDemo, something to learn USB a little bit


Closed Thread
Results 1 to 40 of 279

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    Apparently, I missed the CONFIG2L.
    I always miss that one, weird ...
    Code:
       __CONFIG    _CONFIG2L, _PWRT_ON_2L & _BOR_OFF_2L & _VREGEN_ON_2L
    And try the HIDmonitor program from the .zip

    When I said it works with Steve's original program, well it will, but it's not set up to send/receive the same analog values and switches/LED's. With HIDmonitor you should see when it connects and what data it's sending.

    hth,
    DT

  2. #2
    Join Date
    Mar 2009
    Location
    Colorado
    Posts
    378


    Did you find this post helpful? Yes | No

    Default Made config change..compiles, nothing happening

    [QUOTE=Darrel Taylor;80452]Apparently, I missed the CONFIG2L.
    I always miss that one, weird ...
    Code:
       __CONFIG    _CONFIG2L, _PWRT_ON_2L & _BOR_OFF_2L & _VREGEN_ON_2L
    I made this _CONFIG change in the code. Compiles/assembles OK and appears to program the 18F4550 OK.

    And try the HIDmonitor program from the .zip

    When I said it works with Steve's original program, well it will, but it's not set up to send/receive the same analog values and switches/LED's. With HIDmonitor you should see when it connects and what data it's sending.
    Tried both your HIDmonitor and Steve's VB6 routine after programming and power/resetting the 18F4550 . Although I hear a low "click" and see the USB icon appear in my WINDOWS tray when the USB cable is connected from the PC, I don't see any indication of the connection on the HIDmonitor or on Steve's VB6. And the USB icon disappears out of the tray about 10 secs after the next keyboard key or mouse button is pressed with no audible "click". Nor do I hear another "click" or see any visual indication of disconnect when USB cable is disconnected. Nor is there any indication of any communications on either the HIDmonitor or the VB6 window.

    Do you have any suggestions how I might monitor what is happening in the code while running so I can debug? I don't have a usable ICD.
    Last edited by jellis00; - 5th November 2009 at 19:22. Reason: Add sentence

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


    Did you find this post helpful? Yes | No

    Default

    Before I posted last time, I copied your program to MCS, added the config2L and changed my crystal to 8mhz.

    It fired right up, and is still connected now.
    It shows up as DT_HID (001) in HIDmonitor.

    Do you have anything on RB0, RC1 or RC2.
    I've got some Status outputs to LED's on those pins, that shows when it's connected and when it sends/receives data.

    You did have the hardware working before right?
    <br>
    DT

  4. #4
    Join Date
    Mar 2009
    Location
    Colorado
    Posts
    378


    Did you find this post helpful? Yes | No

    Default Working!..a couple of more questions.

    Quote Originally Posted by Darrel Taylor View Post
    Do you have anything on RB0, RC1 or RC2.
    I've got some Status outputs to LED's on those pins, that shows when it's connected and when it sends/receives data.<br>
    Thanks, Darrel...this led me to the problem. The EasyPic6 has dip-slide switches that let you connect LEDs to the A/E, B, C, and D ports for troubleshooting. I had the switch selected for Ports B and C. When I finally realized I needed to shut them off everything started working properly.

    However, one question. I notice while running MisterE's VB6 monitor side-by-side with your DT_HID monitor I see the Rx data showing some variances. I have attached a screen-snapshot of this so you can see.

    Notice in the screen snapshot that when when AN=123, AN0= 1023; when AN=51, AN0=510, and when AN=-4, AN0=0. Since both are receiving the same data as transmitted by the PIC, shouldn't the displayed values be equal in both monitors??? Don't understand this. Can you explain for me??

    My next step is to figure out how to capture what appears in the DT_HID Rx data window into a text file or better yet into a spreadsheet. Any suggestions as to how to do this in the DT_HID code?,
    Attached Images Attached Images  

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


    Did you find this post helpful? Yes | No

    Default

    Great, I thought I lost you.

    The program is sending different data than mister-e's PC program is expecting.
    I guess my example was off thread, and I should make an example that does work with his GUI.

    My next step is to figure out how to capture what appears in the DT_HID Rx data window into a text file or better yet into a spreadsheet. Any suggestions as to how to do this in the DT_HID code?,
    In Delphi sure ... can't help with Visual Basic though.

    It may even be easier with CDC and Hyperterminal.
    Outputting the data in CSV format from the PIC, and capturing it with the terminal, makes it real easy to import into excel. But it does require user intervention.
    If it's has to be automatic, HID's the way, whether it's DDE exchanges, or saving the file and importing to excel.

    Anyhow, I'll go make a more appropriate demo for Steve's GUI.

    BBL,
    DT

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


    Did you find this post helpful? Yes | No

    Default

    OK, this program should work with Steve's original USBDemo GUI.

    18F2550/4550, 8Mhz, DT_INTS-18, DT_HID260.

    Cheers,
    Attached Files Attached Files
    DT

  7. #7
    Join Date
    Mar 2009
    Location
    Colorado
    Posts
    378


    Did you find this post helpful? Yes | No

    Default Data from PIC works...data to PIC doesn't

    Quote Originally Posted by Darrel Taylor View Post
    OK, this program should work with Steve's original USBDemo GUI.
    Darrel,
    Everything compiles/assembles/programs in my EasyPic6 configuration with 18F4550 (8 MHz crystal), and it does run with Steve's VB6 GUI, but only for data from the PIC....data to PIC side of the GUI doesn't work. I double checked that I didn't have anytheng on the EasyPic6 connected to the pins you are using. See attached screen snapshot of the VB6 GUI that shows what is working and what isn't.

    I also notice that when I remove the comments on the DEFINE statements for the status LEDs that they do not light during the PLUGGED, TX or RX actions are supposedly taking place that they are suppose to indicate.

    I looked at your code and I couldn't see where the problem is. Any ideas??
    Attached Images Attached Images  
    Last edited by jellis00; - 10th November 2009 at 20:24. Reason: Added comments re: status LEDs

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