Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Response back Problem with Sim800 and pic18f4520

Status
Not open for further replies.

raushankumar586

Junior Member level 1
Joined
Jun 26, 2017
Messages
17
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
191
Hello guys, I am trying to send AT commands to Sim800 module from Pic18f4520 and want to very my command has been send and Sim800 is responding back with an OK.
For that I made : -
>>sim800 - pic18f4520 -------- uart connection
>>pic18f4520 - Arduino mega 2560 ---------- I2C connection* (To see Whats going on between pic and sim800 in serial monitor)
>> A string Compare Function
>> \r\n finder Function
>> Delay using timer0 of pic

so here are my code looks like
Code:
while (1) {
        
        checkSysConneciton();  // sending AT\r\n
        delay(10); // delay of 128 ms * 10 
        reading_and_printingArduino(); // reading buffer and printing to arduino mega 2560
        compareReturn1 = stringCompare(checkAT, buffer, 0, 2); // serching for AT --- 0,2 //are start and endpoint of buffer responding back from sim800
        if (compareReturn1 == 1) {
            delay(1);
            printToArduino("---Checked for AT ---\r\n");
            compareReturn2 = stringCompare(checkOK, buffer, 3, 5); // serching for AT
            if(compareReturn2 ==1){
                delay(1);
                printToArduino("--------------System Started----------");
            }
            delay(1);
        } 
    }

I checked my stringCompare function in netbeans by giving inputs its working fine. Even here program working fine untill

printToArduino("--------------System Started----------");

If I remove this line then program is not stucking anywhere but whenever I de-comment this line program stucks.
I checked using debugger compareReturn1 and compareReturn2 both are set to 1. but still inside this if condition printToArduino() is not working .....where It is working for
printToArduino("---Checked for AT ---\r\n");


help me , I know its a silly question and very easy to figure it out but I am not getting whats wrong with it.
 

Sounds like it is missing to append the "\r\n" characters to the printToArduino(...) argument that not worked.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top