EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise
You are here: Home / Topics / Almost there, need Assistance ! MCU to Hyper Terminal OK. GSM Modem to Hyper Terminal OK. GSM TO MCU = Garbage

Almost there, need Assistance ! MCU to Hyper Terminal OK. GSM Modem to Hyper Terminal OK. GSM TO MCU = Garbage

|

Microcontroller › 8051 › Almost there, need Assistance ! MCU to Hyper Terminal OK. GSM Modem to Hyper Terminal OK. GSM TO MCU = Garbage

  • This topic has 11 replies, 5 voices, and was last updated 12 years, 7 months ago by Pradeep Kumar.
Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • May 30, 2012 at 11:10 am #1823
    Chen Jun Jie
    Participant

    Hello everyone,

     

    I’m about to solve my problem.

     

    MCU to Hyper Terminal, sends ABC, receives ABC.

     

    GSM Modem to Hyper Terminal OK.

    Able to send sms.

     

     

    However, Gsm to MCU, i get errors. I pick up garbage data instead.

    Baudrate is set to 115200.

    I am using the following setup.

     

    GSM MODEM TO Hyper Terminal Setup

    RX of GSM  -> PIN 5 of MAX233 (T1out)

    TX of GSM -> Pin 4 of MAX 233 (R1in)

     

    PC Serial

    SerialTX to Pin 2 Max233 (T1in)

    SerialRX to Pin 3 Max233 (R1out)

     

     

    I can send Sms no problem.

     

     

    MCU to Hyper Terminal

     

    MCU Uart3 TX -> Pin 2 of MAX233

    MCU Uart3 RX -> Pin 3 of MAX233

     

    Serial Pins as per normal

     

    I can send random ABCs, and receive ABCs on my MCU

     

     

     

    MCU TO GSM MODEM

     

    MCU

     

    MCU Uart3 TX -> Pin 2 of MAX233

    MCU Uart3 RX -> Pin 3 of MAX233

     

    GSM Modem

     

    RX of GSM  -> PIN 5 of MAX233 (T1out)

    TX of GSM -> Pin 4 of MAX 233 (R1in)

     

    This is my problem, my mcu is currently sending AT+CMGF=1

    I should receive OK,

    however, i receive this instead

     

    PUi53531u1

    AT+CMGFPUi53531u1
    Please let me know if you can spot the problem.
     
     
    My Code to print out what i have received.
    if (LPC_UART3->LSR & UART_LSR_RDR) //To modify, perhaps a better way.
     
       {
           do
           {
            UART_Receive(LPC_UART3, &data, 1, BLOCKING);
            //Timer0_Wait(500);
               if (data != ‘r’)
               {
                len++;
                line[len-1] = data;
               }
           } while ((len<64) && (data != ‘r’));
       }
     
            line[len]=0;
     
            printf(“%sn”, line);
     
     

     

     

    May 30, 2012 at 11:19 am #7933
    nikhiljain
    Participant

    Hello,

     

    Please check the GSM interfacing projects and tutorial on this website and your problem will be solved. Pls note the GSM modem also sends some additional characters with the data like “OK”. They are some special characters like line feed, carriage return etc and hence there is garbage data.

     

    There is a standard pattern of sending and reciveing data to the modem. When you recieve the data you need to remove/filter/reject/some of the bytes to discard the unwanted data and capture only the data you want. Similar is the case while sending the data to the modem. In sending you have to add the charchters.

     

    Please go through the GSM based work on the website in the 8051 section.

    May 30, 2012 at 11:28 am #7934
    Chen Jun Jie
    Participant

    Thank you Nik for the reply.

     

    Believe me, i have read literally the entire internet resource on this topic.

     

     

    But the problem that i am facing is really driving me crazy.

     

     

    I see no issues to communicate from GSM modem to Hyper Terminal, or Hyper Terminal To MCU.

     

    My code should be working.

     

     

    But MCU to GSM Modem, i am not able to receive the “OK” from it.

     

    Need help.

    May 30, 2012 at 12:02 pm #7935
    nikhiljain
    Participant

    Hi,

     

    Read the following three article in order:

     

    http://www.engineersgarage.com/microcontroller/8051projects/gsm-interface-8051-microcontroller-circuit-code

    http://www.engineersgarage.com/microcontroller/8051projects/interface-gsm-module-8051-microcontroller-circuit-code

    http://www.engineersgarage.com/microcontroller/8051projects/interfacing-gsm-8051-microcontroller-circuit-code.

     

    To me it appears that all you are doing is a logical error in understanding the working of GSM modem.

    May 30, 2012 at 12:05 pm #7936
    nikhiljain
    Participant

    Hi,

     

    Please search the following three project having project code: MC074, MC075 & MC076 in the 8051 section of this website under EG labs. You are misunderstanding the logic behind recieving and sending text to GSM modem.

    May 30, 2012 at 12:30 pm #7937
    Chen Jun Jie
    Participant

    Dear Nikh,

     

    I have seen the 3 projects and in detail.

     

     

     

    MAX 232

    tx Micro Controller to t1in of max232  pin11

    rx MICRO Controller r1out of max232 pin 12

    rx modem  t1out of max232 pin 14

    tx modem r1in of max232 pin13

     

    Now max 233

    Micro controller tx to T1in max233 = pin 2

    Micro controller rx to R1out max233 = pin 3

    Rx of modem to T1out max 233 = pin5

    Tx of modem to R1in max 233 = pin 4

     

     

    I used a slightly different ttl logic regulator.

    This is the only thing, i can think of, that is different from the 3 projects.

     

    Can you be alittle clearer if you know where is the problem ?

     

    Much thanks

    May 30, 2012 at 4:08 pm #7938
    Chen Jun Jie
    Participant

    I have solved the issue :)

     

     

    However, i am not sure how do you send Control Z from C code, any help guys ?

     

     

     

          strcpy(msg,”CAN YOU SEE ? SENT FROM MCU”);
            UART_Send(LPC_UART3, (uint8_t *)msg , strlen(msg), BLOCKING); //strlen :Length of Transmit buffer    Checking Blocking.
     
            strcpy(msg, 0x1A);
     
            UART_Send(LPC_UART3, (uint8_t *)msg , strlen(msg), BLOCKING); 

     

     

     

    Should i do +char(26) ?

    May 30, 2012 at 5:25 pm #7942
    AJISH ALFRED
    Participant

     

    Hi Chen,

     

    You are right, the ascii value for ctrl+z is 26, but there is a problem,

     

    This is the syntax for strcpy

    char * strcpy ( char * destination, const char * source );

    The arguments are pointers to memory location. If you give an integer value it will point to that location.

     

    Try to do it without strcpy.

    June 14, 2012 at 10:12 am #8037
    midhun
    Participant

    You can send the hex value of CTRL+Z ie, 0x1A

    Try this. you will…yes

    June 15, 2012 at 2:51 am #8048
    Chen Jun Jie
    Participant

    Thank you everyone for the support. I have since completed the entire project.

     

    Working properly on an ARM processor

    November 15, 2012 at 1:12 pm #8751
    Pradeep Kumar
    Participant

    Hi chen,

     

                       I am facing the same problem. I receive PU8 when i transmit  “AT” and PUi5 when i transmit “AT+CMGF=1”. How did you solve this issue.

     

     

     

    November 17, 2012 at 4:51 am #8754
    Pradeep Kumar
    Participant

    I got it!!!

    I made a mistake in circuit connection. TXin RXout pins from RS232 to gsm modem were interchanged…
    Now working fine

  • Author
    Posts
Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.
Log In

RSS Recent Posts

  • PIC KIT 3 not able to program dsPIC June 15, 2025
  • Siemens large industrial PLC parts June 15, 2025
  • Parts required for a personal project June 15, 2025
  • Cant log in to Easy PC forum June 15, 2025
  • Failure of polypropylene motor-run capacitors June 15, 2025

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2025 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise