Microcontrollers JULES CALELLA. Microcontrollers vs Microprocessors  Microprocessors – do not contain RAM, ROM, I/O  Microcontrollers – The whole package.

Slides:



Advertisements
Similar presentations
C Examples 1.
Advertisements

What is Arduino?  Arduino is a ATMEL 168 micro-controller kit designed specially for small projects  User friendly IDE(Integrated Development Environment)
How to use Arduino By: Andrew Hoffmaster.
Slides created by: Professor Ian G. Harris PIC Development Environment MPLAB IDE integrates all of the tools that we will use 1.Project Manager -Groups.
By Solid State Workshop. ● A microcontroller is an integrated circuit that is programmed to do a specific task. ● Microcontrollers are really just “mini-computers”.
Systems Programming Course Gustavo Rodriguez-Rivera.
7-1 Digital Serial Input/Output Two basic approaches  Synchronous shared common clock signal all devices synchronised with the shared clock signal data.
Using PDG with e2studio: Example
Railway Foundation Electronic, Electrical and Processor Engineering.
ASPPRATECH.
SKP8CMINI-15,17 Tutorial 1 Software Development Process using HEW4
Engineering 1040: Mechanisms & Electric Circuits Fall 2011 Introduction to Embedded Systems.
Renesas Technology America Inc. 1 SKP8CMINI Tutorial 1 Introduction.
Programming 8-bit PIC Microcontrollers in C Martin Bates Elsevier 2008.
SPI By Alexander Maroudis. Outline What is SPI? SPI Configuration SPI Operation Master Slave Setup SPI Transactions SPI Digital Potentiometer Example.
Microcontrollers, Basics Fundamentals of Designing with Microcontrollers 16 January 2012 Jonathan A. Titus.
Colorado Space Grant Consortium Gateway To Space ASEN 1400 / ASTR 2500 Class #12 Gateway To Space ASEN 1400 / ASTR 2500 Class #12 T-58.
1 © Unitec New Zealand Embedded Hardware ETEC 6416 Date: - 10 Aug,2011.
Chapter 1 The First Flight Creating the first project and saying “Hello to the World”
Silicon Labs ToolStick Development Platform
Department of Electronic & Electrical Engineering Embedded system Aims: Introduction to: Hardware. Software Ideas for projects ? Robotics/Control/Sensors.
Revised: Aug 1, ECE 263 Embedded System Design Lesson 1 68HC12 Overview.
16F877A. Timer 0 The Timer0 module timer/counter has the following features: –8-bit timer/counter –Readable and writable –8-bit software programmable.
Embedded System Design Laboratory October 11, 2002Stanford University - EE281 Lecture #4#1 Lecture #4 Outline Announcements Project Proposal AVR Processor.
Digital to Analogue Converter
Arduino. What is it? A open-source software suite and single-board microcontroller. Allows easy and affordable prototyping of microcontroller applications.
Microprocessors A practical approach Subjects Goals for this module Results Subjects of the module Plans Questions.
Prepared by Eng. Musa Alyaman1 Chapter Seven Chapter Seven PIC16F87x.
1 LHO 13 The 8051CF020 and the University Daughter Card.
Designing with Components Wilmer Arellano. How to chose a Microcontroller Choose one that you are familiar with or that is easy to learn.
MICROCONTROLLER SYSTEMS Part 1. Figure 1.1Elements of a digital controller CPU Central Processing Unit Input Peripherals Output Peripherals ROM Read Only.
Atmel Atmega128 Overview ALU Particulars RISC Architecture 133, Mostly single cycle instructions 2 Address instructions (opcode, Rs, Rd, offset) 32x8 Register.
Chapter 2 Introducing the PIC Mid-Range Family and the 16F84A The aims of this chapter are to introduce: The PIC mid-range family, in overview The overall.
ATtiny23131 A SEMINAR ON AVR MICROCONTROLLER ATtiny2313.
WISP.
Saxion University of Applied Sciences Advanced Microcontrollers A practical approach.
By James Cockrell and Justin Loveless
DsPIC30F4011 Fall DIP Switches  The upper four switches of SW1 are used to enable LEDs connected to PORTB/C, PORTA/D, PORTE and PORTF. For example,
Chapter 5 - Interrupts.
Lecture 7: Overview Microprocessors / microcontrollers.
C Examples 1. Download Links dsPIC30F4011/4012 Data Sheet dsPIC30F4013/3014 dsPIC30F Family Reference Manual MikroC MikroC Manual MikroC Quick Reference.
Features of the PIC18 microcontroller - 8-bit CPU - 2 MB program memory space (internal 32KB to 128KB) bytes to 1KB of data EEPROM - Up to 4096 bytes.
INTERNET OF EVERYTHING SDU 2016 Week 4. Simple Digital and Analog Inputs  The Arduino’s ability to sense digital and analog inputs allows it to respond.
Components of a typical full-featured microcontroller.
Microcontroller basics Embedded systems for mortals.
A Quick Start Guide to PIC16F877 microcontroller And Microchip Development Environment A Quick Start Guide to PIC16F877 microcontroller And Microchip Development.
CEng3361/18 CENG 336 INT. TO EMBEDDED SYSTEMS DEVELOPMENT Spring 2007 Recitation 01.
Criteria for choosing a microcontroller A microcontroller must meet the task at hand efficiency and cost effectively. Speed. What is highest speed of.
DEPARTMENT OF ELECTRONICS ENGINEERING V-SEMESTER MICROPROCESSOR & MICROCONTROLLER 1 CHAPTER NO microcontroller & programming.
CEng3361 CENG 336 INT. TO EMBEDDED SYSTEMS DEVELOPMENT Spring 2011 Recitation 06.
 Mini-Computer ◦ Microprocessor  The Brains  Arithmetic Logic Unit (ALU)  Control Unit  Program/ Data Storage  Peripherals (Input/Output)  Low-Cost.
