Unit 1 Introduction to Arduino BOARD.pptx

HarshalVaidya5 40 views 41 slides Jul 24, 2024
Slide 1
Slide 1 of 41
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37
Slide 38
38
Slide 39
39
Slide 40
40
Slide 41
41

About This Presentation

Engineering


Slide Content

Introduction to microcontroller (Unit 1) ‹#›

Embedded Systems ‹#› Hard to Define As, it constantly evolves with advances in technology and dramatic decreases in the cost of implementing various hardware and software components. An embedded system is a system that has software embedded into computer-hardware, which makes a system dedicated for an application or specific part of an application or product or part of a larger system. An embedded system is one that has a dedicated purpose software embedded in a computer hardware. Based on Microprocessors or microcontrollers (embedded controllers). 2

Microprocessor (MPU or uP) ‹#› MPU (CPU) Read instructions Process binary data A microprocessor is a computer processor which incorporates the functions of a computer 's central processing unit (CPU) on a single integrated circuit (IC),or at most a few integrated circuits. ‹#›

Microprocessor-Based Systems ‹#› 330_01 ‹#›

Microcontrollers (uC) ‹#› electronic device three on a that major single Integrated computing includes components chip Microprocessor (MPU) Memory I/O (Input/output) ports Support Devices Timers A/D converter Serial I/O 330_01 ‹#›

MCU-Based System ‹#›

Differences between μC and μP ‹#› μC μP

‹#› Microprocessor Microcontroller CPU is stand-alone, RAM, ROM, I/O & timer are separate. CPU, RAM, ROM, I/O & timer all are on single chip. Designer can decide amount of RAM, ROM & I/O ports. Fixed amount of on-chip RAM, ROM & I/O ports. High processing power Low processing power High power consumption Low power consumption Typically 32/64 bit 8/16 bit General purpose Single purpose (control oriented) Less reliable Highly reliable Examples:  8086, 8085 Examples: 8051, ATmega328P

Role of microcontroller in embedded system They satisfies market needs, have so many features, and are designed for satisfying embedded system needs. That means perform functions only for its (embedded systems) purpose. They provide wide marketing area for embedded systems. They upgrade standard of embedded system market. It simplifies the complexity of market needs. They help in innovations (standard applications). Power consumption factor is more favorable: They require or consume less energy, which is the main factor, to satisfy user needs. ‹#›

‹#› Heart of the embedded system: Microcontroller because it gives life for embedded system applications. The invention of microcontroller made an unexpected changes in embedded technology. Applications have high perfection: Perfection in embedded system applications by the invention of microcontroller. Reduces cost of embedded system applications: Embedded systems are designed to do some specific task in contrast to a general purpose computer which is used for multiple tasks. It makes embedded systems flexible in market.

‹#› Make effective use (due to cost): Many embedded systems more microcontrollers, which have self sufficiency and cost-effectiveness. Embedded systems are typically far cheaper than general-purpose personal computers. Interconnection: Once the hardware is decided upon, an interconnection fabric must be devised. Testing and verification: The increase in complexity combined with a lack of knowledge about individual IP blocks that comes with reuse techniques leads to problems in adequate testing and verification of the complete systems. Energy management: Efficient metering systems helps in energy conservation.

Open Source Embedded Platforms ‹#› Open source platform that can be freely used, changed and shared by anyone. Open source software is made by many people and distributed under licenses that comply with the open source definition. Hardware is also undergoing an open source revolution. The developer provides CAD files to the user. Licensed under CERN or TAPR open h/w license.

Open Source Embedded Platforms : Examples ‹#› Arduino Banana Pi BeagleBone Black Panda board OLinuXino

What is Arduino ‹#› Arduino is a movement, not a microcontroller: Founded by Massimo Banzi and David Cuartielles in 2005 Arduino is an open-source electronics platform based on easy-to-use hardware (uC) and software (IDE). Arduino is open source hardware and software. Hardware based on Microcontroller and Software based on Processing Programming IDE. Arduino was designed for designers who want to incorporate physical computing into their designs without having knowledge of electrical & electronics. Arduino makes your life simple by hiding away most of the complexities of programming microcontrollers.

Why Arduino ‹#› Easy to use Hardware Platform Ease of programming Ease of Interfacing of Real life peripherals Open source and extensible hardware Open source and extensible software Low Cost Multiplatform environment

Flavors of Arduino H/W ‹#› resented By: Mr. Shridhar Dudam 14

