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.

Slides:



Advertisements
Similar presentations
Week10 Boolean Instructions on the Boolean Instructions  Boolean (or Bit) addressable capability is unique to the 8051  Enables efficient handling.
Advertisements

8255 – PROGRAMMABLE PARALLEL
TK2633 Introduction to Parallel Data Interfacing DR MASRI AYOB.
2-1 Infineon M bit Microcontroller One of a family of microcontrollers (M16x) Derived from M166 Same 16-bit CPU core in all family members  Provides.
I/O Unit.
Programming Microcontrollers B. Furman 19MAR2011.
 | bit OR & bit AND ~ bit NOT ^ bit EXLUSIVE OR (XOR) > bit RIGHT SHIFT.
1-1 Microprocessor Engineering Microprocessor Systems Microcontrollers Infineon 16-bit Processor Family  specifically 167CS microcontroller C Programming.
Programming the ATmega16
Railway Foundation Electronic, Electrical and Processor Engineering.
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.
7-1 Digital Serial Input/Output Two basic approaches  Synchronous shared common clock signal all devices synchronised with the shared clock signal data.
16.317: Microprocessor System Design I Instructor: Dr. Michael Geiger Spring 2012 Lecture 30: PIC data memory.
Railway Foundation Electronic, Electrical and Processor Engineering.
ASPPRATECH.
 C is general-purpose structured programming language or high level language.  It was developed by Dennis Ritchie in 1970s at Bell laboratories. 
PIC microcontrollers. PIC microcontrollers come in a wide range of packages from small chips with only 8 pins and 512 words of memory all the way up to.
Khaled A. Al-Utaibi  Intel Peripheral Controller Chips  Basic Description of the 8255  Pin Configuration of the 8255  Block Diagram.
3-1 Digital I/O A group of I/O pins is called a PORT  A port is where data enters/leaves the system. Digital I/O pins are usually grouped into 8,16 or.
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.
Directives, Memory, and Stack. Directives Special commands to the assembler May or may not generate machine code Categories by their function Programming.
Lecture 2 Silicon Labs C8051F020 System Overview.
Shift Registers pp Shift Registers Capability to shift bits ♦ In one or both directions Why? ♦ Part of standard CPU instruction set ♦ Cheap.
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.
AVR Programming: Digital I/O September 10, What is Digital I/O? Digital – A 1 or 0 Input – Data (a voltage) that the microcontroller is reading.
Microcontrollers Class : 4th Semister E&C and EEE Subject Code: 06ES42
Programmable Peripheral Interface Parallel port Interface 8255
INTRODUCTION TO PIC MICROCONTROLLER. Overview and Features The term PIC stands for Peripheral Interface Controller. Microchip Technology, USA. Basically.
MICROOCESSORS AND MICROCONTROLLER:
EKT 221 : Chapter 4 Computer Design Basics
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.
EE365 - Microprocessors period 26 10/23/00 D. R. Schertz # Parallel Ports.
UNIT 7 - INTRODUCTION TO I/O INTERFACING. TWO MAJOR TYPES OF I/O INTERFACING ISOLATED I/O - DEDICATED I/O INSTRUCTIONS ARE USED TO ACCESS I/O DEVICES.
ECE 371 Microprocessor Interfacing
CS 3843 Computer Organization Prof. Qi Tian Fall 2013
Chapter Microcontroller
8255:Programmable Peripheral Interface
Bit Manipulation in 'C' 'C' bit operators
Microprocessor & Assembly Language
Embedded Systems Lecture 4 January 20, 2016.
ARM Embedded Programming Lecture 4 Accessing Memory Mapped Registers.
CHAPTER 14 Digital Systems. Figure 14.1 RS flip-flop symbol and truth table Figure
80C51 Block Diagram 1. 80C51 Memory Memory The data width is 8 bits Registers are 8 bits Addresses are 8 bits – i.e. addresses for only 256.
DEPARTMENT OF ELECTRONICS ENGINEERING V-SEMESTER MICROPROCESSOR & MICROCONTROLLER 1 CHAPTER NO microcontroller & programming.
MICROCONTROLLER & ITS INTERFACING. Topics of Discussion:  Microprocessor  Definition  Working  Microprocessor & Human Behaviour  Microcontroller.
8255 Programmable Peripheral Interface
Implementing Combinational
80C51 Block Diagram ECE Overview.
Input/Output Ports and Interfacing
TI ARM I/O Programming Chapter 2
Topics SRAM-based FPGA fabrics: Xilinx. Altera..
GPIO General Purpose Input/output Tiva C TM4C123GH6PM
ADC Interfacing Source: In under
8259-programmable interrupt controller
Memory Units Memories store data in units from one to eight bits. The most common unit is the byte, which by definition is 8 bits. Computer memories are.
The Arduino Microcontroller: Atmel AVR Atmega 328
Interfacing Memory Interfacing.
8255.
Memory organization On- chip memory Off-chip memory
Schematics 201 Lecture Topic: Electrical Symbols
Parallel communication interface 8255
Embedded C for 8051: Primer for CompEng 3150
Keyboard/Display Controller (8279)
Programmable Peripheral Interface
Important 8051 Features On chip oscillator 4K bytes ROM 128 bytes RAM
8051 Micro Controller.
XOR Function Logic Symbol  Description  Truth Table 
CHAPTER 4 I/O PORT PROGRAMMING.
Bit Manipulations CS212.
Presentation transcript:

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 addressable The 111 I/O lines are arranged into Ports Some port lines have multiple functions which must be configured for correct operation of the required function.

