I/O PORTS (Simplest Peripherals) PORT A: 6 bits wide (7th and 8th bit always read as 0) PORT B: 8 bits wide PORT C: 8 bits wide PORT D: 8 bits wide.

Slides:



Advertisements
Similar presentations
م/محمد علي عطية حسين. Pin Diagram DescriptionPin Name Oscillator crystal input/external clock source input. OSC1/CLKIN Oscillator crystal output.OSC2/CLKOUT.
Advertisements

PROGRAMMABLE PERIPHERAL INTERFACE -8255
EXTERNAL COMMUNICATIONS DESIGNING AN EXTERNAL 3 BYTE INTERFACE Mark Neil - Microprocessor Course 1 External Memory & I/O.
Input/Output (I/O) Ports and Interfacing
Input/Output Ports and Interfacing ELEC 330 Digital Systems Engineering Dr. Ron Hayne Images Courtesy of Ramesh Gaonkar and Delmar Learning.
Embedded System Spring, 2011 Lecture 9: I/O Programming Eng. Wazen M. Shbair.
Microprocessor and Microcontroller Based Systems Instructor: Eng.Moayed N. EL Mobaied The Islamic University of Gaza Faculty of Engineering Electrical.
Data acquisition and manipulation
Prof. Jorge A. Ramón Introducción a Microcontroladores.
Eng. Husam Alzaq The Islamic Uni. Of Gaza
An Introduction to PIC Microcontrollers Supervised by : Dr. Lo’ai Tawalbeh Jordan University of Science & Technology Faculty of Computer & Information.
ECE200 – Computer Organization Chapter 8 – Interfacing Processors and Peripherals.
Microprocessor Systems Design I Instructor: Dr. Michael Geiger Fall 2013 Lecture 26: PIC microcontroller intro.
16.317: Microprocessor System Design I Instructor: Dr. Michael Geiger Spring 2012 Lecture 30: PIC data memory.
Microcontroller Architecture— PIC18F Family
Microprocessor and Microcontroller Based Systems Instructor: Eng.Moayed N. EL Mobaied The Islamic University of Gaza Faculty of Engineering Electrical.
Microcontroller Architecture PIC18F Family
Smart-grid Interface with Photovoltaic Installation – Phase 2 PP-01 Team members: Matt Koresh Ivan Mills Matt Martin Advisor: Dr. Aliprantis.
Department of Electronic & Electrical Engineering Embedded system Aims: Introduction to: Hardware. Software Ideas for projects ? Robotics/Control/Sensors.
Embedded Systems Design 1 Lecture Set 6 I/O Ports.
Building Assembler Programs Chapter Five Dr. Gheith Abandah1.
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.
Parallel Ports, Power Supply and the Clock Oscillator Material to be covered  Parallel I/O ports  Interfacing external switches and LEDs  Clock Oscillator.
Input/Output Ports and Interfacing
16F877A. Timer 0 The Timer0 module timer/counter has the following features: –8-bit timer/counter –Readable and writable –8-bit software programmable.
1 ARM University Program Copyright © ARM Ltd 2013 General Purpose I/O.
Digital to Analogue Converter
One of the most important feature of the microcontroller is a number of input/output pins used for connection with peripherals. In the case of PIC 167CX,
Directives, Memory, and Stack. Directives Special commands to the assembler May or may not generate machine code Categories by their function Programming.
Chapter 7 Larger Systems and the PIC 16F873A The aims of this chapter are to introduce: The architecture of the 16F873A microcontroller; The 16F873A memory.
IO Subsystem IV Ports and peripherals. IO Subsystem (1) All devices connected to the system buses, other than memory and CPU – Input and output ports.
Architecture and instruction set. Microcontroller Core Features:  Operating speed: DC - 20 MHz clock input DC ns instruction cycle Up to 8K x.
INTRODUCTION TO PIC MICROCONTROLLER. Overview and Features The term PIC stands for Peripheral Interface Controller. Microchip Technology, USA. Basically.
Microcontroller Intel 8051 [I/O Ports]. Pin out of the 8051 –40 pin package –32 pins are used for the 4 ports. –V CC / V SS –ALE Address Latch Enable.
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,
CIT 673 Created by Suriyong1 Micro controller hardware architechture.
EE365 - Microprocessors period 26 10/23/00 D. R. Schertz # Parallel Ports.
Department of Electronic & Electrical Engineering Template program. Input / Output (IO) ● Template program. ● Introduction to IO ● Setting up for IO ●
Chapter 11 Data Acquisition and Manipulation The aims of this chapter are to introduce: the main features of a data acquisition system; the characteristics.
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.
Department of Electronic & Electrical Engineering Lecture 2 ● Introduction to IO ● Using a subroutine ● Driving a 7seg display.
Working with Time: Interrupts, Counters and Timers
The 8085 Microprocessor Architecture. What 8085 meant for? 80 - year of invention bit processor 5 - uses +5V for power.
PIC16F887.
Microcontrollers session. What is Microcontroller? Microcontroller is composed of microprocessor,ram, flash memory,EEPROM and some modules like timers,
Chapter Microcontroller
Mark Neil - Microprocessor Course 1 Decoding and Using a 4x4 Keyboard.
Department of Electronic & Electrical Engineering Lecture 3. ● Template program. ● Introduction to IO ● PORTA PORTB TRISA TRISB ● Using a subroutine ●
ECE 101 Exploring Electrical Engineering Chapter 7 Data Acquisition Herbert G. Mayer, PSU Status 11/30/2015 Derived with permission from PSU Prof. Phillip.
Programming PIC 16F84A in Assembly. PIC16F84 pin-out and required external components.
I/O PORTS. General purpose I/O pins can be considered the simplest of peripherals. They allow the PICmicro™ to monitor and control other devices. To add.
Criteria for choosing a microcontroller A microcontroller must meet the task at hand efficiency and cost effectively. Speed. What is highest speed of.
Special Features. Device Configuration bits Revision Device Configuration bits Revision On-chip Power-on Reset (POR) Revision On-chip Power-on Reset (POR)
TIMERS.
16F877A.
Microprocessor Systems Design I
Input/Output Ports and Interfacing
Microprocessor Systems Design I
INT. TO EMBEDDED SYSTEMS DEVELOPMENT
COMP2121: Microprocessors and Interfacing
The 8255 Programmable Peripheral Interface
Microprocessors Timers
PIC18 CH. 4.
مقدمه با توجه به اهميت و گسترش روزافزون كاربردهاي ميكروكنترلرها و محدوديت هايي كه ميكروكنترلرهاي خانواده ي MCS51 ايجاد مي كرد،شركت Microchipنسل جديدي.
The PIC uCs PIC Microcontroller and Embedded Systems Muhammad Ali Mazidi, Rolin McKinlay and Danny Causey Eng. Husam Alzaq The Islamic Uni. Of Gaza 11-1.
ADC and DAC Data Converter
INSTRUCTION SET.
EECE.3170 Microprocessor Systems Design I
ADC and DAC Data Converter
Presentation transcript:

