Skip to main content

Ardunio UNO R3

Ardunio UNO R3

The Arduino Uno R3 is a microcontroller board based on a removable, dual-inline-package (DIP) ATmega328 AVR microcontroller. It has 20 digital input/output pins (of which 6 can be used as PWM outputs and 6 can be used as analog inputs). Programs can be loaded on to it from the easy-to-use Arduino computer program. The Arduino has an extensive support community, which makes it a very easy way to get started working with embedded electronics. The R3 is the third, and latest, revision of the Arduino Uno.

POWER PIN'S

  • Reset Pin - When this pin is conneted to GND , The Arduino Restart.
  • 3.3V - This Pin is used to power 3.3V powered sensor. Max Current : 50 mA.
  • 5V - This Pin is used to power 5V powered sensor. Max Current : 400 mA When using on USB ; If Powered using DC Jack we can get higher.
  • GND - This Ground of Arduino.
  • VIN - This pin is used to give power supply to Arduino Board. Max Volt : 7V - 12V.

I/O PIN'S & FUNCTION'S

In ardunino there are "14 Digital I/O Pin's" & "6 Analog Input Pin's".
  • In Digital I/O Pin's, 6 Pin's are PWM Output (11,10,9,6,5,3 Pin).
  • Pin 0 & 1 - We can use UART TX & RX Communication.
  • Pin 13,12,11,10 - We can use SPI Communication.
  • Pin A5,A4 - We can use I2C Communication.

TYPES OF COMMUNICATION'S

  • UART TX & RX Communication.
  • SPI Communication.
  • I2C Communication.

UART COMMUNICATION

UART stands for Universal Asynchronous Reception and Transmission and is a simple communication protocol that allows the Arduino to communicate with serial devices. The UART system communicates with digital pin 0 (RX), digital pin 1 (TX)

HERE IS A VIDEO FROM ELECTRONOOB : CLICK HERE

SPI COMMUNICATION

Serial Peripheral Interface (SPI) is a synchronous serial data protocol used by microcontrollers for communicating with one or more peripheral devices quickly over short distances. It can also be used for communication between two microcontrollers.

With an SPI connection there is always one master device (usually a microcontroller) which controls the peripheral devices. Typically there are three lines common to all the devices:

  • MISO (Master In Slave Out) - The Slave line for sending data to the master,
  • MOSI (Master Out Slave In) - The Master line for sending data to the peripherals,
  • SCK (Serial Clock) - The clock pulses which synchronize data transmission generated by the master

and one line specific for every device:

  • SS (Slave Select) - the pin on each device that the master can use to enable and disable specific devices.

When a device's Slave Select pin is low, it communicates with the master. When it's high, it ignores the master. This allows you to have multiple SPI devices sharing the same MISO, MOSI, and CLK lines.

To write code for a new SPI device you need to note a few things:

  • What is the maximum SPI speed your device can use? This is controlled by the first parameter in SPISettings. If you are using a chip rated at 15 MHz, use 15000000. Arduino will automatically use the best speed that is equal to or less than the number you use with SPISettings.
  • Is data shifted in Most Significant Bit (MSB) or Least Significant Bit (LSB) first? This is controlled by second SPISettings parameter, either MSBFIRST or LSBFIRST. Most SPI chips use MSB first data order.
  • Is the data clock idle when high or low? Are samples on the rising or falling edge of clock pulses? These modes are controlled by the third parameter in SPISettings.

The SPI standard is loose and each device implements it a little differently. This means you have to pay special attention to the device's datasheet when writing your code.

Generally speaking, there are four modes of transmission. These modes control whether data is shifted in and out on the rising or falling edge of the data clock signal (called the clock phase), and whether the clock is idle when high or low (called the clock polarity). The four modes combine polarity and phase according to this table:

ModeClock Polarity (CPOL)Clock Phase (CPHA)Output EdgeData Capture
SPI_MODE000FallingRising
SPI_MODE101RisingFalling
SPI_MODE210RisingFalling
SPI_MODE311FallingRising

Once you have your SPI parameters, use SPI.beginTransaction() to begin using the SPI port. The SPI port will be configured with your all of your settings. The simplest and most efficient way to use SPISettings is directly inside SPI.beginTransaction(). For example:

SPI.beginTransaction(SPISettings(14000000, MSBFIRST, SPI_MODE0));

If other libraries use SPI from interrupts, they will be prevented from accessing SPI until you call SPI.endTransaction(). The SPI settings are applied at the begin of the transaction and SPI.endTransaction() doesn't change SPI settings. Unless you, or some library, calls beginTransaction a second time, the setting are maintained. You should attempt to minimize the time between before you call SPI.endTransaction(), for best compatibility if your program is used together with other libraries which use SPI.

With most SPI devices, after SPI.beginTransaction(), you will write the slave select pin LOW, call SPI.transfer() any number of times to transfer data, then write the SS pin HIGH, and finally call SPI.endTransaction().

HERE IS A VIDEO FROM ELECTRONOOB : CLICK HERE

Comments

Popular posts from this blog

Arduno Clock

  Arduino Clock This is a clock using RTC Tiny with Arduino. Using this we can see time & date.  FOR VIDEO :

MQ-5 GAS LEAK DETECTOR

  MQ-5 GAS LEAK DETECTOR  This project is used to detect the gas leak and alert us that the gas is leaking. You can use it for your science projects. FOR VIDEO :

Blutooth Switch (Arduino)

 BLUTOOTH SWITCH (ARDUINO) Hi, Using this we can control leds using Smart Phone via Blutooth. We can also control home appliances using Relay with it. For Video :  CLICK HERE  .