Is Arduino Simpler than Microcontrollers?

Follow+Star Public Account Number, don’t miss out on exciting content

Is Arduino Simpler than Microcontrollers?

Compilation | strongerHuang

Public Account | Embedded Column

Recently, a reader asked this question: I am a beginner, is Arduino simpler than microcontrollers, and how should I get started?
With this question, today I will share some content related to Arduino and microcontrollers, as well as a basic tutorial for getting started with Arduino.

Getting to Know Arduino

To understand Arduino, we must first understand what a microcontroller is. The foundation of the Arduino platform is actually the AVR instruction set microcontroller.

1. What is a Microcontroller?

A working computer consists of the following components: Central Processing Unit (CPU for computation and control), Random Access Memory (RAM for data storage), Read-Only Memory (ROM for program storage), and Input/Output devices (I/O such as serial and parallel ports). In personal computers (PCs), these components are divided into several chips installed on a printed circuit board called the motherboard. In a microcontroller, all these components are integrated into a single integrated circuit chip, hence the name microcontroller (single-chip). Some microcontrollers also integrate additional components such as Analog/Digital conversion (A/D) and Digital/Analog conversion (D/A).

2. What is the Use of Microcontrollers?

The saying goes, why use a sledgehammer to crack a nut? Not every situation requires high performance. Imagine a voice-controlled light using an Intel i7 processor; its cost-performance ratio would be astronomical. The key to application is whether it is sufficient and whether it has a good performance-to-price ratio, which is where microcontrollers fill the gap.

3. What is Arduino?

From the perspective of microcontrollers, what is Arduino?

Arduino is a convenient, flexible, and easy-to-use open-source electronic prototyping platform, including hardware (various models of Arduino boards) and software (Arduino IDE). It is suitable for artists, designers, hobbyists, and anyone who wants to tinker.

The features are simple shapes that can interact with people, and even a ten-year-old child can use it to create what they want. Arduino can sense the environment through various sensors and control lights, motors, and other devices to feedback and affect the environment.

The microcontroller on the board can be programmed using Arduino’s programming language, compiled into binary files, and uploaded to the microcontroller. Projects based on Arduino can include just Arduino or a combination of Arduino and other software running on a PC, communicating with each other (such as Flash, Processing, MaxMSP) to achieve functionality.

Types of Arduino

There are so many Arduino boards available on the market. Excluding the dozen or so from the original manufacturer, there are thousands of various Arduino types on platforms like Taobao, which is overwhelming for beginners.
Choosing a suitable Arduino for a project is half the success; let’s take a look at the most common Arduino boards and how to distinguish them.
Is Arduino Simpler than Microcontrollers?
Arduino Mega

To distinguish so many boards and select the right Arduino, mainly consider the following three aspects: performance, features, and size.

First, look at performance, which includes processor memory, clock frequency, and bit width. The hardware processing capability usually depends entirely on the chip on the board, which also limits the software that can run.

Next, consider features, which include everything on the board except the microprocessor, such as input/output pins, integrated components (buttons, LEDs, motor drivers, etc.), and the types and numbers of available interfaces (USB, Ethernet, etc.).

Finally, consider size. Due to the nature of different projects, the volume and weight allocated for the electronic components can vary significantly. For example, if you want to make a tracker for a dog, using a Mega with a battery pack and expansion board would result in at least a size of 10*5*5cm and a weight of 200g. Is this a tracker or a sandbag? This is why there are so many different Arduino models.

Having said so much, let’s take a look at some mainstream Arduino boards.

1. Arduino Uno

Processor: ATmega328 (8-bit CPU, 16MHz clock frequency, 2KB SRAM, 32KB flash)

Features: 14 digital I/O ports, 6 analog input ports, replaceable processor design

Size: 75 x 55mm

Price: $30

Is Arduino Simpler than Microcontrollers?

2. Arduino Leonardo

Processor: ATmega32u4 (8-bit CPU, 16MHz clock frequency, 2.5KB SRAM, 32KB flash)

Features: 20 digital I/O ports, 12 of which can be used as analog ports, native USB support

Size: 75 x 55mm

Price: $25

Is Arduino Simpler than Microcontrollers?

3. Arduino Due

Processor: Atmel SAM3X8E ARM Cortex-M3 (32-bit CPU, 84MHz clock frequency, 96KB SRAM, 512KB flash)

Features: 54 digital I/O ports, 12 analog input ports, 2 analog output ports, native USB support

Size: 100 x 55mm

Price: $50

Is Arduino Simpler than Microcontrollers?

4. Arduino Micro

Processor: ATmega32u4 (8-bit CPU, 16MHz clock frequency, 2.5KB SRAM, 32KB flash)

Features: 20 digital I/O ports, 12 of which can be used as analog ports, native USB support

