:: The Journal of the Institute of Internet, Broadcasting and Communication ::, Vol.18 No.6 | (2018) pp.133~137

아두이노 멀티 태스킹을 위한 수퍼루프 방식과 FreeRTOS 방식의 비교 분석

Dong-Hwan Gong

(정회원, 한양사이버대학 기계자동차공학부)

Seung-Jung Shin

(정회원, 한세대학교 ICT디바이스학과)

Abstract

아두이노는 소형 마이컴으로 다양한 산업에 사용되고 있으며 특히, 오픈소스 하드웨어 IoT 디바이스로 널리 사용되 고 있다. 아두이노의 멀티태스킹 방식은 크게 수퍼루프 타이밍과 RTOS 쓰레드 방식으로 나뉘며 수퍼루프 타이밍 방식은 구현이 단순하고 이해하기 쉽다는 장점이 있지만 하나의 작업이 길어지면 다음 작업의 실행에 영향을 줄 수 있다는 단점을 가진다. 또 RTOS 쓰레드 방식은 다른 작업시간에 영향을 받지 않고 실행할 수 있다는 장점을 갖지만 소형 마이컴인 아두이 노는 쓰레드의 개수가 늘어나면 쓰레드의 컨텍스트 스위칭타임으로 수퍼루프 타이밍 방식에는 없는 부가 시간이 발생하는 단점이 있다. 본 논문은 이와 같은 서로 다른 특징들을 분석하기 위하여 아두이노 우노 R3와 FreeRTOS를 사용하였으며 실험을 위한 태스크는 빌트인 LED 포트에 8000번의 디지털 신호를 보내도록 작성하였다. 같은 크기의 태스크를 두 방식으로 실행하면 수퍼루프 방식이 FreeRTOS 멀티태스킹 보다 3ms 빠른 실행을 보인다. 여러 개의 태스크를 동시에 실행하면 수퍼 루프 방식의 태스크는 순차 실행으로 첫 태스크와 마지막 태스크의 실행시간 차가 크게 나타나며 FreeRTOS 방식은 모두 중첩되어 동시에 실행 가능하지만 30ms 정도의 컨텍스트 스위칭타임의 실행 시간지연이 발생한다.
Arduino is a small microcomputer that is used in a variety of industry fields and especially is widely used as an open source hardware IoT device. The multi-tasking method of Arduino is divided into super loop timing and RTOS thread method. The super loop timing method is simple and easy to understand. However, when one task is long, it affects the execution of the next task. In addition, RTOS threading has the advantage of being able to run without being influenced by other work time. However, Arduino, a small microcomputer, has a disadvantage in that, when the number of threads increases, the context switching time of the thread causes additional time not included in the super loop timing method have. In this paper, we use Arduino Uno R3 and FreeRTOS to analyze these different features, and the task for the experiment is to send 8000 digital signals to the built-in LED port. If two tasks of the same size are executed, the super loop method executes 3 ms faster than FreeRTOS multitasking. If multiple tasks are executed simultaneously, superloop type task is sequential execution and difference in execution time between first task and last task is large. FreeRTOS method can be executed concurrently, but execution time delay of about 30 ms occurs in context switching time.
  IoT,Arduino,FreeRTOS,RTOS,Multitasking,Analysis.

Download PDF List