Sharing Max232 with two pics?


Closed Thread
Results 1 to 11 of 11

Hybrid View

  1. #1
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898

    Default

    OPEN mode work if you use a good enough pull-up resistor for true mode...
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  2. #2
    Join Date
    Apr 2009
    Posts
    15

    Default

    Quote Originally Posted by mister_e View Post
    OPEN mode work if you use a good enough pull-up resistor for true mode...
    I can try it, would be enough a 47k resistor?

  3. #3
    Join Date
    Jul 2003
    Posts
    2,405

    Default

    47k may work, but 4.7k to 10k will for sure.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  4. #4
    Join Date
    Apr 2009
    Posts
    15

    Default

    Something does not works

    I'm testing with another board, just a 16F628A 20mhz OSC and a MAX233 that sends 'D00000' or 'D11111' every time RB.4 changes, it works ok if I use True Mode T9600 (RB.5 connect directly to MAX233).

    Try to change it to Normal Mode (N9600) modifying the board (a resistor between +5V and RB.5), but the PC receive trash:

    p}ŸŸŸŸWÖÖÖÖp}ŸŸŸŸWÖÖÖÖp}ŸŸŸŸ

    I've tried with several resitors (47K, 10K, 7.2K, 2.7K) with no difference.

    What I'm doing wrong?

  5. #5
    Join Date
    Jul 2003
    Posts
    2,405

    Default

    What I'm doing wrong?
    Trying to use inverted mode when you should be using non-inverted or TRUE mode.

    You have to use TRUE mode when going through the MAX232.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  6. #6
    Join Date
    Apr 2009
    Posts
    15

    Default

    Quote Originally Posted by Bruce View Post
    Trying to use inverted mode when you should be using non-inverted or TRUE mode.

    You have to use TRUE mode when going through the MAX232.
    So Mister_E answer is wrong, I'm always talking about a PIC+MAX233! Without the Max I can comm with the PC (can receive from, but not send to)

    Can you explain me what are the difference between inverted and non-inverted mode? When must I use each one?
    Last edited by zx81sp; - 27th April 2009 at 16:22.

  7. #7
    Join Date
    Jul 2003
    Posts
    2,405

    Default

    Can you explain me what are the difference between inverted and non-inverted mode?
    It's rather self explanatory, but here's a short explanation. Inverted serial inverts each bit. I.E. if you send a 1, it's a 0. If you send a 0, it's a 1. That's what inverted means.

    The PIC pin that's sending serial data, in inverted mode, will idle (fancy name for when it's not sending serial data) at logic 0.

    Standard serial data (without a parity bit) consists of 10 bits. 1 start bit, 8 data bits, and 1 stop bit.

    The start bit, with inverted mode, will be a logic 1. Then it sends your 8 bits of data, and ends with a stop bit. The stop bit is going to be the same as the idle logic. I.E. for inverted serial mode, the stop bit will be 1 bit time at the idle logic state of 0.

    TRUE or "non inverted mode" is just the opposite logic levels.

    When must I use each one?
    That totally depends on the external device you're communicating with serially, and it's something you "as the designer" will need to determine.

    The MAX232 is an inverter. The PC serial port expects an idle logic of 0 (this is actually -10 or more).

    So, if you're going to communicate with the PC serial port, using a MAX232 RS232 converter, with a bit-banged serial command like SEROUT, you'll want to use TRUE mode with your PIC since the "idle logic" with TRUE mode is logic 1. 1 on the input of the MAX232 = 0 on the output of the MAX232 connected to the PC serial port, and that's the logic it expects during idle periods.

    This is "inverted" through the MAX232, and places a -10 "or more" on the PC RX pin during idle periods.

    If you had a direct connection from your PIC to the PC RX pin, like shown in your PBP manual, then you would of course use inverted to hold the PIC TX pin at logic 0 during idle periods.

    In short, it's up to Y-O-U as the designer to know which mode to use based on the device you're attempting to communicate with.

    So Mister_E answer is wrong
    No. He was right. Maybe you just didn't understand what he was saying...;o}
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

Similar Threads

  1. PIC and MAX232 in/out
    By The Master in forum Serial
    Replies: 10
    Last Post: - 29th March 2008, 20:41
  2. Retrieving infos from multiple PICs on a bus/chain
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 15th October 2007, 04:42
  3. Programming Pins of PICs?
    By Kamikaze47 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 15th August 2007, 18:59
  4. MAX232 and DB9 connecter
    By Tomas in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 25th March 2006, 16:02
  5. Do I need MAX232 for Serial Comms
    By koossa in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 10th October 2005, 17:10

Members who have read this thread : 0

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