1. Draw and explain the Arduino pin configuration


Arduino Uno is a popular microcontroller development board based on 8-bit ATmega328P microcontroller. Along with ATmega328P MCU IC, it consists other components such as crystal oscillator, serial communication, voltage regulator, etc. to support the microcontroller.

 

Vin: This is the input voltage pin of the Arduino board used to provide input supply from an external power source.

5V: This pin of the Arduino board is used as a regulated power supply voltage and it is used to give supply to the board as well as onboard components.

3.3V: This pin of the board is used to provide a supply of 3.3V which is generated from a voltage regulator on the board

GND: This pin of the board is used to ground the Arduino board.


Reset: This pin of the board is used to reset the microcontroller. It is used to Resets the microcontroller.

Analog Pins: The pins A0 to A5 are used as an analog input and it is in the range of 0-5V. Digital Pins: The pins 0 to 13 are used as a digital input or output for the Arduino board. Serial Pins: These pins are also known as a UART pin. It is used for communication between the Arduino board and a computer or other devices. The transmitter pin number 1 and receiver pin number 0 is used to transmit and receive the data resp.

External Interrupt Pins: This pin of the Arduino board is used to produce the External interrupt and it is done by pin numbers 2 and 3.

PWM Pins: This pins of the board is used to convert the digital signal into an analog by varying the width of the Pulse. The pin numbers 3,5,6,9,10 and 11 are used as a PWM pin.

SPI Pins: This is the Serial Peripheral Interface pin, it is used to maintain SPI communication with the help of the SPI library. SPI pins include:

è SS: Pin number 10 is used as a Slave Select

è MOSI: Pin number 11 is used as a Master Out Slave In

è MISO: Pin number 12 is used as a Master In Slave Out

è SCK: Pin number 13 is used as a Serial Clock

LED Pin: The board has an inbuilt LED using digital pin-13. The LED glows only when the digital pin becomes high.

AREF Pin: This is an analog reference pin of the Arduino board. It is used to provide a reference voltage from an external power supply.

 

2. Draw and explain the Arduino architecture

Arduino’s processor basically uses the Harvard architecture where the program code and program data have separate memory. It consists of two memories- Program memory and the data memory.The code is stored in the flash program memory, whereas the data is stored in the data memory. The Atmega328 has 32 KB of flash memory for storing code (of which 0.5 KB is used for the bootloader), 2 KB of SRAM and 1 KB of EEPROM and operates with a clock speed of 16MHz.

It is important to understand that the Arduino board includes a microcontroller, and this microcontroller is what executes the instructions in your program.

The ATmega328 microcontroller is the MCU used in Arduino UNO R3 as a main controller. ATmega328 is an MCU from the AVR family; it is an 8-bit device, which means that its data- bus architecture and internal registers are designed to handle 8 parallel data signals.


 

 

ATmega328 has three ty pes of memory:

Flash memory: 32KB nonvolatile memory. This is used for storing application, which explains why you don't need to upload your application every time you unplug arduino from its power source.

SRAM memory: 2KB volatile memory. This is used for storing variables used by the application while it's running.

EEPROM memory: 1KB nonvolatile memory. This can be used to store data that must be available even after the board is powered down and then powered up again.

Power:

The MCU accepts supply voltages from 1.8 to 5.5 V. However, there are restrictions on the operating frequency; for example, if you want to use the maximum clock frequency (20 MHz), you need a supply voltage of at least 4.5 V.

Digital I/O:

This MCU has three ports: PORTC, PORTB, and PORTD. All pins of these ports can be used for general-purpose digital I/O or for the alternate functions indicated in the pinout below. For example, PORTC pin0 to pin5 can be ADC inputs instead of digital I/O.


There are also some pins that can be configured as PWM output. These pins are marked with “~” on the Arduino board.

ADC Inputs:

This MCU has six channelsPORTC0 to PORTC5with 10-bit resolution A/D converter. These pins are connected to the analog header on the Arduino board.

One common mistake is to think of analog input as dedicated input for A/D function only, as the header in the board states ”Analog”. The reality is that you can use them as digital I/O or A/D.

As shown in the diagram above (via the red traces), the pins related to the A/D unit are:

 

AVCC: The power pin for the A/D unit.

AREF: The input pin used optionally if you want to use an external voltage reference for ADC rather than the internal Vref. You can configure that using an internal register.

UART Peripheral:

A UART (Universal Asynchronous Receiver/Transmitter) is a serial interface. The ATmega328 has only one UART module.

The pins (RX, TX) of the UART are connected to a USB-to-UART converter circuit and also connected to pin0 and pin1 in the digital header. You must avoid using the UART if you’re already using it to send/receive data over USB.

SPI Peripheral:

The SPI (Serial Peripheral Interface) is another serial interface. The ATmega328 has only one SPI module.

Besides using it as a serial interface, it can also be used to program the MCU using a standalone programmer. You can reach the SPI's pins from the header next to the MCU in the Arduino UNO board or from the digital header as below:

11<->MOSI

12<->MISO

13<->SCK

TWI:

The I2C or Two Wire Interface is an interface consisting of only two wires, serial data, and a serial clock: SDA, SCL.

You can reach these pins from the last two pins in the digital header or pin4 and pin5 in the analog header.

 


Comments