Problem with Max232 - Data in the output is different from the input

Discussion in 'Embedded Systems and Microcontrollers' started by Mohammed Fy, Sep 23, 2015.

  1. Mohammed Fy

    Thread Starter New Member

    Sep 23, 2015
    2
    0
    Hello everyone, i'm trying to send data from a micro-controller AT89C52 to Max232 which is connected to a 3G modem via VSPE
    My problem is when i catch data from the output its not the same, here is what is shown to me in the picture attached.
    Also, the code i'm using :

    serial_init();
    delayms(5);
    if(sw == 1)
    {
    serial_send_string("AT+CSCA?\r");
    serial_send_string("AT+CMGF=1\r");
    delayms(1);
    serial_send_string("AT+CMGS=\"+212\"\r");
    delayms(1);
    serial_send_string("MSG\r");
    serial_send_string("0x1A\r");
    delayms(5);
    }


    I need someone help please.
     
  2. joeyd999

    AAC Fanatic!

    Jun 6, 2011
    2,692
    2,756
    Have you considered sending a really, really short message first? Like, say, the letter 'A'. Or maybe even the same letter 'A' repeated continuously.

    This will help you to rapidly run down the problem which is likely nothing more than a baud rate or other configuration mismatch.
     
  3. Mohammed Fy

    Thread Starter New Member

    Sep 23, 2015
    2
    0
    Thanks for your answer .. i found out what cause the problem, it is the inversion of polarity by MAX232 so all i needed to do is invert that signal another time to get back to the original one.
     
Loading...