Arduino Boards ‹#›

Typical Arduino UNO Board ‹#›

ATmega328 Internal Architecture ‹#›

Features ATmega328/P Microcontroller 8-bit family Architecture RISC Flash (Bytes) 32K SRAM (Bytes) 2K EEPROM (Bytes) 1K General Purpose I/O Lines 23 SPI   2 TWI (I2C)  1 USART 1 ADC 10-bit 15kSPS ADC Channels  8 8-bit Timer/ Counters  2 16-bit Timer/ Counters  1 Operating Voltage 1.8V-5.5V PWM Channels 6 Six Sleep Modes Idle ADC Noise Reduction Power-save Power-down Standby Extended standby ‹#›

Arduino IDE ‹#› The Arduino language is based on C/C++. It links against AVR Libc and allows the use of its functions Code is case sensitive Statements are commands and must end with a semi-colon Comments follow a // or begin with /* and end with */ See: http://arduino.cc/en/Guide/Environment for more information

Arduino IDE : Important Icons ‹#›

Sketch and Sketchbook ‹#› Programs in Arduino called as sketches Sketches must saved in the directory. Arduino IDE uses the concept of a sketchbook: A standard place to store programs (or sketches). IDE automatically creates directory for the sketchbook. Sketches were saved with a .ino file extension.

Arduino IDE : Sketch Structure ‹#›

Arduino Programming Environment ‹#› Arduino uses Object Oriented Programming. Arduino is programmed with C and C++. All Arduino libraries are made using C++ in order to be easily reusable The native library is designed for a very elementary and global purpose. Arduino programs can be divided in Structure Values (variables and constants) Functions.

Structure (1) ‹#› From global conditional control structures to more specific ones. Basic Structure setup() loop() Control Structures (Conditional Statements) if , if...else and switch case for, while and do... while break and continue return goto

if …. else statement ‹#›

Switch case and break ‹#›

Loop statement : for loop ‹#› Syntax example

While loop structure ‹#› Syntax Example

do … while loop structure ‹#› Syntax Example

Structure : Operators ‹#› Arithmetic Operators Comparison Operators = (assignment operator) == (equal to) + (addition) != (not equal to) - (subtraction) < (less than) * (multiplication) > (greater than) / (division) <= (less than or equal to) % (modulo) >= (greater than or equal to) ed By: Mr. Shridhar Dudam Bitwise Operators Compound Operators & (bitwise and) ++ (increment) | (bitwise or) -- (decrement) ^ (bitwise xor) += (compound addition) ~ (bitwise not) -= (compound subtraction) << (bitshift left) *= (compound multiplication) >> (bitshift right) /= (compound division) %= (compound modulo) &= (compound bitwise and) |= (compound bitwise or)

Structure : Operators ‹#› Boolean Operators Pointer Access Operators && (and) || (or) ! (not) * dereference operator & reference operator

Values: Variables ‹#›

Values: Variables ‹#›

Values: Constants ‹#› HIGH | LOW INPUT | OUTPUT | INPUT_PULLUP LED_BUILTIN true | false integer constants floating point constants

Values : Type Conversion ‹#› Type conversion is the process that changes an entity data type into another. Type conversion can be implicitly done or explicitly made. Explicit Type Conversion char() byte() int() word() long() float()

The Scope Concept ‹#› The scope can be defined as a particular property of a variable. A variable can be global and then is visible and usable everywhere in the source code. But a variable can also be local, declared inside a function, for instance, and that is visible only inside this particular function.

Functions (1) ‹#› Math Digital I/O pinMode() digitalWrite() digitalRead() Analog I/O analogReference() analogRead() analogWrite() - PWM Due & Zero only analogReadResolution() ■ analogWriteResolution() ■ tan() min() max() abs() constrain() map() pow() sqrt() Trigonometry sin() cos()

Functions (2) Advanced I/O tone() noTone() shiftOut() shiftIn() pulseIn() Time millis() micros() delay() Characters isAlphaNumeric() isAlpha() isAscii() isWhitespace() isControl() isDigit() isGraph() isLowerCase() isPrintable() isPunct() isSpace() isUpperCase() ‹#› ■ delayMicroseconds()

Functions (3) ‹#› Random Numbers randomSeed() random() Bits and Bytes lowByte() highByte() bitRead() bitWrite() bitSet() bitClear() bit() 46
Tags