[go: up one dir, main page]

100% found this document useful (1 vote)
92 views51 pages

Introduction To Microcontrollers: Jerry Spring VE6TL

This document provides an introduction to microcontrollers and their history and applications. It discusses how microcontrollers have become ubiquitous in devices like home appliances and discusses their phenomenal growth, especially in applications like connected cars and the Internet of Things. The document compares microprocessors and microcontrollers, outlines some popular microcontroller choices like Arduino, PICAXE, and Basic Stamp, and discusses what projects can be done with microcontrollers and the hardware and software needed. It focuses on Arduino as a popular choice, outlining its specifications, starter kits, sensors, projects, and online tutorials.

Uploaded by

Manoel Lopes
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
92 views51 pages

Introduction To Microcontrollers: Jerry Spring VE6TL

This document provides an introduction to microcontrollers and their history and applications. It discusses how microcontrollers have become ubiquitous in devices like home appliances and discusses their phenomenal growth, especially in applications like connected cars and the Internet of Things. The document compares microprocessors and microcontrollers, outlines some popular microcontroller choices like Arduino, PICAXE, and Basic Stamp, and discusses what projects can be done with microcontrollers and the hardware and software needed. It focuses on Arduino as a popular choice, outlining its specifications, starter kits, sensors, projects, and online tutorials.

Uploaded by

Manoel Lopes
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 51

Introduction to Microcontrollers

Jerry Spring VE6TL
Outline

• Introduction ‐ History
• Microcontroller vs Microprocessor
• What are the choices?
• What can I do with a microcontroller?
• What do I need to buy?
• What do I need to learn?
• Ham radio projects
But first… a little digital humour

Why do electronic engineers 
always confuse Halloween 
and Christmas?

Because 31 Oct = 25 Dec
Homebrewing – A Bit of History

Many 
homemade 
parts

High 
Voltage

Big

1940s – 50s
Kit Building– 1960s

No 
homemade 
parts

Low Voltage

Smaller
Tinkering – 1970s

Computers
All the rage

Mini to 
Micro

IC Technology
The Boolean Age – 1980s

Everything
Digital

New Chip
technologies

Architecture ‐
using discreet 
components
Homebrewing – 1990s – 2000s

Old and New 
technologies

Big and 
Small 
components

Is this the 
way to 
attract new 
hams to the 
hobby? 
Post 2002 ‐ Microcontrollers

Emphasis on 
creativity

Programming 
skills 
essential

No soldering 
– plug and 
play

Attracting 
wider 
audience
2010 – Arduino – Starter Kit

Emphasis on 
ease of use

Internet user 
groups and 
tutorials

Numerous 
“shields”

IoT
A step back…
Why Should I Care about MCUs?

Cooling System Coffee Maker Microwave Oven

These things are 
EVERYWHERE!

Smoke Alarm Dishwasher Oven Sensor


Phenomenal Growth*

*Courtesy of Atmel Corp.
Impact of IoT

“The market for MCUs used in connected cars, wearable electronics, 
building automation and other IoT applications is expected to grow at an 
overall compound annual growth rate (CAGR) of 11 percent, from $1.7 
billion in 2014 to $2.8 billion in 2019.” ‐ IHS
Microprocessor vs Microcontroller
Microprocessor Microcontroller
• Multipurpose • Single Purpose 
• Connects to external circuits such as  • Internal memory
memory, graphics, i/o ports, etc. on mother  • Non‐volatile memory (permanent once 
board written)
• Has O/S (Windows, Linux, etc.) • Built‐in peripherals
• Volatile memory (reboot when power lost) • Come in different sizes
• Requires PS, Keyboard, Mouse, Display, etc. • Usually does not have O/S
Microcontroller Peripherals
Four Main Types – Built‐in
1. TIMERS
• Counters
• Real Time
• Pulse Width Modulation (PWM)
2. ANALOGUE
• A/D Converter
3. Digital
• I/O Ports
• LCD Control
4. Communications
• Serial (RS‐232)
• USB
• Ethernet
• I2C
• Others
What are the choices?
• TinyAVR
• PIC‐EL III
• PICAXE
• Basic Stamp
• Texas Instruments MSP430
• ARDUINO
• ESP8266
• Many more
Tiny AVR Microcontroller
First Project:  Two Switches to toggle two LEDs
PIC‐EL III BOARD 
PICAXE Starter Pack ‐ $60
Basic Stamp ‐ $49