USING TV REMOTE AS A CORDLESS MOUSE FOR THE COMPUTER
Arduino.
Popular Microcontrollers and their Selection by Lachit Dutta
Fundamentals of Computer Engineering
Microcontrollers, Basics Fundamentals of Designing with Microcontrollers 16 January 2012 Jonathan A. Titus.
Microcontrollers & GPIO
Microcontroller basics
Microcontroller Applications
Subject Name: Microcontroller Subject Code: 10ES42
Introduction to Microprocessors and Microcontrollers
Lecture 3 - Instruction Set - Al
EECE.3170 Microprocessor Systems Design I
AVR – ATmega103(ATMEL) Architecture & Summary
8051 Micro Controller.
EECE.3170 Microprocessor Systems Design I
Wireless Embedded Systems
Introduction to Arduinos
Introduction to arduino
ECE 3567 Microcontrollers Lab
Presentation transcript:

Microcontrollers JULES CALELLA

Microcontrollers vs Microprocessors  Microprocessors – do not contain RAM, ROM, I/O  Microcontrollers – The whole package (mini computer)

Where are Microcontrollers Used?  Mouse, toys, phones, game controllers, etc.  Anything that requires complex instructions but doesn’t need a full OS

How Do You Control a Microcontroller?  Programming in C or Assembly  C – slower, good starting point for beginners, easy to debug  Timing doesn’t work as expected

Microchip’s Models  8-bit Start here  16-bit (includes dsPIC)  32-bit

Using the Data Sheet  Contains everything about the device  Summary of modules  Pinout  Dimensions  Registers

Errata Sheet  Revisions and mistakes

Configuration Bits  Oscillator  Watchdog timer  Brown-out reset  Every model offers different options

Oscillator  Controls the timing  Internal or external  4MHz, 8MHz (PLL)

 OSCCON = 0xD2 ( )  OSCCONbits.IRCF = 0x5

GPIO  TRIS – output (0) or input (1)  LAT – Turn ON (1) or OFF (0)  PORT – Read ON (1) or OFF (0)

Example: TRISA = 0x00; //All are outputs LATAbits.LATA5 = 1; //Turn LED on char pinState = PORTAbits.RA5; //Determine if LED is on

ADC  Analog-to-digital converter  10 – 14 bit resolution  Reference voltage (increase sensitivity)  Only some ports have functionality (ANSx)  Temperature sensors, light sensors, potentiometers, pressure sensors

 ANSx = 1  TRISx = 1//Disables digital output driver  Left justifiedx x x x x x x x x x _ _ _ _ _ _  Right justified_ _ _ _ _ _ x x x x x x x x x x  Time Acquisition

Interrupts  Practically every module has one  Interrupt Flags  Priority

Timers  Hardware based counters with interrupts  8, 16, 32 bit timers  Divisible  Used as timer or counter

void interrupt Timer0_ISR(void) { if (T0IE && T0IF) { T0IF = 0; //Perform some task (e.g. blink LED) //LATA = !LATA; TMR0 = 4; //Depends on how long task takes }

Communication  UART – slow, 2-wire, asynchronous  I2C – faster, 2-wire, synchronous  SPI – fastest, 3-4 wires, synchronous  Controllable Baud Rate  USB – able to communicate with USB hosts

Wires for Communication  UART – RX & TX  I2C – Data & Clock  SPI – SS, SCLK, SDO, SDI

USB  4 wires (PWR, D+, D-, GND)  Host mode and Device mode  Internal USB PLL offers higher clock rate  Look up and download “Microchip MLA”

Peripheral Pin Select  Modules multiplexed amongst pins  Allows the user to move the modules to desired pin  Requires an unlock sequence

#include //PRAGMAS //Defines and Global Initializations //Timer Function int main(){ OSCCON = 0x00;//Set up or functions for setup TRISA = 0xF0;//Half input, half output //Don’t forget de-bounce when using buttons while(1) { //Program here } return 0; //You should not reach this point }

Debugging  For WHEN your program doesn’t run as expected  Break points  Stopwatch  Watch (variables)  In-circuit debugging

How To Get Started  Programmer/debugger (Pickit 3)  Starter board (8-bit recommended)  Additional microcontrollers  IDE (MPLAB X)  Compiler (XC or mikroC)  Breadboard, LEDs, etc.  A book with code examples (optional, but not really…)

Final Tips  Learn how to display data (LEDs/LCD/computer)  Use binary operations  Make sure IC’s are shipping from the U.S.  Ensure Oscillator works correctly  Make small programs to test functions  Review Microchip’s tutorial documents  Join forums to ask people for help  

Thank You  Questions?