This is an old revision of the document!


Setting up the programming environment

Before starting programming the microcontroller, it is necessary to connect it to the computer.

Connection

Arduino Uno microcontroller is taken as a board for programming example tasks. It can be connected to a computer, using Universal Serial Bus (USB) port, using appropriate USB cable. A microcontroller can be used together with prototyping board or a robot. In the simplest programming tasks it can be used as an independent device.

Power

To operate with the microcontroller, it can be connected to an external power supply or USB port. The microcontroller determines the power source automatically. If external power supplies other than USB are used, GND and VIN ports should be used to connect the power supply. The manufacturer recommends the use of a voltage of 7-12 V to ensure a normal operation of the microcontroller. If the voltage is exceeded, before reaching 20 V, then the power supply circuits of microcontroller may get overheated. If the supply voltage is lower than 7 V, then the microcontroller may function unstable and the result will be unpredictable.

In addition to the above mentioned, the microcontroller can provide small power supply for external circuits by connecting them according to the microcontroller pins.

Table 1: The power pins of Arduino UNO.
Name Description
VIN The input of a power supply when USB port is not used, i.e., an external power supply is used.
5V A regulated 5V power supply, which can be provided via both USB and VIN.
3.3V A 3.3V supply voltage for external circuits. The maximum current that this output can provide is 50 mA. If it is exceeded, the power supply circuits of the microcontroller may be permanently damaged.
GND Ground or 0 port.

Inputs/Outputs

Each of the 14 digital inputs/outputs (I/O) of the microcontroller can be used to send or receive signals using the pinMode(), digitalWrite() and digitalRead() commands, which will be more detailed discussed in the chapter about the basics of programming. All I/O operate in the range of 0V to 5V. Each of the I/O is capable of receiving or sending no more than 40 mA of current. They all have internal load resistors in the range of 20-50kΩ.

Descriptions of other microcontroller pin and their specific use are explained below. In addition to these I/O, the microcontroller also provides other specific functions that will be described below.

Table 2: Specific I/O pins of Arduino UNO.
Name Description
O(RX) and 1(TX) Serial I/O for serial communication. RX is used for receiving data, and TX for sending data to external devices. For data transmitting and receiving, the voltage must not exceed 5 V.
2 and 3 External interrupt pins that can be used to receive external interrupt in cases when the value is low, value is changed, etc. For this functionality the function attachInterrupt() is used.
PWM: 3, 5, 6, 9, 10, 11 Pulse Width Modulation (PWM) pins are used to provide 8-bit PWM signal that often can be used for motor management or other specific use cases. For this functionality the analogWrite() function is used.
SPI: 10(SS), 11(MOSI), 12(MISO), 13(SCK) Pins that support Serial Peripheral Interface (SPI) communications. For this the SPI library is used.
LED: 13 This pin is used to manage the built-in LED. LED can be turned on by setting the value of pin HIGH and turned off by setting pin value LOW.
A4(SDA) and A5(SCL) Two Wire Interface (TWI) pins, Serial Data Line (SDA) and Serial Clock Line (SCL), are the alternative of the data exchange using serial communication. For supporting TWI, the Wire library should be used.
AREF It is the reference voltage for the analog inputs. For this functionality analogReference() is used.
Reset Gives the opportunity to reset the microcontroller by setting this pin to LOW.
en/iot-open/programming_fundamentals_rtu/setting_up_programming_environment.1515588174.txt.gz · Last modified: 2020/07/20 09:00 (external edit)
CC Attribution-Share Alike 4.0 International
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0