Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8795631
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:25:52+00:00 2026-06-13T23:25:52+00:00

I am using embedded C and trying to make application for GPRS terminal. My

  • 0

I am using embedded C and trying to make application for GPRS terminal. My main problem is working with AT commands. I send AT command using serial line, but if it is some network oriented command its response could take time and because of that I have a lot of waiting, while processor don`t do anything. Idea is to make this waiting to be done in same way parallel like in different thread. Does anyone have idea how to do that because my system does not support threads?
I had idea to use some timers, because we have interrupt which is called every 5ms, but I don’t know ho many seconds I have to wait for response, and if I compare strings in interrupt to check if all message is received it could be very inefficient, right?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T23:25:53+00:00Added an answer on June 13, 2026 at 11:25 pm

    you could either use interrupts, configure the serial interface to interrupt when data is available, or use an RTOS something, like FreeRTOS, to run two threads, one for the main code and the other to block and wait for the serial data.

    Update: based on your comments, you say you don’t know the size of the data, that’s fine, in the interrupt handler check for the byte that terminates the data, this is a simple and generic example you should check the examples for your MCU:

    void on_serial_char()
    {     
      //disable interrupts
      disable_interrupts();
    
      //read byte
      byte = serial.read();
    
      //check if it's the terminating byte
      if (byte == END) {
          //set the flag here
          MESSAGE_COMPLETE = 1;
      }
    
      //add byte to buffer
      buf[length++] = byte;
    
      //enable interrupts
      enable_interrupts();      
    }
    

    And check for that flag in your main loop:

    ...
    if (MESSAGE_COMPLETE) {
        //process data
        ...
    
        //you may want to clear the flag here
        MESSAGE_COMPLETE = 0;
    
        //send next command
        ...
    }    
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to make simple application using Spring, JPA and embedded H2 database. Recently
Hej I am trying to load an (embedded) image in a wpf application, using
I'm trying to run a simple jsf-2.0 tutorial using embedded glassfish 3.0 and keep
I'm deploying an application using ClickOnce, the problem is that the configuration file (xxx.exe.config)
I am trying to make a post on another user's wall using another user
Have been struggling all day trying to make this simple example work using socket.io.
I am using MongoDB and trying to remove array elements (themselves embedded documents) from
I'm trying to cross-compile the OpenCV library for using it on an embedded system
I want make RESTful services using embedded jetty with JAX-RS (either resteasy or jersey).
I am trying to make a fairly simple call using PICC18. Using the MPLAB

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.