USBDemo, something to learn USB a little bit


Closed Thread
Results 1 to 40 of 279

Hybrid View

  1. #1
    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  

  2. #2
    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

  3. #3
    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

  4. #4
    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

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


    Did you find this post helpful? Yes | No

    Default

    The ones on the left require 8-LEDs on PORTB, and 2 other LEDs on the CCP outputs, RC1/RC2.

    Previously you said you disconnected the LED's to get things working with the EasyPIC.

    The USB D-/D+ are on RC4/RC5, so I don't think you can just enable the whole bank of LED's on PORTC. You'll need to attach LEDs to only the 2 CCP Pins to get the faders working. But you should be ok with LEDs on PORTB.

    HTH,
    DT

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


    Did you find this post helpful? Yes | No

    Talking Working as advertised! Another question.

    Quote Originally Posted by Darrel Taylor View Post
    The ones on the left require 8-LEDs on PORTB, and 2 other LEDs on the CCP outputs, RC1/RC2.
    The USB D-/D+ are on RC4/RC5, so I don't think you can just enable the whole bank of LED's on PORTC. You'll need to attach LEDs to only the 2 CCP Pins to get the faders working.
    Turns out you can enable all the whole bank of LED's on PORTC and it keeps working. You can then see the LEDs on RC1 and RC2 vary in brightness as you change the sliders.

    But you should be ok with LEDs on PORTB.
    Except for the LEDs on RB0, RB5, Rb6 & RB7 (which are used in your code) you can now click the check boxes on B1 thru B4 on the VB6 Gui and they work to light the corresponding LEDs.

    I now have Steve's VB6 GUI and the DT_HID monitor running side by side and everything works as advertised except for the exceptions I listed above for the B0 thru B7 check boxes. Your support to me in getting to this has been outstanding, Darrel. Thanks so much!

    Now I only have to figure out how to capture the data coming across the USB interface from the PIC into a spreadsheet. Your suggestion to use CDC and HYPERTERM would be an easier option except that my application requires a USB interface that is also used to connect to a cell phone, and I don't have physical room for both an RS232 and a USB interface within the physical board size contstraint or panel connector space. Looks like I have to figure out how to do the capture in Steve's USB VB6 GUI. I will modify the PIC side to send comman delimited data per your suggestion, but don't know how to approach capturing the comma delimited data from the VB6 USB Gui that is showing into a spreadsheet. Can you refer me to any forum ideas or reference tutorials in this area??

    Thanks again, Darrell. Your contributions & presence on this forum is what makes it worthwhile.
    Last edited by jellis00; - 11th November 2009 at 01:19.

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


    Did you find this post helpful? Yes | No

    Default

    PORTB.0 is not used anywhere in the program (other than output from the Demo).
    PORTB.5-7 are only used if the USB Status LED lines are uncommented (I left them commented). And they can be assigned to any pin, they don't have to be PORTB.5-7

    CDC is USB, there's no RS232 connector.

    In excel, use the Data | Import External Data | Import Data menu item to just plop your CSV file right into your spreadsheet. Then when the data changes, use Data | Refresh Data to update everything automatically.
    <br>
    DT

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