9-10-20151 Microprocessors 2 lesson 7. 9-10-20152 Subjects lesson 7 Planning Interrupts Serial communication /USART Questions.

Slides:



Advertisements
Similar presentations
Serial Interface Dr. Esam Al_Qaralleh CE Department
Advertisements

EUSART Serial Communication.
Microcontrollers A practical approach
INPUT-OUTPUT ORGANIZATION
11-1 ECE 424 Design of Microprocessor-Based Systems Haibo Wang ECE Department Southern Illinois University Carbondale, IL I/O System Design.
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.
DATA COMMUNICATIONS Some organisations concerned with standards: EIA - Electroonic Industries Association (RS standards including RS-232) IEEE - Institute.
Serial I/O - Programmable Communication Interface
1 Fall 2005 Local Serial Asynchronous Communication Qutaibah Malluhi Computer Science and Engineering Qatar University.
Starting with serial Chapter Ten 10.1, 10.2,
Eng. Husam Alzaq The Islamic Uni. Of Gaza
Electronics and Networks: Dumb things with Wires Week 2: Serial Overview Jonah Brucker-Cohen Matthew Karau Monday 10am - 12pm Trinity College Dublin MSc.
COMP3221: Microprocessors and Embedded Systems
7-1 Digital Serial Input/Output Two basic approaches  Synchronous shared common clock signal all devices synchronised with the shared clock signal data.
EET Advanced Digital Chapter 21 Serial Ports.
1 The 9-Pin Connector Pin abbreviations (numbers in parentheses are the 25D pin numbers): 1. CD (8) 2. RD (Rx) (3) 3. TD (Tx) (2) 4. DTR (20) 5. SG (Ground)
Chapter 6 Serial Communications Objectives Introduce the RS232 standard and position it within the crowded field of serial communications standards. Configure.
Serial Communications Standards (Partly Excerpted from Simpl Primer) Cabling Configuration Protocol.
ECE 371- Unit 11 Introduction to Serial I/O. TWO MAJOR CLASSES OF SERIAL DATA INTERFACES ASYNCHRONOUS SERIAL I/O - USES “FRAMING BITS” (START BIT AND.
ECE 353 Introduction to Microprocessor Systems Michael G. Morrow, P.E. Week 13.
EEE305 Microcontroller Systems Lecture 7: Embedded C using PIC microcontrollers Serial i/o with the XC8 Teaching resources are at
Chapter 6 Serial Communications Objectives Introduce the RS232 standard and position it within the crowded field of serial communications standards. Configure.
INPUT-OUTPUT ORGANIZATION
University of Tehran 1 Interface Design Serial Communications Omid Fatemi.
Technology Training that Works Hands of Data Communications, Networking & TCP/IP Troubleshooting.
Serial Communication ETEC 6416.
Transmission Modes Serial Transmission  One bit is transmitted on a circuit at a time  Usually there is one transmit circuit and one receive circuit.
Computers in Surveying SVY2301 / E4006 Automated Surveying.
The 8051 Microcontroller and Embedded Systems
Serial Port I/O Serial port sends and receives data one bit at a time. Serial communication devices are divided into: Data Communications Equipment (DCE),
UART and UART Driver B. Ramamurthy.
Universal Synchronous/Asynchronous Receiver/Transmitter (USART)
1 Microprocessor-based Systems Course 9 Design of the input/output interfaces (continue)
“Describe the overview of hardware interfacing and the serial communication interface. Describe the PIC18 connections to RS232. Explain the serial port.
Universal Asynchronous Receiver/Transmitter (UART)
CHAPTER SERIAL PORT PROGRAMMING. Basics of Serial Communication Computers transfer data in two ways: ◦ Parallel  Often 8 or more lines (wire conductors)
Serial Communications
Advanced Embedded Systems Design Lecture 8 Serial I/O BAE Fall 2004 Instructor: Marvin Stone Biosystems and Agricultural Engineering Oklahoma.
 8251A is a USART (Universal Synchronous Asynchronous Receiver Transmitter) for serial data communication.  Programmable peripheral designed for synchronous.
NS Training Hardware. Serial Controller - UART.
Universal Asynchronous Receiver/Transmitter (UART)
1 © Unitec New Zealand Interrupt Lecture 6 Date: - 20 Sept, 2011 Embedded Hardware ETEC 6416.
Digital Interfaces An interface links two devices Interface Standards define: – mechanical specifications - how many wires & connector type –electrical.
Unit 1 Lecture 4.
8051SERIAL PORT PROGRAMMING
CE-2810 Dr. Mark L. Hornick 1 Serial Communications Sending and receiving data between devices.
8251 USART.
BASICS OF SERIAL COMMUNICATIONS BIRLA VISHWKARMA MAHAVIDYALAYA ELECTRONICS & TELECOMMUNICATION DEPARTMENT PRESENTING BY: ABHISHEK SINGH AMANDEEP.
NARNARAYAN SHASTRI INSTITUTE OF TECHNOLOGY Prepared by: Wasu Ichcha kaur H Bhalani Nidhi M Dhakate Megha D MICROCONTROLLER.
Chapter 6 Serial Communications
Serial mode of data transfer
UART Serial Port Programming
RS-232 Communications.
CS-401 Computer Architecture & Assembly Language Programming
SERIAL PORT PROGRAMMING
RS-232 Communications.
Serial Communication: RS-232 (IEEE Standard)
UART Serial Port Programming
UART Serial Port Programming
Serial Communication Interface: Using 8251
Serial Communication Interface
Преглед Начин функционисања Имплементације
CHAPTER SERIAL PORT PROGRAMMING. Basics of Serial Communication Computers transfer data in two ways: ◦ Parallel  Often 8 or more lines (wire.
Chapter 6 Transmission of Digital Data Interfaces and Modems
EUSART Serial Communication.
PIC Serial Port Interfacing
8051SERIAL PORT PROGRAMMING
PIC Serial Port Interfacing
AVR UART The UART, or Universal Asynchronous Receiver Transmitter, provides hardware support for a serial port on AVR processors Signaling is compatible.
Presentation transcript:

Microprocessors 2 lesson 7

Subjects lesson 7 Planning Interrupts Serial communication /USART Questions

Interrupt sources External Interrupt RA2/INT TMR0 Overflow Interrupt PORTA Change Interrupts 2 Comparator Interrupts A/D Interrupt Timer1 Overflow Interrupt Timer2 Match Interrupt EEPROM Data Write Interrupt Fail-Safe Clock Monitor Interrupt Enhanced CCP Interrupt

Interrupt Logic

Program memory map

Interrupt Software #include "int16CXX.H" #pragma origin 4 interrupt int_server( void) { int16 var; int_save_registers // W, STATUS (and PCLATH) if (T0IF) { /* TMR0 overflow interrupt */ TMR0 = -255; CharToLed(var); var=var*2; if (var>=255) var=1; T0IF = 0; /* reset flag */ int_restore_registers // W, STATUS (and PCLATH) }

Main program interrupts void main( void) { while (1) { }

Serial Communication Intoduction Morse code telegraphy Morse codetelegraphy RS-232 (low-speed, implemented by Serial Ports) RS-232Serial Ports RS485 Universal Serial Bus (moderate-speed, for connecting computers to peripherals) Universal Serial Bus FireWire Fibre Channel (high-speed, for connecting computers to mass storage devices) Fibre Channel InfiniBand (very high speed, broadly comparable in scope to PCI) InfiniBandPCI Serial Attached SCSI Serial ATA PCI Express

RS232-C 1 Half duplex Full duplex 5,6,7,8 databits ASCII (0-127) Stop bit(s) Parity DCE (Data communication equipment) DTE(Data terminal Equipment (PC)) Serial Communication

RS232 DB9-connector 9 Pin Connector on a DTE device (PC connection ) Male RS232 DB9 Pin Number Direction of signal : 1Carrier Detect (CD) (from DCE) Incoming signal from a modem 2 Received Data (RD) Incoming Data from a DCE 3 Transmitted Data (TD) Outgoing Data to a DCE 4 Data Terminal Ready (DTR) Outgoing handshaking signal 5 Signal Ground Common reference voltage 6 Data Set Ready (DSR) Incoming handshaking signal 7 Request To Send (RTS) Outgoing flow control signal 8 Clear To Send (CTS) Incoming flow control signal 9 Ring Indicator (RI) (from DCE) Incoming signal from a modem

RS232 Synchrone A-Synchrone Synchrone: Always dataflow of bits to synchronisize A-Synchrone; When no data needed to send no dataflow. Synchronysation by start and stop bits (So slower) Serial Communication

RS232 Voltages RS232 LevelTransmitter (V) Receiver (V) Space status (0) Mark status (1) Not defined … Serial Communication

Cabellenght versus baudrate Baud rateMaximum cabellength(m) RS232 kabellengte volgens Texas Instruments Serial Communication

Serial communication PIC16F688 Asynchronous - Auto-wake-up - Auto baud calibration - 13-bit Break character Synchronous – selectable clock Synchronous – clock polarity Serial Communication

Transmit status+control register bit 7 CSRC: Clock Source Select bit Asynchronous mode: Don’t care Synchronous mode: 1 = Master mode (clock generated internally from BRG) 0 = Slave mode (clock from external source) bit 6 TX9: 9-bit Transmit Enable bit 1 = Selects 9-bit transmission 0 = Selects 8-bit transmission bit 5 TXEN: Transmit Enable bit 1 = Transmit enabled 0 = Transmit disabled Note: SREN/CREN overrides TXEN in Sync mode. bit 4 SYNC: USART Mode Select bit 1 = Synchronous mode 0 = Asynchronous mode bit 3 SENDB: Send Break Character bit Asynchronous mode: 1 = Send Sync Break on next transmission (cleared by hardware upon completion) 0 = Sync Break transmission completed Synchronous mode: Don’t care bit 2 BRGH: High Baud Rate Select bit Asynchronous mode: 1 = High speed 0 = Low speed Synchronous mode: Unused in this mode bit 1 TRMT: Transmit Shift Register Status bit 1 = TSR empty 0 = TSR full bit 0 TX9D: 9th bit of Transmit Data Can be address/data bit or a parity bit.

Buad rate control

Baud rate calculating

SETUP for serial communication

Exercise In the last week of this quarter you have to finish a programm what shows the working of the serial port. You can do this with 2 persons. The programm on the 2 boards has to send the measured value from AN0 analogue input to the other board. The value received from the other board has to be shown, binary, on the 8 leds Serial Communication