 The LPC2xxx devices currently have two on- chip UARTS.  Except UART1 has additional modem support.

Slides:



Advertisements
Similar presentations
INPUT-OUTPUT ORGANIZATION
Advertisements

ECT 357 Ch 18 UART. Today’s Quote: Be careful that your marriage doesn’t become a duel instead of a duet. Be careful that your marriage doesn’t become.
The 8051 Microcontroller Chapter 5 SERIAL PORT OPERATION.
Programmable Keyboard/ Display Interface: 8279
Chapter 11 Multiple interrupts CEG Microcomputer Systems CEG2400 Ch11 Multiple Interrupts V4c
Serial Peripheral Interface (SPI)
7-1 Digital Serial Input/Output Two basic approaches  Synchronous shared common clock signal all devices synchronised with the shared clock signal data.
Unit-5 CO-MPI autonomous
ECE 353 Introduction to Microprocessor Systems Michael G. Morrow, P.E. Week 13.
INPUT-OUTPUT ORGANIZATION
Serial Peripheral Interface (SPI) Bus. SPI Bus There is no official specification for the SPI bus. It is necessary to consult the data sheets of the devices.
Serial Peripheral Interface Module MTT M SERIAL PERIPHERAL INTERFACE (SPI)
SC200x Peripherals Broadband Entertainment Division DTV Source Applications July 2001.
Lecture 9. - Synchronous Devices require a timing signal. Clock generated Interval Timer Microprocessor Interval Timer Clk PCLK = MHz PCLK (for.
Lecture 20: Communications Lecturers: Professor John Devlin Mr Robert Ross.
ECE 353 Introduction to Microprocessor Systems Michael Schulte Week 13.
Industrial Reference Design Platform RS-232 Interface Developed by the TSC Americas Release 1.0.
Advanced Microprocessor1 I/O Interface Programmable Interval Timer: 8254 Three independent 16-bit programmable counters (timers). Each capable in counting.
Example. SBUF Register SCON Register(1) SCON Register(2)
 8251A is a USART (Universal Synchronous Asynchronous Receiver Transmitter) for serial data communication.  Programmable peripheral designed for synchronous.
NS Training Hardware. Serial Controller - UART.
8279 KEYBOARD AND DISPLAY INTERFACING
Universal Asynchronous Receiver/Transmitter (UART)
Embedded Network Interface (ENI). What is ENI? Embedded Network Interface Originally called DPO (Digital Product Option) card Printer without network.
8279 KEYBOARD AND DISPLAY INTERFACING
CIT 673 Created by Suriyong1 Micro controller hardware architechture.
INTERRUPTS. Topics to be discussed  8088/86 Hardware Interrupts pins 8088/86 Hardware Interrupts pins   Pin description Pin description.
INDEX Introduction System Control Block Vectored Interrupt Controller (VIC) GPIO UART Timers.
TM Freescale Confidential Proprietary Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names.
1. PIC ADC  PIC18F877 has 8 analog input channels i.e. port A pins(RA0 to RA5) and port E pins(RE1 and RE2). These pins are used as Analog input pins.
The 8085A is a general-purpose microprocessor with low hardware overhead requirements. Within the 8085A are contained the functions of clock generation,
Lab 9 Multiprocessor, Buses, SPI, I2C. Multiprocessors Why multiprocessors? The structure of multiprocessors. Elements of multiprocessors: – Processing.
The HCS12 SCI Subsystem A HCS12 device may have one or two serial communication interface. These two SCI interfaces are referred to as SCI0 and SCI1. The.
Serial Communication Originally created by Anurag Dwidedi and Rudra Pratap Suman.
Architectures of Digital Information Systems Part 1: Interrupts and DMA dr.ir. A.C. Verschueren Eindhoven University of Technology Section of Digital.
Serial mode of data transfer
Everybody.
Microcontrollers & GPIO
Microprocessor Systems Design I
EE 107 Fall 2017 Lecture 5 Serial Buses – UART & SPI
Introduction An interrupt is an event which informs the CPU that its service (action) is needed. Sources of interrupts: Internal fault (e.g.. divide by.
Inter-IC Bus (I C) 2.
Chapter 11: Inter-Integrated Circuit (I2C) Interface
UNIT – Microcontroller.
SERIAL PORT PROGRAMMING
1 Input-Output Organization Computer Organization Computer Architectures Lab Peripheral Devices Input-Output Interface Asynchronous Data Transfer Modes.
Two Wire Interface (TWI)
8259-programmable interrupt controller
EE 107 Fall 2017 Lecture 7 Serial Buses – I2C Direct Memory Access
DMA CONTROLLER 8257 Features: It is a 4-channel DMA.
Keyboard/Display Controller INTEL 8279
I2C PROTOCOL SPECIFICATION
8259 Chip The Intel 8259 is a family of Programmable Interrupt Controllers (PIC) designed and developed for use with the Intel 8085 and Intel 8086 microprocessors.
Chapter 11 Multiple interrupts
An Introduction to Microprocessor Architecture using intel 8085 as a classic processor
Computer Organization and Design
8254 Timer and Counter (8254 IC).
Serial Communication Interface: Using 8251
Parallel communication interface 8255
Lecture 18 Interrupt 동국대학교 홍유표.
Programmable Interval timer 8253 / 8254
NS Training Hardware.
Programmable Interval timer 8253 / 8254
Md. Mojahidul Islam Lecturer Dept. of Computer Science & Engineering
Md. Mojahidul Islam Lecturer Dept. of Computer Science & Engineering
Important 8051 Features On chip oscillator 4K bytes ROM 128 bytes RAM
8051 Micro Controller.
Wireless Embedded Systems
Programmable Interrupt Controller (PIC)
Serial Communication 19th Han Seung Uk.
Presentation transcript:

 The LPC2xxx devices currently have two on- chip UARTS.  Except UART1 has additional modem support.

UART UART Initialization: void init_serial (void) /* Initialize Serial Interface */ { PINSEL0 = 0x ; /* Enable RxD1 and TxD1 */ U1LCR = 0x ; /* 8 bits, no Parity, 1 Stop bit */ U1DLL = 0x000000C2; /* 9600 Baud 30MHz VPB Clock */ U1LCR = 0x ; /* DLAB = 0 */ }

UART The Baud rate generator is a sixteen bit prescaler which divides down Pclk to generate the UART clock which must run at 16 times the Baud rate. Hence the formula used to calculate the UART Baud rate is: Divisor = Pclk/16 x BAUD

UART

TRANSMIT FIFO: int putchar (int ch) /* Write character to Serial Port */ { if (ch == '\n') { while (!(U1LSR & 0x20)); U1THR = CR; /* output CR */ } while (!(U1LSR & 0x20)); return (U1THR = ch); } RECIEVER FIFO: int getchar (void) /* Read character from Serial Port */ { while (!(U1LSR & 0x01)); return (U1RBR); }

I2C  Philips were the original inventors of the I2C bus standard  The I2C interface can operate in master or slave mode up to 400K bits per second  In master mode it will automatically arbitrate in a multi-master system

I2C

I2CCONSET  Control Registers I2CONCLR I2SCLH  Bit Rate I2SCLL

I2C  I2STAT  The status register returns control codes which relate to different events on the bus.  I2DAT  The data register is used to supply each byte to be transmitted, or as data is received it will be transferred to this register.  I2ADR  When the LPC2000 is configured as a slave device its network address is set by programming this register.

I2C I2C Initialization: VICVectCntl1 = 0x ; // select a priority slot for a given interrupt VICVectAddr1 = (unsigned)I2CISR // pass the address of the IRQ into the VIC slot VICIntEnable = 0x ; // enable interrupt PINSEL0 = 0x50; // Switch GPIO to I2C pins I2SCLH = 0x08; // Set bit rate to 57.6KHz I2SCLL = 0x08;

I2C Process:  The I2C peripheral must be programmed to respond to each event which occurs on the bus.  First thing we must do is to configure the VIC.  Next the pin-select block is configured to connect the I2C data and clock lines to the external pins.  Lastly we must set the bit rate by programming I2SCLH and I2SCLL.

I2C The formula for the I2C bit rate is given as: Bit Rate = Pclk/(I2SCLH+I2CSLL) For e.g. if Pclk = then Bit Rate = /B ( 8 + 8) =

I2C These registers are used to enable the I2C peripheral and interrupt as well as controlling the I2C bus start, stop and acknowledge conditions.

I2C  To enter the master mode the I2C peripheral must be enabled and the acknowledge bit must be set to zero.

I2C Transaction:  Signals a start condition  Clock line pulled high and data line low  Address of the slave written onto the bus followed by read/write.  Slave replies with an acknowledgement.  Then the data can be transmitted

I2C  ARM7 CPU has to micromanage the I2C bus for each transaction. Master Routine: void I2CTransferByte(unsigned Addr, unsigned Data) { I2CAddress = Addr; // Place address and data in Global to be used by the interrupt I2CData = Data; I2CONCLR = 0x000000FF; // Clear all I2C settings I2CONSET = 0x ; // Enable the I2C interface I2CONSET = 0x ; // Start condition }

SPI  Like the I2C interface the SPI interface is a simple peripheral  Not intelligent enough to manage the bus.

SPI

The SPI peripheral has four external pins:  Serial Clock  Slave Select  Master In Slave Out  Master Out Slave In

SPI  The serial clock pin provides a clock source of up to 400Kbits/sec when in master mode, or will accept an external clock source when in slave mode.  An external peripheral is selected by a slave select pin which is a separate pin.  When the SPI peripheral is in slave mode, it has its own slave select input which must be pulled low to allow an SPI master to communicate with it.  The two data transfer pins master in / slave out and master out / slave in are connected to the remote SPI device

SPI Programmer’s Interface for SPI peripheral has five Registers:  Clock Counter Register  Control Register  Data Register  Interrupt Flag  Status Register

SPI  The clock counter register determines the Baud rate.  The control register is used to configure the operation of the SPI bus (SPI Clock & Data Lines)  Configuration of clock means configuring Phase & Polarity  Finally the data orientation may also be defined as the most significant bit transferred first or the least significant bit transferred first.  Once the bit rate has been set and the control register configured, then communication can begin.