3-2 Infineon 167 I/O Ports 111 I/O lines with individual bit addressability Tri-stated in input mode Selectable input thresholds (not on all pins) Push/pull or open drain output mode Programmable port driver control

3-3 M167CS Functional Block Diagram

3-4 Digital I/O Ports Port is where data enters/leaves the system Digital I/O lines are normally grouped into 8-bit ports or possibly 16-bit ports Ports must be configured for input or output before they are used Most ports allow a mixture of inputs and outputs on the same port Some microcontrollers have instructions that access individual bits of a port

3-5 M167 digital I/O ports Associated with a port is a DIRECTION register and on some a Port output control Port direction - '0' = input, '1' = output Output control – '0' = Push/pull, '1' = open-drain In Keil 'C' all the SFR's are defined in the header file "c167cs.h" with the Infineon standard names  Px – is Port x  DPx – is the Direction for Port x  ODPx = Open Drain Control for Port x

3-6 Typical Port Structure

3-7 Output Driver Types Push/Pull Output DriverOpen-Drain Output Driver

3-8 Parallel Ports in u-Vision 2

3-9 Using all bits of ports Outputs  DP4 = 0xff; // Direction all outputs  P4 = value8; // output value to all 8-bits  DP2 = 0xffff;  P2 = value16; Inputs  DP6 = 0x00; //Direction all inputs  x = P6; // Read all 8-bits into variable x  x would normally be an unsigned char but could be unsigned int

3-10 Bit Manipulation in 'C' 'C' bit operators (binary operators) OP symbol Description &AND |OR ^XOR >> n shift bits right n places << n shift bits left n places y = y OP z; can be written as y OP= z; E.g.'s y = y & 0x80;y = y >> 4; y &= 0x80;y >>= 4; unary operator ~complements (invert all bits) e.g. y = ~y;

3-11 Masking to achieve bit manipulations Masking uses AND and OR operators Use OR ('|') to set bits to '1' Use AND ('&') to set bits to 0 OR ABOutput AND ABOutput XOR ABOutput

3-12 Controlling output bits – Output Masking Setting bits to 1 using OR (|) General format: Port = Port | mask; Mask has '1' to set a bit, '0' to leave bit unchanged. Example: Set bit 3 to '1' P4 = P4 | 0x08; // 0x08 = binary Setting bits to 0 using AND (&) General format: Port = Port & mask; Mask has '0' to clear a bit, and '1' to leave bit unchanged. Example: Set bit 3 to '0' P4 = P4 & 0xf7; // 0xf7 = binary

3-13 Input Masking Use AND (&) and a mask to isolate a selected bit Used in input Polling to test an individual input bit Loop until a bit becomes logic '1' while( (P4 & 0x08) == 0) { ; }  Two possible results or  I.e. zero or non-zero Loop until a bit becomes logic '0' while( (P4 & 0x08) != 0) { ; } Often written as while( P4 & 0x80); // in 'C' zero is FALSE, non-zero is TRUE

3-14 bit variables The Keil C compiler supports the bit addressable features of Infineon microcontrollers General declaration format sbit bitname = Portx^y; // port x bit y E.g.sbit motor_dir = DP2^10; sbit motor = P2^10; MUST declare sbit's before 'C' main() function Using sbit's motor_dir = 1; // Set bit to output motor = 1; //turn on motor