Need help in VB codes to detect input switch of Picdem FS USB


Closed Thread
Results 1 to 2 of 2
  1. #1
    jimmygan's Avatar
    jimmygan Guest

    Default Need help in VB codes to detect input switch of Picdem FS USB

    I have a PICDEM FS USB demo board.
    From www.comvcon.com , it explains on how to write a simple program to turn on the LED3 and LED4 of the demo board.
    but what should i do if i wan to detect the input switch as well ?

    the firmware in the PICDEM FS USB is Demo firmware, where RB5 is declared as digital input connected to switch S3. When S3 is press, the RB5 will be grounded.

    How should i write the VB program so that when i press S3 on the demo board, my VB will detect it and display something ?
    Is it possible without changing the firmware ?

    sorry...newbie here.....im still a student..

  2. #2
    comvcon's Avatar
    comvcon Guest

    Default USB Restrictions...

    Hi,

    In USB, host is always MASTER, and device is always SLAVE.

    What it means is host always need to enquire the SLAVE about the required information.
    Even to send some information to the device, the host first prepares the device for reception and then sends the data.

    So, in this context.. In UserIO routine of the Bootloader you read the Key status, and store it in variable. From host send a command to enquire about the button status. Now, let the firmware send the response to the host when this request arrives.

    Hope this helps.

Similar Threads

  1. USB CDC Communications for Dummies!
    By Squibcakes in forum USB
    Replies: 104
    Last Post: - 15th January 2014, 13:43
  2. Simple USB Comms Problem
    By awmt102 in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 6th January 2010, 20:17
  3. PICBasic newbie problem
    By ELCouz in forum mel PIC BASIC Pro
    Replies: 32
    Last Post: - 12th February 2008, 00:55
  4. PICDEM FS and USB
    By Gab25 in forum USB
    Replies: 9
    Last Post: - 28th October 2006, 18:44
  5. USB, PIC18F2550 and VB
    By Tissy in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 27th November 2005, 18:37

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