Help 4. Using the USB in a PIC18F2550

Discussion in 'Embedded Systems and Microcontrollers' started by KansaiRobot, Feb 1, 2010.

  1. KansaiRobot

    Thread Starter Active Member

    Jan 15, 2010
    First of all thank you very much to everybody who has helped me with my troubles both in circuits and microprocessor.

    I have to report that my system is working fine finally(I will post an update later in the other thread). I am very grateful for this.

    So far the value from the potentiometer is passed to a input pin in the microcontroller and ADC is performed. Based on this I activate my solenoid.

    Now I have a different problem. I have been asked to send and receive data from this process (ADC results, commands to send through the output pin, etc) from the PIC to a PC using the USB functions.

    Can someone point to me good examples in C from which i can learn how to use the USB of a PIC18F2550?

    Your help will be very much appreciated.

  2. KansaiRobot

    Thread Starter Active Member

    Jan 15, 2010
    Well nobody answered my last post :( I wonder why:confused:
    Hope I dont come as rude or something....

    anyway I have managed to program the PIC to give and recieve data from the PC. I am powering the system from the USB.
    My question is

    Think of the following scenario:

    One 18F2550 connected to a PC through USB.
    input circuit from a potentiometer (5v)
    output circuit involving a transistor to activate/deactivate a 5V solenoid valve that requires: 200 mA and has a power comsumption of 1.0W

    Do you think this system can be powered solely from the USB???

    What is the limit current that the USB provides?

    I have a feeling that the solenoid valve can overwhelm the circuit and make the PIC reset when turn on/off

    any comments on this???

    Thanks a thousand for any comment.

  3. n9352527

    AAC Fanatic!

    Oct 14, 2005
    The default current available is 100mA, this is using standard enumeration. The maximum current available is 500mA. But you have to ask for it by setting the appropriate descriptor values during enumeration.

    Good supply filtering will minimise the efect of the solenoid to the rest of the circuit.
  4. t06afre

    AAC Fanatic!

    May 11, 2009