Inter-IC Bus (I C) 2.

Slides:



Advertisements
Similar presentations
I2C bus Inter Integrated Circuits bus by Philips Semiconductors
Advertisements

I/O Unit.
Embedded Systems I2CI2C. Feature 3 wire GND SCL(clock) SDA(data) All devices share the same bus wire Using wire and, each device gain access to bus (become.
FIU Chapter 7: Input/Output Jerome Crooks Panyawat Chiamprasert
Lecture 27: LM3S9B96 Microcontroller – Inter- Integrated Circuit (I 2 C) Interface.
NS Training Hardware. System Controller Module.
Serial Peripheral Interface Module MTT M SERIAL PERIPHERAL INTERFACE (SPI)
LSU 10/22/2004Serial I/O1 Programming Unit, Lecture 5.
7/23 Inter-chip Serial Communication: SPI and I 2 C Computer Science & Engineering Department Arizona State University Tempe, AZ Dr. Yann-Hang Lee.
1 SERIAL PORT INTERFACE FOR MICROCONTROLLER EMBEDDED INTO INTEGRATED POWER METER Mr. Borisav Jovanović, Prof.dr Predrag Petković, Prof.dr. Milunka Damnjanović,
HCS12 Technical Training, Rev 2.0 Module 11- BDLC, Slide 1 MOTOROLA and the Stylized M Logo are registered in the US Patent & Trademark Office. All other.
1 Synchronous Serial IO Send a separate clock line with data –SPI (serial peripheral interface) protocol –I 2 C (or I2C) protocol Encode a clock with data.
Microprocessor. Interrupts The processor has 5 interrupts. CALL instruction (3 byte instruction). The processor calls the subroutine, address of which.
Refer to Chapter 15 in the reference book
©2008 R. Gupta, UCSD COSMOS Summer 2008 Peripheral Interfaces Rajesh K. Gupta Computer Science and Engineering University of California, San Diego.
S4525A Peripherals & Enhanced FLASH 1 © 1999 Microchip Technology Incorporated. All Rights Reserved. S4525A Peripherals & Enhanced FLASH 1 Peripherals.
Lecture 4 General-Purpose Input/Output NCHUEE 720A Lab Prof. Jichiang Tsai.
 The LPC2xxx devices currently have two on- chip UARTS.  Except UART1 has additional modem support.
Why are Timer Functions Important?
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.
PROGRAMMABLE PERIPHERAL INTERFACE -8255
Serial mode of data transfer
Outline Analog to digital conversion (ADC) of NuMaker TRIO
I2C Protocol and RTC Interfacing
The 8085 Microprocessor Architecture
Tutorial Introduction
Two Wire Interface Another popular serial peripheral interface bus
Chapter 11: Inter-Integrated Circuit (I2C) Interface
Direct Memory address and 8237 dma controller LECTURE 6
CPU Sequencing 6/30/2018.
Interrupts In 8085 and 8086.
The 8085 Microprocessor Architecture
(Inter-IC bus) By Tejaswini Gadicherla
1 Input-Output Organization Computer Organization Computer Architectures Lab Peripheral Devices Input-Output Interface Asynchronous Data Transfer Modes.
Introduction of microprocessor
Two Wire Interface (TWI)
EE 107 Fall 2017 Lecture 7 Serial Buses – I2C Direct Memory Access
Dr. Michael Nasief Lecture 2
DMA CONTROLLER 8257 Features: It is a 4-channel DMA.
Presentation On 8259 Made by Md Shabbir Hasan.
Programmable Interrupt Controller 8259
Programmable Interrupt Controller 8259
I2C Protocol and RTC Interfacing
I2C PROTOCOL SPECIFICATION
Communication Lines Fundamentals.
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.
An Introduction to Microprocessor Architecture using intel 8085 as a classic processor
BJ Furman ME 106 Fundamentals of Mechatronics 15NOV2012
Introduction to Microprocessors and Microcontrollers
PROGRAMMABLE PERIPHERAL INTERFACE -8255
Instruction cycle Instruction: A command given to the microprocessor to perform an operation Program : A set of instructions given in a sequential.
Serial Communication Interface: Using 8251
Serial EEPROM (Atmel 24C-512)
Parallel communication interface 8255
Lecture 18 Interrupt 동국대학교 홍유표.
I2C and RTC Chapter 18 Sepehr Naimi
I2C Protocol and RTC Interfacing
전자의료시스템 및 실습 System Configuration/Interrupt
X1 & X2 These are also called Crystal Input Pins.
Md. Mojahidul Islam Lecturer Dept. of Computer Science & Engineering
Md. Mojahidul Islam Lecturer Dept. of Computer Science & Engineering
The 8085 Microprocessor Architecture
I2C Protocol and RTC Interfacing
8253 – PROGRAMMABLE INTERVAL TIMER (PIT). What is a Timer? Timer is a specialized type of device that is used to measure timing intervals. Timers can.
ANALOG TO DIGITAL CONVERTER (ATD).
Computer System Overview
Flash & EEPROM Module NVM.
Source: Serial Port Source:
Jazan University, Jazan KSA
CPU Sequencing 7/20/2019.
Presentation transcript:

Inter-IC Bus (I C) 2

HCS12 CPU Internal Bus PLL PIT SCI 1 SCI 1 ATD 1 ATD 12K SRAM 12K SRAM 256K FLASEEPROM Internal Bus SPI 2 or PWM CH 4-7 SPI 1 or PWM CH 0-3 SPI 0 BKP INT MMI PWM 8 CHAN HCS12 CPU SIM CM BDM MEBI PLL PIT msCAN 4 or IIC msCAN 3 msCAN 2 msCAN 1 BDLC or msCAN ECT 8 CHAN 4K BYTES EEPROM

IIC Features • Compatible with I2C Bus standard • Multi-master operation • Software programmable for one of 256 different serial clock frequencies • Software selectable acknowledge bit • Interrupt driven byte-by-byte data transfer • Arbitration lost interrupt with automatic mode switching from master to slave • Calling address identification interrupt • Start and stop signal generation/detection • Repeated start signal generation • Acknowledge bit generation/detection • Bus busy detection Low power modes support Shared with msCAN 4

IIC Functional Block Diagram Address Module IIC_Interrupt R_Data W_Data SCL D_IN IN/OUT D_OUT

IIC Communication Protocol START signal is defined as a high-to-low transition of SDA while SCL is high. A master may initiate communication by sending a START signal. This signal denotes the beginning of a new data transfer (each data transfer may contain several bytes of data) and brings all slaves out of their idle states. Slave Address: An address byte followed by 1-bit R/W command to tell the Slave the desired direction of data transfer. ACK Bit - Slave Transfer Acknowledge. Stop: Master generates a Stop signal to free the bus. Repeat Start: Repeat Start is a Start signal without generating a Stop signal to terminate communication.

IIC Registers IBAD - IIC Address Register ADR[7:1] - Slave Address Address Offset $0000 ADR[7:1] - Slave Address Address of selected IIC slave device IBDR - IIC Data I/O Register Bit 7 6 5 4 3 2 1 Bit 0 $0004 IIC Master initiates data transmission by writing data to this register. IIC Master initiates data reception of next byte by reading this register.

IIC Registers IBFR - IIC Frequency Divider Register Address Offset $0001 Bit 7 6 5 4 3 2 1 Bit 0 I-Bus Tap and Prescale Values I-Bus Tap and Prescale Values Division Factor IBC[2:0] SCL Tap SDA Tap Clocks Clocks 000 5 1 001 6 1 010 7 2 011 8 2 100 9 3 101 10 3 110 12 4 111 15 4 IBC[5:3] SCL2Tap Tap2Tap (Bin) (Clocks) (Clocks) 000 5 1 001 6 2 010 6 4 011 6 8 100 6 16 101 14 32 110 30 64 111 126 128 IBC[7:6] DIV 00 1 01 2 10 4 11 Reserved SCL Divider = DIV x {2 scl2tap + [(SCL_Tap -1 ) x tap2tap ] +2)} SCL Hold = DIV x {scl2tap + [(SCL_Tap -1 ) x tap2tap ] +3 }

