Direct PIC to PC without MAX232


Closed Thread
Results 1 to 15 of 15

Hybrid View

  1. #1
    Join Date
    Oct 2006
    Posts
    13

    Smile Direct PIC to PC without MAX232

    A good idea in order to have a direct PIC and a PC bilateral communication using the PIC's UART and HSERIN and HSEROUT without an external inverter like MAX232 is choose a PIC with Comparator Module like the 16F877A or 16F88 or 16F628.

    You just need configure the comparator module as "Two Common Reference Comparators with Outputs" where the output of comparators are redirected to pins. Then the TX pin used to HSEROUT is hardwired to the input of comparator 1 . The inverted output (true) is now outputed in the C1.

    To receive from PC serial is directed to input of C2 and output is hardwired to RX pin used by HSERIN.

    Both comparators may use the internal reference (Comparator Voltage Refrence Module enabled and routed to C1, C2 ) or use an external.

    I already have tested this trick with 16F88 with good results.

    Of course this is not the true level converter like the MAX232 but works fine in my PC.

    I hope this be useful for some users.

    ACJacques

  2. #2
    Join Date
    Dec 2005
    Posts
    1,073

    Default

    Neat idea.

    I was hoping to use it with a 16F688 but C2OUT and TX share RC4.

  3. #3
    Join Date
    Mar 2008
    Posts
    16

    Default Re: Direct PIC to PC without MAX232

    Thank you for this idea!!

    Also, would the following work:

    HSEROUT - First invert all bits in the data byte, then send with HSEROUT.
    HSERIN - Read the data as usual, the invert the data byte prior to using.

    Thanks!

  4. #4
    Join Date
    Dec 2010
    Posts
    409

    Default Re: Direct PIC to PC without MAX232

    Quote Originally Posted by swr999 View Post
    Thank you for this idea!!

    Also, would the following work:

    HSEROUT - First invert all bits in the data byte, then send with HSEROUT.
    HSERIN - Read the data as usual, the invert the data byte prior to using.

    Thanks!
    Sorry, won't work. You need to invert everything, including the idle state, start and stop bits, etc.

  5. #5
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,588

    Default Re: Direct PIC to PC without MAX232

    No risk of overvoltage on PIC?

    Robert

  6. #6
    Join Date
    Aug 2011
    Posts
    408

    Default Re: Direct PIC to PC without MAX232

    No risk of overvoltage on PIC?
    Yes, this exceeds the max voltage spec on the pins. Bad idea, esp the negative voltage.

    RS232 levels could be as much as +/-25V, although you normally won't see them anywhere near this high out of your typical PC.

    If you're interested, read TB3013 (http://ww1.microchip.com/downloads/e...tes/93013a.pdf). Then see if you still want to recommend doing this.

  7. #7
    Join Date
    Mar 2008
    Posts
    16

    Default Re: Direct PIC to PC without MAX232

    Quote Originally Posted by Charlie View Post
    Sorry, won't work. You need to invert everything, including the idle state, start and stop bits, etc.
    Of course you're right! Why didn't I think of that? ;-\
    I'm just using a 3-wire connection, so I suppose, aside from a dedicated RS232 translator chip (MAX232 etc), I could use any scheme to hardware-invert the Rx and Tx lines?
    Thanks for the helpful responses!

  8. #8
    Join Date
    Dec 2010
    Posts
    409

    Default Re: Direct PIC to PC without MAX232

    Quote Originally Posted by swr999 View Post
    Of course you're right! Why didn't I think of that? ;-\
    I'm just using a 3-wire connection, so I suppose, aside from a dedicated RS232 translator chip (MAX232 etc), I could use any scheme to hardware-invert the Rx and Tx lines?
    Thanks for the helpful responses!
    You can use any scheme to invert the signals and it will work, bearing in mind that you might encounter an interface that it won't work with because it doesn't strictly meet the spec. You'll have more success with a 5V PIC, and you should protect any input from overvoltage on whatever device you use. I do this all the time for one way communication out of the PIC for dumping status logs or other information that doesn't require a response from the computer. Typically, I use an N-channel FET to do the inversion, but a spare comparator or op-amp will do too.

Similar Threads

  1. Send data PIC to PC
    By konter in forum Off Topic
    Replies: 6
    Last Post: - 25th December 2009, 23:04
  2. Replies: 67
    Last Post: - 8th December 2009, 03:27
  3. HSERIN & Interupts (aka controlling PIC programs from a remote PC)
    By HankMcSpank in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 17th June 2009, 15:46
  4. PIC18F4680 to PC via MAX232 (RS232 serial) no output
    By opticsteam1 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 14th April 2008, 21:39
  5. PIC and MAX232 in/out
    By The Master in forum Serial
    Replies: 10
    Last Post: - 29th March 2008, 21:41

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