AVR Programming: Digital I/O September 10, 2010. What is Digital I/O? Digital – A 1 or 0 Input – Data (a voltage) that the microcontroller is reading.

Slides:



Advertisements
Similar presentations
1 ECE 372 – Microcontroller Design Parallel IO Ports - Outputs Parallel IO Ports E.g. Port T, Port AD Used to interface with many devices Switches LEDs.
Advertisements

3-1 Peripherals & I/O lines All the on-chip peripherals are configured and controlled through Special Function Registers (SFR) Many of the SFR’s are bit.
Introduction to Micro-controllers Anurag Dwivedi.
Chung-Ta King National Tsing Hua University
Software Design Considerations. Abstract  Design and build a compact robot to traverse a maze  Use the robot to generate an ASCII representation of.
MICRO-CONTROLLER: A microcontroller is the brain of the robot: These are: 1. Integrated Circuits (ICs) 2. Programmable.
Lab 3 General MIDI Explorer with Record/Playback
Programming Microcontrollers B. Furman 19MAR2011.
Programming the ATmega16
Debug Techinques for HW/SW Systems What's broken, the HW or the SW? Some basic thoughts: -assume that its broken -its not working correctly until proven.
Butterfly I/O Ports CS-212 Dick Steflik. I/O for our labs To get data into and out of our Butterfly its a little trickier than using printf and scanf.
AVR Programming CS-212 Dick Steflik. ATmega328P I/O for our labs To get data into and out of our Arduino its a little trickier than using printf and.
Robotics Research Laboratory Louisiana State University.
You must be knowing about Digital Integrated Circuits (ICs) right ? For example 7404: Hex Inverter 7408: Quad 2-input AND gate 7410: Triple 3-input NAND.
Introduction to Microcontrollers Shivendu Bhushan Summer Camp ‘13.
Component research Nick Klein. Ultrasonic Parallax sensor – A single I/O pin is used to trigger an ultrasonic burst (well above human hearing) and then.
Department of Electronic & Electrical Engineering Embedded system Aims: Introduction to: Hardware. Software Ideas for projects ? Robotics/Control/Sensors.
I/O Ports CS-280 Dr. Mark L. Hornick 1. CS-280 Dr. Mark L. Hornick 2 Ports are channels from the CPU to external hardware and software Atmega32 has: 4.
Computer Sensing and Control How is binary related to what we are trying to accomplish in electronics? The PC GadgetMaster II uses binary to communicate.
Lab 1 - Microcontrollers Complete the program template below being sure to select the correct parameters to meet the requirements (see the Microcontroller.
Dr. Rabie A. Ramadan Al-Azhar University Lecture 6
1 ARM University Program Copyright © ARM Ltd 2013 General Purpose I/O.
Teachers Name : Suman Sarker Telecommunication Technology Subject Name : Microcontroller & Embedded System Subject Code : 6871 Semester : 7th Department.
MCU: Interrupts and Timers Ganesh Pitchiah. What’s an MCU ?
Arduino. What is it? A open-source software suite and single-board microcontroller. Allows easy and affordable prototyping of microcontroller applications.
Single Chip Microcontrollers 7765J Mount Druitt College of TAFE Lesson 2.
Basic Architecture Lecture 15. In general, if the number of bits is n, then the number of different combinations of 0s and 1s that can be made is 2 n.
1 ARM University Program Copyright © ARM Ltd 2013 General Purpose I/O.
L ILY P AD T RAINING C ENTENNIAL E LEMENTARY 2012 Material by Linz Craig Revision by Sarah Bloms Additional images by Modkit & Adam Meyer.
ECS642U Embedded Systems Digital I/O William Marsh.
AVR Programming: Interrupts September 17, What are interrupts? An asynchronous signal indicating the need for an event to be handled A synchronous.
ECS642U Embedded Systems Cyclic Execution and Polling William Marsh.
AVR Programming: Timers October 8, What is a timer? A register that keeps track of a current value This value is updated at a certain frequency.
Timers and Interrupts Anurag Dwivedi. Let Us Revise.
Programmable Peripheral Interface Parallel port Interface 8255
Robotics Research Laboratory Louisiana State University.
ECE Lecture 1 1 L15 –I/O Part II Department of Electrical and Computer Engineering The Ohio State University ECE 2560.
1-3 GPIO_Output(LuminaryLibrary) 1.Alter the output current to 4mA 2.Let LED0 turn on but LED 1 turn off. Modify your program in E:\yourname\arm.
Arduino Mega Arduino Mega 2560 Arduino Mega 2560.
Embedded Systems Lecture 4 January 20, 2016.
AVR Architecture Prepared By: Avdhesh Soni ( ) Sarthak Patel ( ) Akshay Parekh ( ) Fenil Sachla ( ) Guided.
Introduction to AVR Name : 1) Abhishek Yadav ) Prakash Giri ) Kheni Niral ) Bhadresh Langadiya Branch.
Programming PIC 16F84A in Assembly. PIC16F84 pin-out and required external components.
DEPARTMENT OF ELECTRONICS ENGINEERING V-SEMESTER MICROPROCESSOR & MICROCONTROLLER 1 CHAPTER NO microcontroller & programming.
Application Case Study Christmas Lights Controller
Embedded Systems Programming (What they do and when / how to use them)
AVR I/O Port Programming
Microprocessor Communication and Bus Timing
Input/Output Ports and Interfacing
TI ARM I/O Programming Chapter 2
connect a DC-Motor with an arduino
AVR ATMEGA 8 MICRO-CONTROLLER
For further information
GANDHINAGAR INSTITUTE OF TECHNOLOGY
Lesson Outline Peripherals Memory-Mapped IO Ports GPIO Multiplexing
COMP2121: Microprocessors and Interfacing
ADC Interfacing Source: In under
STM Arm I/O Programming
Memory organization On- chip memory Off-chip memory
I/O Ports in AVR Sepehr Naimi
Button/Switch.
I/O Ports in AVR Sepehr Naimi
Decoding and Using a 4x4 Keyboard
8051 Micro Controller.
CHAPTER 4 I/O PORT PROGRAMMING.
TI LaunchPad I/O Programming with Energia
Let’s use a PUSH-Button!
Decoding and Using a 4x4 Keyboard
Interrupts.
Presentation transcript:

