Results 1 to 7 of 7

Thread: com port power supply

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2006
    Posts
    3

    com port power supply

    hi there

    I am developing an application that comunicates with a PIC microcontroller (pic16f88) and my aplication is recieving data from the PIC, everything works fine, i can recive the data from the PIC and viceversa, but... when i whant to power my circuit with the lines of the com port it doesnt work.

    i try to power up the circuit by using the 7 -> RTS y 4 -> DTR pins and usin a pair of diodes (1N4148) i conect them to a voltage regulator (LM7805), i use the diodes because this lines dives voltage from -10 to +10, the thing is that this configuration diodes works, because i test the circuit with the HYPERTERMINAL program and works all right, but when i use my VB application y does not work, it is becaus one of the pins do not give me the +10 voltage instead it gives -10, but with HYPERTERMINAL both gives +10

    any idea how to solve this problem?

  2. #2
    Fanatic Member namrekka's Avatar
    Join Date
    Feb 2005
    Location
    Netherlands
    Posts
    639

    Re: com port power supply

    Enable RTS/CTS handshaking and enable DTR/DSR.
    VB Code:
    1. MSComm1.Handshaking = comRTS
    2. MSComm1.DTREnable = True
    3. MSComm1.RTSEnable = True
    Remember it only works with desktop PC's and no more then ca 5mA per pin.

  3. #3
    Hyperactive Member gtilles's Avatar
    Join Date
    Dec 2004
    Location
    Planet Earth
    Posts
    394

    Re: com port power supply

    I don't know how much current the Com Port can source but I know it is very small, I would not rely on the com port to supply power to your circuit unless you know the requirement draw is less than the source can safely supply.
    Truly, you have a dizzying intellect.

  4. #4
    PowerPoster
    Join Date
    Feb 2006
    Location
    East of NYC, USA
    Posts
    5,691

    Re: com port power supply

    Most COM ports can supply enough current for most PIC microcontrollers. In fact, it's common practice to design microcontroller programmers using the COM port as a power supply.
    The most difficult part of developing a program is understanding the problem.
    The second most difficult part is deciding how you're going to solve the problem.
    Actually writing the program (translating your solution into some computer language) is the easiest part.

    Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.

    Please Help Us To Save Ana

  5. #5

    Thread Starter
    New Member
    Join Date
    Aug 2006
    Posts
    3

    Re: com port power supply

    Thanks a lot, i will try this out today

  6. #6

    Thread Starter
    New Member
    Join Date
    Aug 2006
    Posts
    3

    Re: com port power supply

    hi, it doesnt work
    VB Code:
    1. MSComm1.Handshaking = comRTS  
    2. MSComm1.DTREnable = True  
    3. MSComm1.RTSEnable = True

    but i try a diferent handshaking and try with comNone and the code was like this
    VB Code:
    1. MSComm1.Handshaking = comNone  
    2. MSComm1.DTREnable = True  
    3. MSComm1.RTSEnable = True

    and with this works allright.

  7. #7
    Fanatic Member namrekka's Avatar
    Join Date
    Feb 2005
    Location
    Netherlands
    Posts
    639

    Re: com port power supply

    OK. Success.

Posting Permissions

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



Click Here to Expand Forum to Full Width