I-Bus Transfer Control IBCR - IIC Control Register Address Offset $0002 Bit 7 6 5 4 3 2 1 Bit 0 IBEN — I-Bus Enable This bit controls the software reset of the entire IIC Bus module. 1 = The IIC Bus module is enabled. This bit must be set before any other IBCR bits have any effect. 0 = The module is reset and disabled. IBIE - I-Bus Interrupt Enable 1 = IIC Interrupts Enabled MS/SL - Master/Slave Mode Select A change from “0’ to “1” enables IIC as Master and causes a Start Signal generation. A change from “1’ to “0” changes IIC from Master to Slave & causes a Stop Signal generation. Tx/Rx - Transmit/Receive Mode Select Selects direction of data transfer. The Master should set this bit during address transfer cycle. 1 = Transmit Mode 0 = Receive Mode TXAK - Transmit Acknowledge Enable 1 = No Acknowledge response is sent 0 = Acknowledge signal will be sent on the 9th clock bit RSTA - Repeat Start The master generates a Repeat Star signal on the IIC bus by writing this bit with a logic”1”. IBSWAI - I_Bus Interface Stop in Wait Mode 1 = Will cause the IIC Bus to Halt when the CPU executes wait instruction. 0 = IIC Bus continues to run normally in wait mode

I-Bus Status TCF - Data Transfer Bit Bit 7 6 5 4 3 2 1 Bit 0 TCF - Data Transfer Bit 1 = Transfer is complete. This bit is set on 9th clock of a byte transfer. 0 = Transfer in progress. IAAS - Addressed as a Slave This bit is set when the calling address matches the I-Bus Address Register 1 = Addressed as a slave and an interrupt is requested if enabled. 0 = Not addressed To clear this bit, a write to I-Bus Control Register. IBB - I-Bus Busy This bit is set when a Start signal is detected. It is cleared when I-Bus is idle. IBAL - Arbitration Lost This bit is set for the following conditions: 1. SDA sampled as a low when the master drives a high during an address or data transmit cycle. 2. SDA sampled as a low when the master drives a high during the acknowledge bit of a data receive cycle. 3. A start cycle is attempted when the bus is busy. 4. A repeated start cycle is requested in slave mode. 5. A stop condition is detected when the master did not request it. (This bit must be cleared by software, by writing a “0” to it.) SRW - Slave Read/Write When the I-Bus is selected as a Slave, this bit indicates the R/W command bit of the calling address sent from the Master. 1 = Slave transmit, Master reading from Slave. 0 = Slave receive, Master writing to Slave. IBIF - I-Bus Interrupt I-Bus generates an interrupt request for the following events: 1. Completion of one byte transfer. 2. Reception of a matching calling address. 3. When arbitration is lost. (To clear this bit, write a “0” to it in the interrupt service routine) RXAK - Receive Acknowledge 1 = No Acknowledge signal is detected on 9th bit clock. 0 = Acknowledge signal was detected on 9th bit clock.

