rtes:topics:arduino:start
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
rtes:topics:arduino:start [2017/10/17 10:38] – admin | rtes:topics:arduino:start [2018/10/18 08:56] (current) – [Lecture Notes] admin | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Intro to Arduino ====== | ====== Intro to Arduino ====== | ||
- | | {{https:// | + | | {{https:// |
- | | //Fig.: Arduino | + | | //Fig.: Arduino |
/* | /* | ||
Line 14: | Line 14: | ||
*/ | */ | ||
- | **Technical data** | + | **Technical data (Arduino UNO processor)** |
- | * Microcontroller: ATSAMD21G18, | + | * Microcontroller ATmega328P |
- | * Embedded debugger | + | * Operating |
- | * Operating | + | * Input Voltage (recommended) 7-12V |
- | * Input voltage: | + | * Input Voltage (limit) 6-20V |
- | * Input voltage, max.: 6 - 20 V | + | * Digital I/O Pins 14 |
- | * Digital I/O pins: 20 (2 PWM) | + | * PWM Digital I/O Pins 6 |
- | * UART: 1 | + | * Analog Input Pins 6 |
- | * Analogue input pins: 6, 12-bit ADC channel | + | * DC Current |
- | * 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 (ATmega328P) of 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 | + | * Clock Speed 16 |
- | * 32-bit CRC generator | + | |
- | * Two-channel Inter IC Sound (I2S) interface | + | |
- | * Peripheral touch controller | + | |
- | * Clock speed: 48 MHz | + | |
- | + | ||
- | https:// | + | |
===== Lecture Notes ===== | ===== Lecture Notes ===== | ||
+ | |||
+ | ==== University of Washington, Computer Sciences (CS), Course Number CSE P567 ==== | ||
+ | |||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | and Interrupts]] | ||
/* | /* | ||
Line 61: | Line 62: | ||
===== Lab / Exercises ===== | ===== Lab / Exercises ===== | ||
- | ==== Background: | + | ==== Background: |
- | {{https:// | + | The CPU used is [[https:// |
- | + | ||
- | We will use the next generation **[[https:// | + | |
- | + | ||
- | The CPU used is [[http:// | + | |
Line 79: | Line 76: | ||
==== Setting up the Arduino IDE tool chain ==== | ==== Setting up the Arduino IDE tool chain ==== | ||
- | Please follow the instructions on [[https:// | + | Please follow the instructions on [[https:// |
==== 0. General Basic Commands ==== | ==== 0. General Basic Commands ==== | ||
Line 123: | Line 120: | ||
- | * How to connect switches to ditital | + | * How to connect switches to digital |
* 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 132: | Line 129: | ||
* Resolution of ADC? How many bits? How many different amplitude values? | * Resolution of ADC? How many bits? How many different amplitude values? | ||
- | * Connect a potentiometer to an analog input of Arduino: The outer pins are connected to GND and VCC, respectively. The middle terminal is connected to the ADC. | + | * Connect a potentiometer to an analog input of Arduino: |
+ | * Read the values from the ADC and write them to the serial port. | ||
+ | * What are min and max values? | ||
+ | * How many bits resolution does the ADC have? | ||
+ | * Use the function //map()// to transform the ADC values to an interval of 0 to 100. | ||
- | Read the values from the ADC and write them to the serial port. | ||
- | What are min and max values? | ||
- | Use the function //map()// to transform the ADC values to an interval of 0 to 100. | + | ==== 4. Analog Output by Pulse Width Modulation ==== |
+ | The " | ||
+ | The ratio $r = \mathrm{\frac{pulse\; | ||
- | ==== 4. Analog Output ==== | + | The average voltage of the signal is then a linear function of $r$: |
- | Resolution of PWM? How many bits? How many different amplitude values? | + | $V_\mathrm{avg} = r\cdot V_\mathrm{cc} + (1-r)\cdot 0V = r\cdot V_\mathrm{cc}$ |
- | 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. | + | * Use the function " |
+ | * 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. | ||
==== 5. Serial Communication (UART) ==== | ==== 5. Serial Communication (UART) ==== |
rtes/topics/arduino/start.1508236686.txt.gz · Last modified: 2017/10/17 10:38 by admin