Post a new topicPost a reply Page 1 of 1   [ 5 posts ]
Author Message
 Post subject: Serial Monitor Stops while sending serial data
PostPosted: Thu Sep 07, 2017 11:48 am 

Joined: Thu Sep 07, 2017 11:28 am
Posts: 3
Hello,

I am using MySignals HW v2 to read the ECG data only.
I have almost tried all of the ECG functions and checked the connection of the device to my mobile phone.
At the beginning all things were working fine. However, after increasing the size of the code and adding series of filters, the platform started to freeze or halt when I try to show some data on the serial monitor. It stops just in random places in the code and I tried to trace the reason of this issue but it seems random and no specific part caused this issue.

I am attaching a screenshot showing part of the code and the output in the serial monitor (which is not complete).
https://drive.google.com/file/d/0B48uMX ... sp=sharing

Please advise me about the issue. Is it because of the memory?

Looking forward for your help and feedback .

Regards,
Asiya


Top
 Profile  
 
 Post subject: Re: Serial Monitor Stops while sending serial data
PostPosted: Fri Sep 08, 2017 6:31 am 

Joined: Mon Sep 28, 2009 11:06 am
Posts: 10492
Hello AsiyaM,

this behavior is a symptom of a RAM problem. We can give you and advice in order to help you, replace all your Serial.print to this:

Use this:
Code:
Serial.println(F("Filtered Signal:"));


instead of this:
Code:
Serial.println("Filtered Signal:");


Regards


Top
 Profile  
 
 Post subject: Re: Serial Monitor Stops while sending serial data
PostPosted: Sun Sep 10, 2017 4:45 pm 

Joined: Thu Sep 07, 2017 11:28 am
Posts: 3
Thank you for your reply.

What do you mean of a RAM problem?
Anyways, I have replaced the code with the one you suggested but still getting the same output on serial monitor.

Regards,
Asiya


Top
 Profile  
 
 Post subject: Re: Serial Monitor Stops while sending serial data
PostPosted: Sun Sep 10, 2017 5:12 pm 

Joined: Thu Sep 07, 2017 11:28 am
Posts: 3
I think yes this problem is caused by the RAM.
Because when I traced the following part of the code:

Code:
  float ECGtemp[N+22];
 
  Serial.println("here1");

  //memset(ECGtemp,0,sizeof(ECGtemp));
  for (j=0; j<N+22; j++)
        ECGtemp[j]=0;

   Serial.println("here2");


The output was :

Code:
here


Top
 Profile  
 
 Post subject: Re: Serial Monitor Stops while sending serial data
PostPosted: Mon Sep 11, 2017 6:36 am 

Joined: Mon Sep 28, 2009 11:06 am
Posts: 10492
Hello Asiya,

It means that you do not have enough dynamic memory to store variables. Start with a basic code that works, and adds little by little your variables and code to check what the problem is.

Regards


Top
 Profile  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 1 of 1   [ 5 posts ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Libelium theme based on 610nm Style by Daniel St. Jules of http://www.gamexe.net


© Libelium Comunicaciones Distribuidas S.L. | Terms of use.