AVR Programming: Digital I/O September 10, 2010

What is Digital I/O? Digital – A 1 or 0 Input – Data (a voltage) that the microcontroller is reading from an external source Output – Data (a voltage) that the microcontroller is setting to be used by an external source 2

Where does this happen? I/O Ports 6 8-bit I/O ports (A-F) 1 4-bit I/O port (G) Most have an alternate purpose 3

How do I access these pieces of metal in software? They are memory mapped Certain memory addresses are reserved for I/O Registers A few examples (Ports A-D): 4

55 Do I need to memorize those addresses? No! #include Each register and bit within it is defined for you

6 How does this look in code? //set the bottom three bits of Port A to output DDRA |= _BV(DDA0) | _BV(DDA1) | _BV(DDA2); //output high on pins 0 and 2 of port A PORTA |= _BV(PA0) | _BV(PA2); //output low on pin 1 of port A PORTA &= ~(_BV(PA1)); //set Port B to input DDRB = 0x00; //read Port B char x = PINB;

7 What can we do with this on the robots? Note: Pin 33 and 34 are PG0 and PG1

8 Stuff to try out Reading from the push buttons – make sure to enable internal pull up (PORTG |= 3;) Turning on the orbs Rapidly turning the orbs on and off – Maybe even in patterns (off off on off off on…) Rapidly switching orb colors – e.g. (blue green off blue green off…) Combinations of above You should not need the dragonfly library

9 Help/More Info Datasheet: