L
L
list_get2015-10-02 10:30:57
Microcontrollers
list_get, 2015-10-02 10:30:57

How to organize the reception of responses to AT commands of the modem?

Good afternoon.
To control the modem, it became necessary to receive responses to AT commands from the sim900 modem and the like.
An exemplary reception option: reception is organized by interruption constantly into the buffer. In the main loop of the program, we look at the buffer for the presence of response commands received from the modem. After viewing the buffer, we already make a decision what to do next with this information. Such a solution seems not very efficient and data loss is possible if we do not have time to look at the buffer.
The question is whether there are other alternatives to this task?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
T
TyzhSysAdmin, 2015-10-02
@POS_troi

And how are you going to not have time to look at the buffer?
You have interrupt processing, until the function works further, the matter will not go, the only thing that can interfere is another interrupt, but did you first disable interrupt processing? ;)

S
Sergey, 2015-10-03
@renoize

I once worked on a similar task with a bluetooth module, communication with which took place using AT commands. Similarly with your example, in the interruption I filled the buffer, then in the background I did the necessary actions after the completion of the reception or sending. Since all the messages were expected, there were no situations like "didn't have time to look at the buffer".

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question