Size: 50 x 18 mm

Price: $27

Is Arduino Simpler than Microcontrollers?

5. LilyPad Arduino

Processor: ATmega328 (8-bit CPU, 16MHz clock frequency, 2KB SRAM, 32KB flash)

Features: 14 digital I/O ports, 6 analog input ports

Size: 50mm diameter round

Price: $22

Is Arduino Simpler than Microcontrollers?

Of course, there are many more; I won’t list them all here. Interested readers can learn more on their own.

Installing Arduino Compiler Environment

Download link:
https://www.arduino.cc/en/Main/Software

Is Arduino Simpler than Microcontrollers?

All three mainstream operating systems Windows, Mac, and Linux are supported, so you can choose to download based on your situation.
The installation process is straightforward; you can basically just click “Next” all the way through. If you can’t install it, I think you are an inadequate developer.

How to Use Arduino IDE

This small experiment aims to light up the LED on pin 13 of the Arduino UNO board for one second, then turn it off, wait for another second, and repeat.

Now, let’s assume we are using the Arduino UNO model (recommended for beginners due to its stability) and have set up the Arduino development environment and installed the USB driver as per the above steps.

1. Connect the Arduino Control Board to the Computer

Plug one end of the USB cable into the Arduino control board and the other end into the USB port of the computer. (Note: When working independently, the Arduino control board can be powered either by USB or by a power bank or adapter.)

Connect the Arduino control board to the computer

Open Arduino IDE, and the editing interface of Arduino IDE will appear

Is Arduino Simpler than Microcontrollers?

2. Get to Know Arduino IDE

Let’s briefly get to know this Arduino compiler, as we will be working with it often.

Is Arduino Simpler than Microcontrollers?

Arduino IDE is the software editing environment for Arduino products. Simply put, it is where you write code and download code.

Any Arduino product needs to have code downloaded to function.

The hardware circuit we set up assists the code in completing tasks; both are indispensable. It’s like how a person controls their body through their brain. If the code is the brain, the hardware is the body, and the body’s activities depend on the brain, so the hardware implementation depends on the code.

The basic functional areas of Arduino IDE have been marked above (I used an old image for convenience, but it has the same layout as the new version). Most of the white area in the image is the code editing area, where you input code. Note that when entering code, you should switch to English input mode. The black area below is the message prompt area, which will display whether the compilation or download was successful.

3. Download a Blink Program

Is Arduino Simpler than Microcontrollers?

Download the simplest code, which will help us familiarize ourselves with how to download programs and test the board’s functionality.

The LED marked L on the UNO board will blink with this test code.

4. Open Blink

Plug in the USB cable, open Arduino IDE, and find the “Blink” code.

File > Examples > 01.Basics > Blink

Is Arduino Simpler than Microcontrollers?

Is Arduino Simpler than Microcontrollers?

5. Verify the Program

Usually, after writing a piece of code, we need to verify it to check for errors. Click “Verify”.

Is Arduino Simpler than Microcontrollers?

After verification (compilation) is complete, you will see the corresponding prompt.

Since this is sample code, there should be no errors during verification. However, in the future, when writing code, you will need to verify it before downloading it to Arduino.

Before downloading the program, we also need to tell Arduino IDE which board we are using and which serial port corresponds to it.

6. Set the Board Type

Arduino includes various versions of controllers, among which the most common are the Uno, Leonardo, and Mega series controllers (the most comprehensive selection guide).

In the board section, you need to select the board type according to the firmware type of the main control hardware you have chosen. (In this example, we are using a controller with Uno as its bootloader) Tools > Board > Arduino Uno

Is Arduino Simpler than Microcontrollers?

7. Set the Serial Port

Tools > Serial Port > xx, where xx must match what you see in your computer’s device manager.

Is Arduino Simpler than Microcontrollers?

8. Download the Program

As shown, click “Upload” at the end. (Uploading here is the same as downloading previously.)

Is Arduino Simpler than Microcontrollers?

Upload complete!

If everything goes well, we should be able to see the program running visually on the board:

The LED on pin 13 of the Arduino Uno board is blinking.

Alright, this is the most basic operation of the IDE; I hope this article helps you.

Disclaimer: The materials in this article are sourced from the internet, and the copyright belongs to the original author. If there are any copyright issues, please contact me for removal.
———— END ————
Follow the public account and reply ‘ Microcontroller ‘ or ‘ Popular Science Knowledge ‘ to read more related articles.
Welcome to follow my public account, reply ‘ Join Group ‘ to join the technical exchange group according to the rules, or reply ‘ 1024 ‘ to see more content.

Is Arduino Simpler than Microcontrollers?

Is Arduino Simpler than Microcontrollers?

Click “Read Original” for more sharing.

Leave a Comment