Community
cancel
Showing results for 
Search instead for 
Did you mean: 
CLin82
New Contributor I
1,110 Views

Does intel edison have on-board timer to accurately do something at a repeating period?

Jump to solution

Hi all,

I used an analog pin to collected sensor data. And I knew that the board is fast enough to allow me to collect sensor data more than 100Hz. My goal is to collect 100 samples per second, display it on serial monitor, and eventually save the data to a text file or csv file. (add time stamp as well).

I tried to use arduino "Timer.h" to run a self defined function every second, it looks fine in serial monitor. However, when I used a software called CoolTerm to save the serial output, I found that it collects random samples per second. (In some seconds, it more than 160. In some seconds, it less than 50).

 

Another question is, I noticed that the intel edison has 766MB storage space when I plug in the micro USB. Can I save the serial outputs to this space instead of using a SD card ? I am using Arduino IDE and how can I do that?

 

1 Solution
Diego_V_Intel
Employee
134 Views

Hi channinglin,

I can think in some suggestions for you regarding the timer question. I haven't tested them, but I hope you find them interesting:

  1. You could try to use the ISRBlink example. This example uses the TimerOne.h library to make an interruption at regular intervals. You could try it and check if you can reduce the intervals to the time you need.
  2. You could use the function millis() to calculate the time intervals. Check the following example about using millis() to calculate time intervals: https://www.arduino.cc/en/Tutorial/BlinkWithoutDelay Arduino - BlinkWithoutDelay
  3. There are threads that discuss the use of timers in Edison. You could check them in order to get ideas for your project:

I hope you find these suggestions useful.

Regarding the question about the storage space, the drive that appears on your PC when you connect the Edison can't be used to store files or data. That space was used before to flash the Yocto image (now you can use the Flash Tool Lite to flash the Yocto image).

However, you could save your data in the internal Edison memory, let say for example in the /home directory of your Edison. You could navigate through the Edison's directories if you get access to the terminal. Check the following tutorial for additional details about accessing the Edison's terminal: https://software.intel.com/en-us/get-started-edison-windows-step3 IoT - Step 3: Set up a serial terminal | Intel® Developer Zone

Regards,

Diego

View solution in original post

3 Replies
Diego_V_Intel
Employee
135 Views

Hi channinglin,

I can think in some suggestions for you regarding the timer question. I haven't tested them, but I hope you find them interesting:

  1. You could try to use the ISRBlink example. This example uses the TimerOne.h library to make an interruption at regular intervals. You could try it and check if you can reduce the intervals to the time you need.
  2. You could use the function millis() to calculate the time intervals. Check the following example about using millis() to calculate time intervals: https://www.arduino.cc/en/Tutorial/BlinkWithoutDelay Arduino - BlinkWithoutDelay
  3. There are threads that discuss the use of timers in Edison. You could check them in order to get ideas for your project:

I hope you find these suggestions useful.

Regarding the question about the storage space, the drive that appears on your PC when you connect the Edison can't be used to store files or data. That space was used before to flash the Yocto image (now you can use the Flash Tool Lite to flash the Yocto image).

However, you could save your data in the internal Edison memory, let say for example in the /home directory of your Edison. You could navigate through the Edison's directories if you get access to the terminal. Check the following tutorial for additional details about accessing the Edison's terminal: https://software.intel.com/en-us/get-started-edison-windows-step3 IoT - Step 3: Set up a serial terminal | Intel® Developer Zone

Regards,

Diego

View solution in original post

CLin82
New Contributor I
134 Views

Hi DiegoV,

I found the Arduino-BlinkWithoutDelay example is very useful. Now I have get a 100 data per second.

From the arduino official website, it says the AnalogRead() function takes about 100 microseconds to read an analog input, so the reading rate is about 10000 times per second. I just wondering whether the intel edison with arduino breakout board can achieve this when using ardunio IDE analogRead() function? Or it is slower than 10000 per second?

 

Thanks!

Diego_V_Intel
Employee
134 Views

Hi channinglin,

I haven't tested it so I'm not sure if you would get the same results. I'd say that the results would be different because the hardware is different, and the information detailed in the Arduino site might apply only for the Arduino boards. Anyhow, the only way to know it for sure is trying it. I invite you to test if you can reach the rate you desire and post your results in the community.

Regards,

Diego

Reply