The Serial Communication Interface (SCI) MC9S12-C32

Slides:



Advertisements
Similar presentations
Serial Communications Interface (SCI) Michael LennardZachary PetersBao Nguyen.
Advertisements

H. Huang Transparency No.9-1 The HCS12/MC9S12 Microcontroller Copyright © 2010 Delmar Cengage Learning Chapter 9: Serial Communication Interface – SCI.
SCI: Serial Communications Interface Presented by: Sean Kline Chad Smith Jamie Cruce.
I/O Unit.
10-1 EE 319K Introduction to Microcontrollers Lecture 10: Interrupts, Output Compare Periodic Interrupts Read Book Sections 9.1, 9.2, 9.4, 9.6.1, 9.6.2,
ELEC 330 Digital Systems Engineering Dr. Ron Hayne
68HC11 Polling and Interrupts
Serial Communication Interface
ECE 372 – Microcontroller Design Parallel IO Ports - Interrupts
1 Input and Output Patt and Patel Ch Computer System.
Startup Code Lecture L5.2. Reference MC9S12C Family Device User Guide V S12C128DGV1.pdf.
The Serial Communication Interface (SCI) Chapter 11.
6-1 I/O Methods I/O – Transfer of data between memory of the system and the I/O device Most devices operate asynchronously from the CPU Most methods involve.
E-Voting Machine - Design Presentation Group M1 Jonathan Chiang Jessica Kim Chi Ho Yoon Donald Cober Mon. Sept 15 System Block Diagram Data Flow Transistor.
Programming the HC12 in C. Some Key Differences – Note that in C, the starting location of the program is defined when you compile the program, not in.
Midterm Tuesday October 23 Covers Chapters 3 through 6 - Buses, Clocks, Timing, Edge Triggering, Level Triggering - Cache Memory Systems - Internal Memory.
Chapter 8 Overview Programmed I/O Introduction to Interrupt Driven I/O Project 3.
The Serial Communication Interface (SCI) MC9S12-DP256 Chapter 11.
Input and Output How things get into and out of the CPU.
RS-232 Port Lecture L9.3. Loop feedback RS-232 voltage levels: +5.5 V (logic 0) -5.5 V (logic 1)
The Serial Peripheral Interface (SPI)
Harrison Jones Alexis Noel William Allen SERIAL COMMUNICATION INTERFACE (SCI)
1 SCI Serial Communication Interface Gerrit Becker James McClearen Charlie Hagadorn October 21, 2004.
Serial Communication Interface (SCI) Kevin Stuart Matt Betts March 27, 2007 ME 6405, Sp 07.
CHAPTER 10 Keyboard and Printer Interfacing. Matrix Keyboard.
Introduction to Computing Systems from bits & gates to C & beyond Chapter 8 Input/Output Basic organization Keyboard input Monitor output Interrupts DMA.
Chapter 8 Input/Output l I/O basics l Keyboard input l Monitor output l Interrupt driven I/O l DMA.
Lab 1 – Assembly Language and Interfacing Start date: Week 3 Due date: Week 4 1.
EET 2261 Unit 11 Serial Communications Interface  Read Almy, Chapter 24.  Homework #11 and Lab #11 due next week.  Quiz next week.
Introduction to Embedded Systems Buffering and DMA (Direct Memory Access) Lecture 11.
Lecture Set 9 MCS-51 Serial Port.
Unit 4 Design and Synthesis of Datapath Controllers
UART ELEC 418 Advanced Digital Systems Dr. Ron Hayne Images Courtesy of Thomson Engineering.
Serial I/O and the HC11. Overview General discussion of serial I/O operations oSynchronous vs. asynchronous operations oBaud rate vs. bit rate oTransmission.
Scott Baker Will Cross Belinda Frieri March 9 th, 2005 Serial Communication Overview ME4447/6405.
Chapter 8 I/O. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 8-2 I/O: Connecting to Outside World So far,
I/O Interfacing A lot of handshaking is required between the CPU and most I/O devices. All I/O devices operate asynchronously with respect to the CPU.
1. Registers Used in Timer/Counter  TH0, TL0, TH1, TL1  TMOD (Timer mode register)  TCON (Timer control register) 2.
 8251A is a USART (Universal Synchronous Asynchronous Receiver Transmitter) for serial data communication.  Programmable peripheral designed for synchronous.
