Abstract

This article describes a methodology for writing the program for the Arduino board using an automatic generator of assembly language routines that works based on a cooperative coevolutionary multi-objective linear genetic programming algorithm. The methodology is described in an illustrative example that consists of the development of the program for a digital thermometer organized on a circuit formed by the Arduino Mega board, a text LCD module, and a temperature sensor. The automatic generation of a routine starts with an input-output table that can be created in a spreadsheet. The following routines have been automatically generated: initialization routine for the text LCD screen, routine for determining the temperature value, routine for converting natural binary code into unpacked two-digit BCD code, routine for displaying a symbol on the LCD screen. The application of this methodology requires basic knowledge of the assembly programming language for writing the main program and some initial configuration routines. With the application of this methodology in the illustrative example, 27% of the program lines were written manually, while the remaining 73% were generated automatically. The program, produced with the application of this methodology, preserves the advantage of assembly language programs of generating machine code much smaller than that generated by using the Arduino programming language.

Highlights

  • Arduino is an open-source, free hardware, microcontrollerbased electronic board that has a series of analog and digital pins that can be used to connect sensors, peripheral devices, or actuators [1]

  • In the design of systems based on the Arduino Mega board, when the circuit includes devices such as LCD screen module, matrix keyboard, seven-segment indicators, sensors, and others, the methodology proposed in this article for developing the program consists of executing the following steps: 1) the global task is divided, if possible, into subtasks that are expressed through an input-output table; 2) the inputoutput tables are made with the help of a spreadsheet; 3) the routines described by input-output tables are automatically generated by the generator implemented based on the algorithms shown in previous sections; 4) the main program and routines that were not described with tables are manually written in assembly language

  • The limitations of the proposed methodology are: 1) the application of the methodology depends on the existence of subtasks that are described by input-output tables; 2) the size of the input-output tables cannot be too large, tables of up to 204 rows and up to 6 columns of output have been used in the tests; 3) depending on the speed of the computer, in some cases, the generation of the program may take a long time; 4) in the generation of peripheral device management routines, in addition to the simulator of the microcontroller CPU, it is necessary to simulate the interface of the microcontroller with the peripheral device

Read more

Summary

INTRODUCTION

Arduino is an open-source, free hardware, microcontrollerbased electronic board that has a series of analog and digital pins that can be used to connect sensors, peripheral devices, or actuators [1]. The program, which the user stores in the Arduino memory, allows this board to perform various functions such as controller functions, measurement instrument functions, communications equipment functions, etc. There are various Arduino boards such as Arduino Uno, Arduino Mega, Arduino Nano, Arduino Leonardo, Arduino Micro, etc Because it is one of the fastest Arduino boards on the market [5] and due to the amount of digital and analog pins it has, in this work the Arduino Mega board is used, which is built based on the ATmega 2560 microcontroller with AVR architecture. A program development methodology is proposed for the Arduino Mega board based on program synthesis. The starting point for the automatic generation of a program is an input-output table.

RELATED WORK
Circuit with the Arduino Mega Board
Inductive Programming
Linear Genetic Programming
ATmega 2560 Microcontroller used Registers
Multi-Objective Evolutionary Optimization
Structure of the Automatic Routine Generator
Fitness Evaluation in the Conversion of One Code to Another
Fitness Evaluation in the Generation of Timing Diagrams without Input Values
AUTOMATIC ROUTINE GENERATION FOR ARDUINO MEGA
EXPERIMENTAL WORK
FEATURES AND RESULTS OF THE ROUTINE GENERATION TESTS
CONCLUSIONS AND SUGGESTIONS
Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call