Show Posts
Pages: [1] 2 3 ... 5
1  Using Arduino / Programming Questions / Re: Help in SMS Read function on: September 27, 2014, 12:26:27 am
@PaulS,

I Tried the same thing at first but it's never get any thing, I tried Print or write both function. Still did not get any data.

is it possible SerialEvent is not Serial interrupt? or may be I did not define properly? apart from that it should be work.
2  Using Arduino / Programming Questions / Re: Help in SMS Read function on: September 27, 2014, 12:21:35 am
@rogerClark,
Quote
SerialEvent is a big GotYa !!!!, it doesn't get called on an interrupt at all
 
That mean it's not serial interrupt at all? for that i have to set manually ?
I have another code which using two serials to operate GSM Modem manually it's working fine. that's why I suppose it's an serial interrupt.   
Code:
void setup()
{
  // Initialize serial ports for communication.
  Serial.begin(9600);
  Serial1.begin(9600);

  Serial.println("Start Reset");
  Serial.println("End Reset"); 

  Serial.println("Enter your AT commands (with CR & NL)...");
}

void loop()
{
 
}

void serialEvent1()
{
  if(Serial1.available() > 0){
    Serial.write(Serial1.read());
  }
}

void serialEvent()
{
    if(Serial.available() > 0){
    Serial1.write(Serial.read());
  }
}
3  Using Arduino / Programming Questions / Help in SMS Read function on: September 26, 2014, 04:45:39 am
Hello All,

I am trying to read sms by my own code. But my code is not working.... 
What is happened when a send the read sms command to GSM module it will send data   

But my serialEvent never get any data...so it will not break the while loop.   

Anyone have any idea what is going on why this is happened or what I am doing wrong . 

Arduino board = Mega2560
GSM Module =  sim900A
connection = Modem Rx to Board Tx, & Modem Tx to board Rx(USE serial1).

Thanks in advance   
Code:
char sms_location = 0;
int sms_location1=0;
byte temp[512];
char sms_buffer[512]="";
uint16_t count=0; 
int flag = 0;
char new_msg=0;
uint16_t counter =0;


void serialEvent1()
{
   temp[count] = Serial1.read();
    if (temp[count] == 'K') {
      flag = 1;
      Serial.write(temp[count-1]);
    }
    if (temp[count-1] == ','){
      if (temp[count-3] == 'M'){
        if (temp[count-4] == 'S'){
        sms_location = temp[count];
        new_msg = 1;
        flag = 0;
      }
    }
  }
  if(temp[count] == 'R') {
    if (temp[count-1] == 'E'){
      Serial.println("GSM ERROR");
      }
    }
  count++;
}



void setup()
{
  Serial.begin(9600);               
  Serial1.begin(9600);             
  delay(100);
  Modem_Inti();
  Serial.println("GSM Init");
}
 
void loop()
{
  if (new_msg)
  {
    new_msg = 0;
    dataextract();
  }
}
void Modem_Inti()
{
  Serial1.println("AT+IPR=9600");
  delay(500);
  Serial1.println("AT");
  delay(500);
  Serial1.println("ATE0");
  delay(500);
  Serial1.println("AT+CMGF=1");
  delay(500);
  Serial1.println("AT+CNMI=2,1,0,0,0");
  delay(500);
  Serial1.println("AT&W");
  delay(500);
  Serial1.println("AT+CMGD=0,4");
  delay(1000);
  temp_clear();
}

void temp_clear()
{
  for (int a = 0; a<=sizeof(temp); a++)
  {
    temp[a] = 0;
  }
}

void dataextract()
{
   flag = 0;
   //Serial.write(temp,sizeof(temp));
   count = 0;
   Serial.println("SMS Process start");
   Serial1.print("AT+CMGR=");
   Serial1.println(sms_location1);
   delay(500);
   while(flag == 0){} // wait until K received
   flag = 0;
   Serial.println("SMS Process stop");
   //strcpy(sms_buffer,temp);
   delay(1000);
   Serial.write(temp,sizeof(temp));
   Serial1.println("AT+CMGD=0,4");
   delay(1000);
   Serial.println("SMS delete");
   new_msg = 0;
   flag = 0;
   count = 0;
}
4  General Category / General Discussion / FPGA with Micro-controller on: July 02, 2014, 08:15:33 am
Hello All,

I am very new for FPGA. I want to use of FPGA with controller. I saw some project for that. My favorite is Micromouse or maze solving robot.

First all i want to know, May be these are sill question for that let go  smiley
1. What is the advantages of using FPGA?
2. how to use in project(i am asking about FPGA )  As. OP-Amp we can use as comparator, subtractor etc like this.

Any kind of suggestion would be appreciated.   
5  Using Arduino / Programming Questions / Re: Help in Read string [SMS string] on: June 18, 2014, 12:05:59 am
@Pauls :- Thanks for reply, I am using MEGA Serial0 which i am using to connect with hyper-terminal(to PC).

Serial1 is connected with GSM modem (Sim900).

What i am trying :- when i send "S" on serial0 via hyper-terminal then, serial1 has to read the sms which i alredy store in sim.
what is going there :- when i send read the serial1 then it we ll skip the values.

@dannable :- Arduino MEGA, SIM 900 as modem
6  Using Arduino / Programming Questions / Help in Read string [SMS string] on: June 17, 2014, 08:05:55 am
Hello Everyone,

