Abstract/Summary: This page summarises some of the attributes of Integrated Development Environments (IDE) with emphasis on the Arduino. There will be a second page on the Arduino Software.
Possible Audience: This page may be of interest to readers who are interested in widening their knowledge. This page is not be suitable for first time users or developers who just want to get a project up and running.
Key Words: Integrated Development Environment, IDE, Arduino IDE, Data Terminal Ready, Bootloader, Reset
The first microprocessors or micro-controllers became commercially available in the 1970s. These were basically just a collection of blank chips (the CPU, program memory, data memory, input-output, clocks and glue chips) that had to be wired together and programmed to give a working system.
In order to sell their systems microprocessor manufacturers had to provide the tools to make the promised magic of the microprocessor happen.The result was that component manufacturers such as Intel and Motorola were producing tools to support their products while other manufacturers such as Hewlett Packard produced universal tools that supported microprocessors from a number of manufacturers. Photo shows a HP64000 system.
These tools, Microprocessor Development Systems (MDS) or Logic Development Systems (LDS) had many things in common:
1. they had keyboards for entering programs, data or commands;
2. they had displays for displaying programs, memory contents and the response to commands;
3. memory storage for saving programs; and
4. most importantly cables that linked the tool to the microprocessor through which programs were transferred, memory and registers interrogated, and programs run.
Note while these tools read like a workstation or a PC they were developed prior to the PC. The microprocessor vendors were effectively developing their own PCs. However the market for Microprocessor Development Systems (MDS) was a specialist market so the tools were expensive both in terms of the hardware and software.
The advent of the PC brought the demise of a separate MDS. All program development (editing and compilation) could be performed on a PC.
The only surviving aspect of the original MDS is the PC to microprocessor (today almost always a micro-controller) interface. See ULINK2 across for ARM processor. However often the "special parts" are included in the target board. This is the case with the Arduino. The Arduino board contains two chips:
1. The ATMega328 that is the Arduino, and
2. A second chip that performs the USB to serial interface and also generates signals to control the ATMega328.
As implied above the tools for the development of microprocessor systems consists of a standard PC with a set of programs (the tool chain) that enable developers to:
1. write programs ie an editor
2. compile programs,
3. load the program into the target microprocessor,
4. run programs in the target microprocessor, and
5. debug programs in the target microprocessor.
Its important to note here that:
1. An essential criteria is the cycle time, that is the time to find a bug in the program, modify the problem code in the editor, re-compile, load the code into the target and test.
2. For many early systems the different tools were separate programs. These were often supplied by different vendors. In pre-windows days it was necessary to open the editor, make the changes, save and close the editor and run the compiler etc.
With the advent of windows it was possible to have all tools open at the same time.
If all the features were integrated into the one package it was known as an Integrated Development Environment or IDE. For example the Arduino IDE.
However, with the explosion of micro-controller types it became impossible for one vendor to supply all the tools in the chain. In a tool chain the Graphical User Interface (GUI) might be supplied by one vendor, the editor a second, the compiler a third and the debugging a fourth. These would all be integrated into the one package. Possibly the only time the user is aware of the individual tools is when they set up their tool chain and need to load a range of tools from different vendors.
The Arduino IDE is the entry point for many hobbyists into the micro-controller environment. The Arduino IDE is relatively simple allowing projects to be easily and quickly developed. It is free to download from the Internet. It does have limitations compared with advanced IDE's used by professional developers but many projects do not require all the features and complexity of advanced IDEs.
Here is what a simple program looks like in the Arduino IDE:
To create a new program click on the centre button (the page symbol with the corner folded) and a program template will be generated. The Arduino calls a program a "sketch". The user then adds their code. (By chance in the example all lines starting in red are user code)
The Arduino sketches are in fact "C" code. The Arduino IDE supplies plenty of C libraries that hide many of the implementation details that would be a challenge for first time uses. Starting from scratch a "Hello World" example of flashing an LED would require a knowledge of the micro-controller registers and how to program them. In the above example the pinMode( ) sets the register that is wired to the pin as an output, the digitalWrite( ) sets/clears the pin without impacting on other pins while the delay( ) uses the timing registers to determine the delay time. In the Arduino IDE select Help-->Reference for a list of available functions.
For more advance projects there are many libraries developed by the Arduino Community that may be used to perform all the "grunt" work and simplify the developer's task..
Once the program is entered the next task is compiling. This uses the left "tick" button called "Verify". This will translate the high level language program into machine code that is understood by the processor. As shown in the figure the IDE will indicate the storage and dynamic memory required by the program. If there are compilation errors these will also be shown in this window.
Once the program successfully compiles it can be uploaded into the target processor. The second button "Upload" (the arrow) will transfer the machine code into the processor. This requires provision by the target processor to receive the data as described in the next section
The final desirable attribute for the tool chain is debugging and this is where the Arduino IDE has only minimal capability so the developer needs to add debugging capability to their programs. The Arduino does have a serial monitor that the developer can use to display messages.
With the Arduino UNO the target processor is the ATMega328P. It is not a blank chip. It has a bootloader program burnt in that will
1. read the data coming from the IDE over the USB,
2. store the program in flash memory, and
3. when the transfer is complete start the program execution.
Early micro-controllers were blank. As the technology evolved their program memory included a small boot-loader program than upon reset would read the data from the workstation over the serial bus. The user, prior to transferring the code was required to manually reset the micro-controller and also set a second input to let the micro-controller know if on reset it was to execute the boot-loader or an application program.
More modern implementations use a USB link. As well as the two data lines (Tx and Rx) the USB to serial chip outputs two control lines: Data Terminal Ready and Request To Send. These lines may be used to initiate the reset and determine what happens.
With the Arduino when new data is received at the USB to Serial link/bridge the DTR signal is set low. With the CR network this generates a low pulse that resets the ATMega328P. The Boot Loader will then read the serial data, that is the application code and place it into the application portion of the Flash memory. After the application code is loaded, the micro-controller will start executing the application code. (See ATMega328 Manual for much greater detail).
Note the ATMega328 could also be reset by using the button or at power on via the second capacitor and the pull up resistor. In this case the boot-loader finds there is no data at the USB/Serial chip so jumps straight to the application code.
On the Arduino Forum there was discussion of the Arduino failing to read programs when there was no DTR signal. The recommended solution was that while the code was being compiled hold the reset button and when complete release the reset button and code could successfully be transferred to the Arduino. This suggests that following reset the boot-loader spends a short time waiting for code and if nothing it goes straight to executing the application code.
In summary one of the big challenges of the early microprocessor days, that of loading and running a program has become straight forward.
In summary to set up the Arduino IDE the steps are:
1. From the Arduino Site download the set up for the Arduino IDE. Each version grows in size. Version 1.12.8 is 114,558 KB. See https://www.arduino.cc/en/Guide/HomePage
2. Open the Arduino and create a new sketch. Use the centre button in the IDE.
3. Add the desired code. The example is for a sketch to flash the built-in-led.
4. Select the target processor or board. For the UNO Select Tools-->Board --> Arduino UNO: See screen below.
5. It will also be necessary to select the communication port used by the workstation. ie Tools-->Port-->. This will change with different projects
Historically each individual microprocessor (micro-controller) required a unique piece of hardware in the MDS. This was expensive. Today the differences are accounted for in configuration firmware. In the screen shot with Version 1.8.12 of the IDE there is the option of 27 separate Arduino based boards. Further if the NANO is chosen there is the choice of the old or new boot-loader. (Version 1.6.5 of the IDE had only 21 boards listed)
The previous section related to Arduino AVR Boards. To allow the Arduino IDE to be used for the development of micro-controllers from other families the IDE includes an extension. This will allow the Arduino IDE editor to be used but the results are then compiled for a "new" processor. The advantage is that applications can be developed for other processors without the developer having to learn more complex and/or different tools. The disadvantage is that some of the features/attributes of the "new" processor may be hidden in the simplification. It may also lead to the impression that this "new" processor is similar to the ATMega828 in the Arduino when they are not.
To use the Arduino Integrated Development Environment (IDE) an extensive upgrade is required (The text assumes an ESP8266 board is to be added.)
If required Install the drivers: (I was using a WiFi Mini product code XC3802 from Jaycar) and found my PC recognized the XC3802 I was using so this step was not necessary)
If the library is not found the WiFi Mini uses a CH340G USB-Serial IC. The drivers for this can be downloaded from the IC manufacturer’s website: http://www.wch.cn/download/CH341SER_ZIP.html
To add board support for other boards it is recommended to use Arduino IDE version 1.6.4 or later so that the Boards Manager can handle the installation.
1. To install board support for ESP8266, in File>Preferences>Additional Board Manager URLS add: http://arduino.esp8266.com/stable/package_esp8266com_index.json separating from existing entries with a comma.
2: Go to Tools>Boards>Boards Manager and type 'esp' in the search box
3. Install ESP8266 by ESP8266 Community. (Button on lower right) This is about 150MB download and can take a while.
4. Select the desired ESP6266 board. My board was identical to the 'WeMos D1 Mini Lite’
The Arduino IDE will now start creating, compiling and running programs with the new program board.
I had a need to use the STM32F401 so following https://www.instructables.com/id/Quick-Start-to-STM-Nucleo-on-Arduino-IDE/ I included https://raw.githubusercontent.com/stm32duino/BoardManagerFiles/master/STM32/package_stm_index.json in the Additional Boards Manager.
I had been using the Arduino several times a day for many years.The Arduino IDE suddenly would not start up.It would reach the screen saying it is "Initialising Packages" and then exit.
A search of the Arduino Forum provided the following suggestions. (Some of the discussion appeared to apply to problems with Arduino updates but I didn't believe this was the problem in my case).
Solutions that applied if final screen was "hidden":
1. Check if screen going to second monitor.
2. Go to Task Manager -> Application->Select App->Bring to front
3. Hover over active Arduino Task Bar Icon -> Right Click -> Maximise ->Resize IDE Window ->exit Arduino ->Restart Arduino
4. Delete c:\user\john\AppData\Local\arduino15. (See close to bottom in preferences screen shot.)
5. Make sure Documents\Arduino\libraries was present.
6. In the command file run Arduino_debug. In my case I had 3 issues related to Java
The folder " AppData\Local\arduino15" was not visible until I selected "Hidden items" on Windows Explorer.
Deleting the folder "AppData\Local\arduino15" did solve the restart problem. However I then had to reload all of my contributed libraries.