User Tools

Site Tools


rtes:topics:arduino:start

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
rtes:topics:arduino:start [2017/10/17 11:03] – [4. Analog Output by Pulse Width Modulation] adminrtes:topics:arduino:start [2018/10/18 08:56] (current) – [Lecture Notes] admin
Line 1: Line 1:
 ====== Intro to Arduino ====== ====== Intro to Arduino ======
  
-|  {{https://store-cdn.arduino.cc/uni/catalog/product/cache/1/image/520x330/604a3538c15e081937dbfbd20aa60aad/a/0/a000111_featured.jpg?600}}  |  +|  {{https://store-cdn.arduino.cc/uni/catalog/product/cache/1/image/520x330/604a3538c15e081937dbfbd20aa60aad/a/0/a000066_featured_1_.jpg?600}}  |  
-|  //Fig.: Arduino M0 Pro. CPU: ATSAMD21G1832-bit ARM Cortex M0+ //  |+|  //Fig.: Arduino UNO Rev 3. CPU: Microchip (Atmel) ATmega328p8-bit AVR Core. https://store.arduino.cc/arduino-uno-rev3 //  |
  
 /* /*
Line 14: Line 14:
 */ */
  
-**Technical data (Arduino M0 Pro processor)** +**Technical data (Arduino UNO processor)** 
-  * Microcontroller: ATSAMD21G18, 32-bit ARM Cortex M0+ +  * Microcontroller ATmega328P 
-  * Embedded debugger +  * Operating Voltage 5V 
-  * Operating voltage: 3.3 V +  * Input Voltage (recommended) 7-12V 
-  * Input voltage: 7 - 12 V +  * Input Voltage (limit) 6-20V 
-  * Input voltage, max.: 6 - 20 V +  * Digital I/O Pins 14 (of which 6 provide PWM output
-  * Digital I/O pins: 20 (PWM) +  * PWM Digital I/O Pins 6 
-  * UART: 1 +  * Analog Input Pins
-  * Analogue input pins: 6, 12-bit ADC channel +  * DC Current per I/O Pin 20 mA 
-  * Analogue output pins: 1, 10-bit DAC +  * DC Current for 3.3V Pin 50 mA 
-  * DC per I/O pin: 7 mA +  * Flash Memory 32 KB (ATmega328Pof which 0.5 KB used by bootloader 
-  * Flash memory: 256 KB +  * SRAM 2 KB (ATmega328P
-  * SRAM: 32 KB +  * EEPROM 1 KB (ATmega328P
-  * 32-bit real-time counter (RTCwith clock/calendar function +  * Clock Speed 16 MHz 
-  * 32-bit CRC generator +  https://store.arduino.cc/arduino-uno-rev3
-  * Two-channel Inter IC Sound (I2Sinterface +
-  * Peripheral touch controller (PTC+
-  * Clock speed: 48 MHz +
- +
-https://store.arduino.cc/arduino-m0-pro+
  
 ===== Lecture Notes ===== ===== Lecture Notes =====
 +
 +==== University of Washington, Computer Sciences (CS), Course Number CSE P567 ====
 +
 +  * [[https://courses.cs.washington.edu/courses/csep567/10wi/lectures/Lecture6.pdf|Lecture 6 – Introduction to the ATmega328 and Arduino]]
 +  * [[https://courses.cs.washington.edu/courses/csep567/10wi/lectures/Lecture7.pdf|Lecture 7 – ATmega328 Timers
 +and Interrupts]]
  
 /* /*
Line 61: Line 62:
 ===== Lab / Exercises ===== ===== Lab / Exercises =====
  
-==== Background: ARM Cortex M0+ Processor ==== +==== Background: Atmega328P Processor ====
- +
-{{https://www.arduino.cc/en/uploads/Guide/M0Pro_Usb_Ports.jpg?400}} +
- +
-We will use the next generation **[[https://store.arduino.cc/arduino-m0-pro|Arduino M0 Pro]]** for this course. Its core is an **[[https://en.wikipedia.org/wiki/ARM_Cortex-M|ARM Cortex M0+]]** processor which make it faster and more powerful than the Arduino UNO based on the AVR-8-bit core. +
  
-The CPU used is [[http://www.microchip.com/wwwproducts/en/ATsamd21g18|ATSAMD21G18]] having been designed by the former company Atmel which now has been taken over by Microchip. +The CPU used is [[https://www.microchip.com/wwwproducts/en/ATmega328p|ATmega328p]] having been designed by the former company Atmel which has been taken over by Microchip. 
  
  
Line 79: Line 76:
 ==== Setting up the Arduino IDE tool chain ==== ==== Setting up the Arduino IDE tool chain ====
  
-Please follow the instructions on [[https://www.arduino.cc/en/Guide/ArduinoM0|Getting started with the Arduino M0 Pro]].+Please follow the instructions on [[https://www.arduino.cc/en/Guide/ArduinoUno|Getting started with the Arduino and Genuino UNO]].
  
 ==== 0. General Basic Commands ==== ==== 0. General Basic Commands ====
Line 123: Line 120:
  
  
-  * How to connect switches to ditital inputs: Why do we have to use pull-up or pull-down resistors?+  * How to connect switches to digital inputs: Why do we have to use pull-up or pull-down resistors?
   * How to use and activate internal pull-up resistors of ATmega328 GPIO pins   * How to use and activate internal pull-up resistors of ATmega328 GPIO pins
   * //If buttonPressed() then ... else ... endif//   * //If buttonPressed() then ... else ... endif//
Line 144: Line 141:
 ==== 4. Analog Output by Pulse Width Modulation ==== ==== 4. Analog Output by Pulse Width Modulation ====
  
-The "old" AVR microcontrollers such as ATmege328 (used with Arduino UNOdo not have a real analog output. To work around this limitation a method called Pulse Width Modulation (PWM) is used. A square wave signal of fixed frequency is generated and provided at a port pin (digital output). The pulse width of the square wave (the time for the signal being logic high) can be changed whereas the total signal period T is kept constant (as a result of constant frequency). +The "old" AVR microcontrollers such as ATmege328, the core of Arduino UNOdo not have a real analog output. To work around this limitation a method called Pulse Width Modulation (PWM) is used. A square wave signal of fixed frequency is generated and provided at a port pin (digital output). The pulse width of the square wave (the time for the signal being logic high) can be changed whereas the total signal period T is kept constant (as a result of constant frequency). 
  
 The ratio $r = \mathrm{\frac{pulse\;width}{period}}$ is called duty cycle. The ratio $r = \mathrm{\frac{pulse\;width}{period}}$ is called duty cycle.
Line 154: Line 151:
   * Use the function "analog_out()". Observe the output signal with the oscilloscope.   * Use the function "analog_out()". Observe the output signal with the oscilloscope.
   * Resolution of PWM? How many bits? How many different amplitude values?   * Resolution of PWM? How many bits? How many different amplitude values?
-  * Read values from a potentiometer (10 bit), map the values to an 8 bit range \\and use the scaled value for a PWM output. Dim a LED. +  * Read values from a potentiometer (10 bit), map the values to an 8 bit range \\ and use the scaled value for a PWM output. Dim a LED. 
  
 ==== 5. Serial Communication (UART) ==== ==== 5. Serial Communication (UART) ====
rtes/topics/arduino/start.1508238217.txt.gz · Last modified: 2017/10/17 11:03 by admin