I am trying to read sms, but when i send the command(AT+CMGR=1) from hyper terminal that time
Quote
+CMGR: "REC READ","+918128660422","","14/06/17,16:36:43+22"

Test sms

But When i tried by the function i only get
Quote
+CMGR: "REC READ","+918128660422","","14/06/17,16:36:43+22"

I don't know why my function skip all values.......

Code:
char buffer[128];
byte buffer2[128];
uint16_t count=0;     
void setup()
{
  pinMode(13,OUTPUT);
  Serial.begin(9600);               
  Serial1.begin(9600);             
  delay(500);
  Sim900_Inti();
}
 
void loop()
{
  if (Serial.available())
  {
    switch(Serial.read())
    {
      case 's' :
      Cmd_Read_Act();
      break;
    }
    Serial.write(buffer2,count);
    /*Serial.write(buffer2,128);
    Serial.write(buffer2,128);
    Serial.write(buffer2,128);*/
    //clearBufferArray();
    count = 0;         
  }
}
void clearBufferArray()
{
  for (int i=0; i<128;i++)
    { buffer[i]=0;}
}
void Sim900_Inti()
{
  Serial1.println("ATE0");
  delay(500);
  Serial1.println("AT+CMGF=1");
  delay(500);
  Serial1.println("AT+CNMI=2,1");
  delay(500);
  Serial.print("GSM Init");
}
void Cmd_Read_Act()
{
  Serial1.println("AT+CMGR=1");
  /*Serial1.print(char(34));
  Serial1.print("ALL");
  Serial1.println(char(34));*/
  if (Serial1.available()> 0)
  {
    while(Serial1.available()>0)
    {
      buffer[count]=Serial1.read();
      buffer2[count] = buffer[count];
      char temp = buffer2[count];
     
      count = count+1;
      if (temp == 'K')
      {
        Serial.println("0K Recived");
        break;
      }
     }
  }
}

Anyone has idea then tell me why this is happening
Thanks in advance 
7  Using Arduino / Programming Questions / Re: Need help in Timers on: October 26, 2013, 07:41:29 am
Quote
Could you describe the wiring of this external pulse counter?

5V
GND
Output :- 47 pin of ADK board

8  Using Arduino / Programming Questions / Re: Need help in Timers on: October 26, 2013, 07:27:41 am
Thanks for your suggestions....  smiley

I tried new config bits but still i did not find any result.....
Code:
void setup()
{
  Serial.begin(9600);
 TIFR5 = 0x00;
TIMSK5 = 0x00;
TCCR5A = 0x00;
TCCR5B = 0x06;
TCNT5 = 0x0000;
}

void loop()
{
  Serial.println(TCNT5);
  delay(40);
  TCNT5 = 0;
  delay(40);
}


Any thing you want to add so please tell me
9  Using Arduino / Programming Questions / Re: Need help in Timers on: October 26, 2013, 02:18:45 am
My Bed....... for this

Code:
void setup()
{
  Serial.begin(115200);
  TIMSK5 = 0x10;
  TCCR5A = 0x00;
  TCCR5B = 0x46;
  TCNT5  = 0x00;
}

void loop()
{
  Serial.println(TCNT5);
}
10  Using Arduino / Programming Questions / Need help in Timers on: October 26, 2013, 12:31:55 am
Hello Guys,
                     Right now i am using arduino mega adk, i am using it's timer5 as a external pulse counter. but when i connect with pulse sensor it's gives me random values i dont know why, any idea why it's not working for me

Code
Quote
  TIMSK5 = 0x10;
  TCCR5A = 0x00;
  TCCR5B = 0x46;
  TCNT5  = 0x00;
11  Development / Suggestions for the Arduino Project / How to Stop Analog Pin to float on: October 07, 2013, 06:39:44 am
Hello All,
             i am working on project in which i have to measure pressure. Pressure sensor is given analog signal which i have to read by analog pin. if i am not connect pressure sensor to analog pin then respective analog pin given me floating vales which is random.

so how could i know is sensor is connected or not. is any logic of method which tell us pin is floating.

Thanks in Advance
Any kind of comment would be appreciated
12  Using Arduino / Programming Questions / Opcode for Reset Atmega2650 on: May 09, 2013, 07:44:23 am
Hi All,
        i want make soft reset without watchdog.
i tried some ways but i did not get success.
1. use opcode
2. illegal instruction set

 also i want to which is more easy and what is disadvantage. if any other way so tell me it.

Thanks in advance
 
13  Using Arduino / Microcontrollers / Re: Arduino IDE for Android on: April 12, 2013, 07:17:03 am
could you tell me which version of arduino IDE you are following??
14  Using Arduino / Microcontrollers / Re: Arduino IDE for Android on: April 12, 2013, 07:05:44 am
hey it's nice...but when i changed the board and select ADK board after that compile blink led code it's getting hanged but if do the same process with uno board so it's working fine

Both case i did not connect any board with android device.
15  Using Arduino / Project Guidance / Current use by GSM Shield on: March 18, 2013, 06:49:56 am
Hi all,
        i am searching low power GSM/GPRS module. i find arduino GSM Shield i want to know how much current consume by this module at transmitting time. could anyone know so please tell me
if any other module which is easy to use so you can also tell me

http://arduino.cc/en/Main.ArduinoGSMShield

Thanks in advance
Pages: [1] 2 3 ... 5