9-1 EE 319K Introduction to Microcontrollers Lecture 9:I/O Synchronization; LCD Interfacing; Implementing Local Variables using a Stack Frame; Parameter.
Serial Communication Interface Ta Kim Nicholas Earnhart Razid Ahmad ME 6405 – Fall 2008 November 6, 2008.
Asynchronous Serial I/O Unit 12 - Part 1. SCI Registers – Channel 0 SCI0BDH – SCI Baud Rate Register High Byte SCI0BDL – SCI Baud Rate Register Low.
Accessing I/O Devices Processor Memory BUS I/O Device 1 I/O Device 2.
ME 4447/6405 Microprocessor Control of Manufacturing Systems and
1 October 26, 2006ME 6405 MechatronicsSerial Communication Interface Brian Guerriero Jon Rogers Robert Thiets.
ELE22MIC Lecture 8 ASll Examples –16 Bit Counters –Buffalo Jump Table Interrupt processing (IRQ/RTI) Stack Frame & Base Pointer Wired OR.
Keypad Lecture L4.6. Port Integration Module PIM_9C32 Block Guide V01.06 Reference: S12C32PIMV1.pdf.
I/O Ports MTT I/O PORTS. I/O Ports MTT Module Objectives Configure any pin as either input or output Read or write data from/to port.
HCS12 Technical Training, Rev 2.0 Module 7- SCI, Slide 1 MOTOROLA and the Stylized M Logo are registered in the US Patent & Trademark Office. All other.
Serial Communications Interface Module Slide #1 of 19 MC68HC908GP20 Training PURPOSE -To explain how to configure and use the Serial Communications Interface.
بسم الله الرحمن الرحيم MEMORY AND I/O.
1 MPC 555: Queued Serial Module. 2 MPC 555 QSM QSPI: Queued Serial Peripheral Interface: full duplex serial, synchronous interface. 160B of queue RAM.
Embedded Systems Lecture 5 January 25 th, 2016.
CS-280 Dr. Mark L. Hornick 1 Sequential Execution Normally, CPU sequentially executes instructions in a program Subroutine calls are synchronous to the.
Computer Operating Properly Module MTT COMPUTER OPERATING PROPERLY MODULE (COP)
8255:Programmable Peripheral Interface
Chapter 8 Input/Output An Hong 2015 Fall School of Computer Science and Technology Lecture on Introduction to.
Transmitter Interrupts Review of Receiver Interrupts How to Handle Transmitter Interrupts? Critical Regions Text: Tanenbaum
Tiva C TM4C123GH6PM UART Embedded Systems ECE 4437 Fall 2015 Team 2:
SCI Communication Proudly Presented By: Adam Cardi & Aaron Enes.
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.
68HC11 Interrupts & Resets.
Buffered, Interrupt-Driven Printer Design Example
Buffered, Interrupt-Driven Printer Design Example
Chapter 8 Input/Output I/O basics Keyboard input Monitor output
Serial Communication Interface
Branching and Loops.
Transmitter Interrupts
ME 4447/6405 Microprocessor Control of Manufacturing Systems and
Interrupt-Driven State Machine
Presentation transcript:

The Serial Communication Interface (SCI) MC9S12-C32 Lecture L4.9

HCS12 Serial Communications Interface Reference HCS12 Serial Communications Interface (SCI) Block Guide V02.08 S12SCIV2.pdf

PIM_9C32 Block Diagram SCI module

SCI Asynchronous Serial I/O The 68HCS12 SCI Interface Programming the SCI SCI Interface Using Interrupts

SCI Asynchronous Serial I/O The 68HCS12 SCI Interface Programming the SCI SCI Interface Using Interrupts

SCI Asynchronous Serial I/O The 68HCS12 SCI Interface Programming the SCI SCI Interface Using Interrupts

sci.asm ; SCI0 SC0BDH EQU $C8 ;baud rate control SC0CR1 EQU $CA ;SCI control reg 1 SC0CR2 EQU $CB ;SCI control reg 2 SC0SR1 EQU $CC ;SCI status reg SC0DRL EQU $CF ;SCI data reg RDRF EQU $20 ;SCSR mask ; INITIALIZE SCI sci0_init CLR SC0CR1 ;8 bit LDD #52 STD SC0BDH ;9600 baud LDAA #$0C STAA SC0CR2 ;enable tx & rx RTS

; INPUT BYTE FROM SERIAL PORT INTO A INCHAR LDAA SC0SR1 ;check status ANDA #RDRF ;check rdrf BEQ INCHAR ;wait for char LDAA SC0DRL ;get char in A RTS ; OUTPUT BYTE IN A TO SERIAL PORT OUTPUT TST SC0SR1 BPL OUTPUT ;loop until tdre STAA SC0DRL ;send A

Communicating with a PC

sciecho.asm ; echo char to PC org $4000 sci_echo bsr sci0_init se1 bsr inchar bsr output bra se1 #include sci.asm

SCI Asynchronous Serial I/O The 68HCS12 SCI Interface Programming the SCI SCI Interface Using Interrupts

; SCI Interface using interrupts File: SCIINT.WHP ; display characters from PC keyboard on LCD display SC0BDH EQU $C8 ;baud rate control SC0CR1 EQU $CA ;SCI control reg 1 SC0CR2 EQU $CB ;SCI control reg 2 SC0SR1 EQU $CC ;SCI status reg SC0DRL EQU $CF ;SCI data reg RDRF EQU $20 ;SCSR mask SCI0.IVEC EQU $0FD8 ;SCI0 user vector address + 2 ORG $4000 main jsr spi_init ;initialize spi jsr lcd_init ;initialize lcd jsr initq ;initialize queue jsr sci0_init ;initialize sci mn1 jsr checkq ;if queue is empty bcs mn1 ; wait jsr data8 ;store char on LCD ldy #3 jsr ms_delay ;delay ~10 ms bra mn1

; INITIALIZE SCI sci0_init SEI ;disable interrupts CLR SC0CR1 ;8 bit LDD #52 STD SC0BDH ;9600 baud LDAA #$2C STAA SC0CR2 ;enable tx & rx, RX INT LDD #SCI_INTSER STD SCI0.IVEC ;set sci int vector CLI ;enable interrupts RTS

; Interrupt service routine: get char and store in queue  SCI_INTSER LDAA SC0SR1 ANDA #RDRF BEQ SI1 ;if RDRF set LDAA SC0DRL ;read data (clears RDRF flag) JSR QSTORE ;and store it in queue SI1 RTI #INCLUDE QUEUE.ASM #INCLUDE LCD.ASM