PIC to PC not working


Closed Thread
Results 1 to 6 of 6
  1. #1
    Join Date
    Jun 2007
    Location
    Mansfield, UK
    Posts
    697

    Default PIC to PC not working

    Hi. Ive got a pic chip which outputs serial to a PC. My app in VB isnt getting any input at all. Ive tried hyper terminal and i do get an input but its not reliable.

    I have a 100K resistor going from the serial pin to ground (also tried without this). Is there anything else im supposed to do on my circuit for this to work? I have another chip which uses the serial output from the same port and that is accepting commands fine.

    This one is slightly more important than my last thread so i would apreciate a quick response. Let me know if you need any more info

  2. #2
    Join Date
    Jun 2007
    Location
    Mansfield, UK
    Posts
    697

    Default

    I have also tried disconnecting from the serial port completely and linking the output into the input. The second chip receives all the commands from the first chip fine. It seems this is only a problem when sending to a PC

  3. #3
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924

    Default

    Well, being that you are using...OH WAIT...What chip are you using?
    And what pin... And what about code?

    I have lots of solutions to your problem

    Who said this:
    "That which seems simple is often overlooked" (Usually by me)
    Dave
    Always wear safety glasses while programming.

  4. #4
    Join Date
    Jun 2007
    Location
    Mansfield, UK
    Posts
    697

    Default

    Righty then. The code is perfect (im sure). the chip is a PIC16F84A.

    Ive found some settings in the VB comm control and data is now getting in. Its not completely reliable. This circuit is part of the circuit i have other threads about. Im just about to rip the whole thing out of the breadboard and start the whole thing again. I will be testing after almost every new wire to be sure its all done properly.

    Ill post back when i start getting more problems (when, not if ) lol

  5. #5
    Join Date
    Jun 2005
    Location
    Wisconsin
    Posts
    382

    Default

    The second chip receives all the commands from the first chip fine.
    The serial output/input on a pic is TTL so you will have perfect communication in this type of setup. However a PC is RS-232 which is a 12V inverted communications signal. Normally you would use a MAX232 or MAX233 transceiver to convert the serial TTL I/O from the pic to RS-232. A lesser expensive option is to use a few transistors, a quick forum or web search should come up with a schematic.

    However the "quick and dirty" way is by placing a 22K resistor in series with the TX pin on the PC side to the RX pin on the pic side. You need to also tie the PC serial ports GND to common on the pic side. (see "DEBUGIN" command in the PicBasic Pro manual for a schematic) BTW the Pic won't be able to transmit back to the PC with this method. To do that see the "DEBUG" command in the manual.

    I have a 100K resistor going from the serial pin to ground (also tried without this).
    I'm not sure that I follow what you mean here, see the above "quick and dirty" way.

  6. #6
    Join Date
    Jun 2007
    Location
    Mansfield, UK
    Posts
    697

    Default

    Hi, thanx for your suggestions. This seems to be working perfect now too. For PC to PIC i have a 33K resistor between the serial port and the chip. For PIC to PC i just have the wire going from the chip into the serial port. Nothing else is connected.

    I think my biggest problem was the settings for VB's comm control. I did notice that i got a lot of randomness if i touch the serial wires but that isnt affecting anything at the moment.

    For now its all good . Finally! lol

Similar Threads

  1. PC to EUART on pic 16F688
    By docaberle in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 25th October 2008, 06:33
  2. USART Problem , but don't know where, in pc? or in PIC?
    By precision in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 15th July 2007, 08:12
  3. Pic to PC AT keyboard caracters
    By sezgin05 in forum General
    Replies: 5
    Last Post: - 27th March 2007, 10:45
  4. Serial com PIC <> PC - what is best?
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 3rd January 2007, 08:37
  5. Interrupt and Serial communication to PC.
    By obaskirt in forum mel PIC BASIC
    Replies: 2
    Last Post: - 17th June 2005, 20:01

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