I/O PORTS (Simplest Peripherals) PORT A: 6 bits wide (7th and 8th bit always read as 0) PORT B: 8 bits wide PORT C: 8 bits wide PORT D: 8 bits wide PORT E: 3 bits wide Each port transfers data to/from the CPU (standard I/O function) Additionally, each one can also transfer data to/from one or more of the other peripheral devices (Peripheral I/O function) Need to use various registers to specify which function (standard I/O or peripheral I/O) each port bit is going to do.

Simplest of the peripherals Pins are multiplexed with alternate functions TRIS Register –D–Data direction register TRIS<x> controls the direction of port<x> –1–1 configures as input and 0 as output I/O PORTS

GENERAL STRUCTURE OF AN I/O PORT TO PERFORM STANDARD I/O FUNCTION

SET OF DATA AND TRIS LATCHES AT EACH PORT

org 0x00 Main: bsf STATUS, RP0; Select bank 1 movlw 0x00; WREG = 0x00 movwf TRISB; TRISA = WREG, Port A is output movlw 0xFF; WREG = 0xFF movwf TRISD; TRISA = WREG, Port D is input bcf STATUS, RP0; Select bank 0 main_loop: movf PORTD, W; WREG = PORTD, read Port D to WREG movwf PORTB; PORTA = WREG, Output WREG to Port A goto main_loop; Goto main_loop end; Physical end of program I/O Ports initialization

PORTS D and E

PORT D PORT E ADCON1 To use as I/O or PSP, set pins as digital inputs. To use as analog inputs, set pins as analog inputs 8 bits wide I/O directions set by TRISD <0:7> 3 bits wide I/O directions set by TRISE <0:2> In PSP and Analog mode, direction should always be input.

PORTS D,E in I/O mode

PORTS D,E in PSP MODE

PORT B 1) 8 bit port. 2) PIN 0 is multiplexed with external interrupt pin (if GIE is enabled, then external interrupt will be accepted). 3) Pins 3,6,7 are multiplexed with pins needed for LOW voltage programming of the in-circuit debugger. By default, Low Voltage Mode is enabled. Need to disable it to be able to use RB3,6,7 as I/O pins

To peripheral module In Low Voltage Programming mode (LVP) mode, pins 3,6,7 are not regular I/Os but goes as inputs to in circuit debugger PORT B STRUCTURE

All pins of port B have a weak Pull up. If pin is in input mode and is floating, it can pick up stray signals and damage ICs. Hence drive it to a weak high value by connecting it through a weak pullup transistor. This weak value can be overwritten by external input when data arrives. Pull up Enabled by bit 1 (RBPU) of OPTION_REG. Automatically disabled if TRISB = 0 (output mode).

PORT C

PORT A 1)6 bit port (A0 – A5) ; 2)Multiplexed with A/D converter, Timer 0 and SSP (synchronous slave port) modules 3)If want to use digital I/O, we need to set the pins as digital by modifying the value of ADCON1 (one of the values : ADCON1 = 0x06 will make all pins digital.

PORT A INITIALIZATION ;; select BANK 0 BCFSTATUS, RP0 BCFSTATUS, RP1 CLRFPORTA; ;; Select bank 1 BSFSTATUS, RP0 MOVLW0x06 MOVWFADCON1; configure all pins as digital I/O MOVLW0xCF; CF = 2F 00[ ] MOVWFTRISA; Configure pins 0-4 as output and pin5 as input. ; pins 6, 7 are always read as 0