• First released in 1992
• Programmed in PBASIC
• Available add‐on “carrier boards”
• 20 MHz Clock = 4,000 PBASIC Instructions/sec
• EEPROM 2 KB (~500 PBASIC Instructions)
• I/O Pins:  16 + 2 dedicated serial
• Current Draw (5 VDC):  3mA Run, 50 uA Sleep
• Source/Sink Current per I/O:  20 mA/25mA
• PBASIC Commands:  42
• Package:  24‐pin DIP
• Dimensions:  1.2” X 0.63” X 0.15”
• Made by Parallax Inc. (California)
• Get Started Kit:  $79.99
Texas Instruments Launchpad MSP430
Raspberry Pi
Arduino
What are the Main Differences?

MCU Language(s) Advantage Disadvantage


TinyAVR Assembly, C Specific Function Programming
PIC‐EL III Assembly Ham radio apps Programming
TI MSP430 Assembly, C Cheap, Low Power Fewer shields
Basic Stamp PBASIC Programming, Simple Software Flexibility
PICAXE Basic Programming Speed
ARDUINO C (Wires) Libraries, Shields,  Speed, Newer 
Popularity, variety technologies
ESP8266 C Arduino Compatibility Heat dissipation
Ethernet, Speed
Raspberry PI Python + Computer Linux, Other hardware
Arduino Description
• Open‐source electronics prototyping platform – Costs about $35 (authentic)
• Millions sold to date 
• Intended for artists, designers, hobbyists, etc.
• Can be stand‐alone projects or can communicate with computers
• Windows, Mac OS X, Linux
• Programs (sketches) based on simplified “C” language and make peripheral 
access easy to use with vast number of libraries
• Starter kits and programming guides available
• Many “flavours” available:  Uno (R3), Due, Mega, Nano, Mini, Leo, LilyPad
• Many accessories available 
• Note:  Daughter boards called “shields” and are “stackable”
• Hundreds of I/O Shields available (WiFi, LCD Displays, Ethernet, 
Bluetooth, GPS, Motor control, etc.)
• Huge user base and support system 
• A Google search (2013) of “Arduino Projects” returned 2,750,000 results 
and 238,000 results for “Tutorials”
Arduino Specifications
• Microcontroller:  ATmega328
• Operating Voltage:  5V
• Input Voltage:  7‐12V
• Input Voltage (limits):  6‐20V
• Digital I/O Pins:  14 (6 provide 
PWM)
• Analog Input Pins:  6
• DC Current per I/O Pin:  40 mA
• DC Current for 3.3V Pin:  50 mA
• Flash Memory:  32 KB (0.5 KB 
used by bootloader)
• SRAM:  2 KB
• EEPROM:  1 KB
• Clock Speed 16 MHz
• 3” X 2” Dimensions
Arduino – Other Starter Kits

$55 Shipped Free to Canada
Arduino – Sensors Galore!

$55 Shipped Free to Canada
Arduino – The Collection

Board Processor  Memory Digital I/O  Analogue I/O


2KB SRAM, 32KB 
Arduino Uno 16Mhz ATmega328 14 6 input, 0 output
flash
84MHz  96KB SRAM, 512KB 
Arduino Due 54 12 input, 2 output
AT91SAM3X8E flash
8KB SRAM, 256KB 
Arduino Mega 16MHz ATmega2560 54 16 input, 0 output
flash
2KB SRAM, 32KB 
Arduino Lilypad 8MHz ATmega32u4 9 4 input, 0 output
flash
Arduino  2.5KB SRAM, 32KB 
16MHz ATmega32u4 20 12 input, 0 output
Leonardo flash
Arduino – Sample Projects
Hacking hotel room locks The Inebriator

Disco Planet Arc‐O‐Matic Art Bot


Arduino – Online Tutorials

Tutorial 5

Tutorial 8
Arduino – Online Tutorials
Topics
• Getting Started
• Turning LEDs on/off with pushbuttons
• Analogue Inputs
• Motors and Transistors
• Serial Communication and Processing
• I2C and Processing
• SPI Interfaces
• Wireless Communication
• Interrupts and Hardware
• SD Cards and Data Logging
• RFID Cards
• Liquid Crystal Displays (LCD)
• Lasers
• Robotics
Arduino – First Projects
Arduino – Sample Program
//Turning on LED when switch closed
int switch;   // Declares switch an integer variable

void setup()    // Required for each program
{
pinMode(10, OUTPUT);     // Set pin 10 to output for  LED
pinMode(11, INPUT);      // Set pin 11 to input to read switch
digitalWrite(11,HIGH);    // Turn on internal pull up resistor
}

void loop()  // Repeat what is inside loop
{
switch = digitalRead(11);                                   // Store the value of the switch (high or low)
if(switch == 0)
digitalWrite(10,HIGH);  //turn on LED  // If the switch is pressed (Low=0), LED on
else
digitalWrite(10,LOW);  //turn LED off  // Otherwise, turn the switch off
}  //  End of loop() 
Arduino – HF Antenna Switch

Reads band data from rig and automatically selects antenna – KC8GRQ
Arduino Rotator Controller for EME – G4HSK

• Yaesu G‐5500 rotator with elevation and azimuth control
• Interface includes Arduino Uno, switching board, LCD 
interface, 2X20 LCD module, PstRotator Software

Homebrew Switching Board All modules wired together
Arduino – Radio Artisan K3NG
Website dedicated to Ham Radio Arduino projects

Current Projects:
• Arduino controlled beacon
• CW Keyer
• Rotator controller
• Antenna tuner

• Downloadable sketches
• Diagrams and photos
• Discussion forums
• Resource links
Arduino – QRP Transceiver! M0XPD
Arduino – Ham Radio Reference
Arduino – The Future
ESP8266MOD (NodeMCU)

Arduino and WiFi on a chip for about $10 CDN
Faster, Smaller, Cheaper, More storage, More accurate
32‐bit RISC CPU: Tensilica Xtensa LX106 running at 80 MHz*
64 KB of instruction RAM, 96 KB of data RAM
External QSPI flash ‐ 512 KB to 4 MB* (up to 16 MB is supported)
IEEE 802.11 b/g/n Wi‐Fi
Integrated TR switch, balun, LNA, power amplifier and matching network
WEP or WPA/WPA2 authentication, or open networks
16 GPIO pins
SPI, I²C,
I²S interfaces with DMA (sharing pins with GPIO)
UART on dedicated pins, plus a transmit‐only UART can be enabled on GPIO2
1 10‐bit ADC
* Both the CPU and flash clock speeds can be doubled by overclocking on some 
devices. CPU can be run at 160 MHz and flash can be sped up from 40 MHz to 
80 MHz. Success varies chip to chip.
Ham Radio ‐ Projects

Projects:
• APRS Data Logger
• QRSS Beacon
• Multimode Transmitter Shield
• High Voltage, High Frequency, and High Temperature Data Logger
• Receive‐Only, Low‐Power APRS iGate
• PICAXE Keyer and CW Beacon Keyer
• Solar Tracker
• Nanokeyer
• Handheld Radio Talk Timer
• APRS Messenger
• DTMF Controlled SSTV Camera
• APRS Display
• Waterfall
• SWR Scanner
…and more projects using the Arduino, PICAXE, and ATtiny 
microcontrollers
Recommended Reading
Shunt‐fed Tower Project

John True, W4OQ – May 1975 Ham Radio Magazine
Shunt‐fed Tower Project – Tower Unit Schematic
Shunt‐fed Tower Project – Tower Unit Device

Reset
5V – 3V Reg
Stepper Motor 
Controller

nRF24L01 XCVR

328P MCU 16MHz XTAL
Shunt‐fed Tower Project – Shack Unit Schematic
Shunt‐fed Tower Project – Shack Unit Device
Shunt‐fed Tower Project – Final Configuration 
The Rebel by TenTec ‐ Arduino‐based QRP Transceiver
Summary

• Microcontrollers such as the Arduino are leading a revolution in 
new applications, including amateur radio
• Microcontrollers are inexpensive, safe to use (no high voltages), 
and ubiquitous
• Other inexpensive hardware, such as the Raspberry Pi, Beaglebone
Black, etc. provide complementary platforms that can lead to new 
technologies – Examples include prosthetic limbs, robotics, quad 
copters, high altitude balloon measurements, home brew 
satellites, etc.  
• The technology continues to evolve by getting smaller, faster, 
lighter, smarter, and using less energy.  

You might also like