Initialization Initialization Sequence: Reset will put the IIC Control Register to its default status. Before the interface can be used to transfer serial data, an initialization procedure must be carried out, as follows: 1. Update the Frequency Divider Register (IBFD) and select the required division ratio to obtain SCL frequency from system clock. 2. Update the IIC Address Register (IBAD) to define its slave address. 3. Set the IBEN bit of the IIC Control Register (IBCR) to enable the IIC system. 4. Modify the bits of the IIC Control Register (IBCR) to select Master/Slave mode, Transmit/Receive mode and interrupt enable or not.

Start Bit Generation Sequence An example of a program which generates the START signal and transmits the first byte of data (slave address) is shown below: CHFLAG BRSET IBSR,#$20 ;WAIT FOR IBB FLAG TO CLEAR TXSTART BSET IBCR,#$30 ;SET TRANSMIT AND MASTER MODE ;i.e. GENERATE START CONDITION MOVEB CALLING,IBDR ;TRANSMIT THE CALLING ;ADDRESS, D0=R/W IBFREE BRCLR #5,IBSR,#$20 ;WAIT FOR IBB FLAG TO SET Stop Bit Generation Sequence A data transfer ends with a STOP signal generated by the ‘master.’ The following is an example showing how a stop condition is generated. MASTX TST TXCNT ;TEST VALUE OF TRANSMITING COUNTER BEQ END ;END IF NO MORE DATA BRSET IBSR,#$01,END ;END IF NO ACK MOVB DATABUF,IBDR ;TRANSMIT NEXT BYTE OF DATA DEC TXCNT ;DECREASE THE TXCNT BRA EMASTX ;EXIT END BCLR IBCR,#$20 ;GENERATE A STOP CONDITION EMASTX RTI ;RETURN FROM INTERRUPT