UNIT 24 I2C Test 로봇 SW 교육원 조용수.

Slides:



Advertisements
Similar presentations
Interrupt Test UNIT 14 로봇 SW 교육원 조용수. 학습 목표 Button Interrupt Uart Interrupt 2.
Advertisements

Serial Communications (Chapter 10)
MSP430G2553 launchpad and MPU6050 Introduction
LOGO Lab Supervisor – Dr. WH Lau EE3271 Design Laboratory.
The 8051 Microcontroller Chapter 5 SERIAL PORT OPERATION.
UNIT 20 AD Converter Test 로봇 SW 교육원 조용수.
SDK&UI&LCM&FM Presentation 報告人 : 侯欽堅. 2 Page Excel Your Idea to Silicon Outline  SDK Structure & Code Flow  LCM SPEC & Hardware  LCM Code  FM.
Advanced Operating Systems The I 2 C Bus. Inter-Integrated Circuit Bus Designed for low-cost, medium data rate applications. Characteristics: –Synchronous;
7-1 Digital Serial Input/Output Two basic approaches  Synchronous shared common clock signal all devices synchronised with the shared clock signal data.
I2CI2C CS-423 Dick Steflik. Inter-Integrated Circuit Developed and patented by Philips for connecting low speed peripherals to a motherboard, embedded.
Two Wire Interface Another popular serial peripheral interface bus -More flexible than SPI -Master and slave modes supported -7-bit slave address -400khz.
Lecture 27: LM3S9B96 Microcontroller – Inter- Integrated Circuit (I 2 C) Interface.
Haptic Belt team Informational Presentation.  I 2 C is a form of control bus (multi-master) which allows communication between multiple integrated circuits.
LSU 10/22/2004Serial I/O1 Programming Unit, Lecture 5.
I2C UNIT 23 로봇 SW 교육원 조용수. 학습 목표 I2C I2C Protocol 구조 N051 I2C 동작 I2C Register 2.
UART Test UNIT 14 로봇 SW 교육원 조용수. 학습 목표 UART Init UART Send UART Receive UART -> Debugging Console Up/Down Game 제작 2.
ECE 493T9 Real Time Embedded System Tutorial Set 3 June 10, Spring 2008.
1 SERIAL PORT INTERFACE FOR MICROCONTROLLER EMBEDDED INTO INTEGRATED POWER METER Mr. Borisav Jovanović, Prof.dr Predrag Petković, Prof.dr. Milunka Damnjanović,
DEVICES AND COMMUNICATION BUSES FOR DEVICES NETWORK
PWM UNIT 17 로봇 SW 교육원 조용수. 학습 목표 PWM PWM Register 2.
UNIT 29 MCU Project 로봇 SW 교육원 조용수.
I2C Master Core Simulation Environment. I2C Master Core Requirements Coverage (*) Requirement I2C IP RS-906: The I2C IP shall define the period of time,
MICROCONTROLLER SYSTEMS Part 1. Figure 1.1Elements of a digital controller CPU Central Processing Unit Input Peripherals Output Peripherals ROM Read Only.
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.
UNIT 11 UART 로봇 SW 교육원 조용수.
Albert Board UNIT 27 로봇 SW 교육원 조용수. Albert Board ISD 9160 Albert Board Connection Albert Board 용 SW 설치 Sample Source 동작 2.
SPI Test UNIT 26 로봇 SW 교육원 조용수. 학습 목표 SPI Sample SPI Read/Write Function SPI loop back Test MPL115A1 Pressure and Temperature Sensor 2.
©2008 R. Gupta, UCSD COSMOS Summer 2008 Peripheral Interfaces Rajesh K. Gupta Computer Science and Engineering University of California, San Diego.
© 2009, Renesas Technology America, Inc., All Rights Reserved 1 Course Introduction  Purpose:  This course provides an overview of the serial communication.
S4525A Peripherals & Enhanced FLASH 1 © 1999 Microchip Technology Incorporated. All Rights Reserved. S4525A Peripherals & Enhanced FLASH 1 Peripherals.
PWM Test 2 UNIT 20 로봇 SW 교육원 조용수. 학습 목표 PWM Servo 제어 2.
Department of Electronic & Electrical Engineering Serial interfaces Serial Interfaces allow communication between devices sending one bit at a time. In.
Serial Peripheral Interface SPI I2C (i-squared cee)
System Control & Clock UNIT 08 로봇 SW 교육원 조용수. 학습 목표 System Control Register System Clock CMSIS CMSIS Project 2.
CHARLES UNIVERSITY IN PRAGUE faculty of mathematics and physics Principles of Computers 19 th Lecture Pavel Ježek, Ph.D.
Timer & Watch Dog Test UNIT 16 로봇 SW 교육원 조용수. 학습 목표 Timer Init Timer Delay Test Timer Interrupt Test –One Shot Mode –Periodic Mode Watch Dog Test 시계 만들어.
Communicating. The ATmega16 communicates through one of the following ways: Serial Peripheral Interface (SPI) Universal Synchronous and Asynchronous serial.
Department of Electrical Engineering, National Taiwan Ocean University I2C Bus 5/16/2013 Richard Kuo Assistant Professor.
PWM Test UNIT 20 로봇 SW 교육원 조용수. 학습 목표 PWM Init PWM LED 제어 2.
Not So Deep Blue The original Deep Blue. LED chess board Track movements of all pieces Show possible moves Track game time Detect piece movement -Magnets/Reed.
 The LPC2xxx devices currently have two on- chip UARTS.  Except UART1 has additional modem support.
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.
UNIT 24 I2C Test 로봇 SW 교육원 조용수.
Serial mode of data transfer
Outline Analog to digital conversion (ADC) of NuMaker TRIO
I2C Protocol and RTC Interfacing
EMBEDDED SYSTEMS UNIT 4.
The I2C Bus.
Two Wire Interface Another popular serial peripheral interface bus
Inter-IC Bus (I C) 2.
Chapter 11: Inter-Integrated Circuit (I2C) Interface
(Inter-IC bus) By Tejaswini Gadicherla
Two Wire Interface (TWI)
I2C Synchronous Serial Two wire communications (plus ground)
I2C Protocol and RTC Interfacing
I2C PROTOCOL SPECIFICATION
Zephyr Device Driver and Device Model
EEPROM Comparison – Parallel or Serial
8254 Timer and Counter (8254 IC).
Serial EEPROM (Atmel 24C-512)
I2C and RTC Chapter 18 Sepehr Naimi
I2C Protocol and RTC Interfacing
NS Training Hardware.
I2C transmittion specificataion
Principles of Computers 20th Lecture
I2C Protocol and RTC Interfacing
EUSART Serial Communication.
Serial Communication 19th Han Seung Uk.
UNIT 26 SPI Test 로봇 SW 교육원 조용수.
Serial Peripheral Interface Bus
Presentation transcript:

UNIT 24 I2C Test 로봇 SW 교육원 조용수

학습 목표 I2C Sample Test \M051_Series_BSP_CMSIS_Rev3.00.001\SampleCode\RegBased\I2C_Master .\M051_Series_BSP_CMSIS_Rev3.00.001\SampleCode\RegBased\I2C_Slave

I2C Source Init 수정 void SYS_Init(void) { /* Enable UART module clock */ CLK->APBCLK |= CLK_APBCLK_UART0_EN_Msk | CLK_APBCLK_I2C0_EN_Msk; /* Update System Core Clock */ /* User can use SystemCoreClockUpdate() to calculate SystemCoreClock and cyclesPerUs automatically. */ SystemCoreClockUpdate(); /* Set P3 multi-function pins for UART0 RXD and TXD, and set P3.4 and P3.5 for I2C0 SDA and SCL */ SYS->P3_MFP = SYS_MFP_P30_RXD0 | SYS_MFP_P31_TXD0 | SYS_MFP_P34_SDA0 | SYS_MFP_P35_SCL0; } void UART0_Init(void) UART_Open(UART0, 115200); This is the read operation of EEPROM. The first four steps are the same with the Write operation.

I2C Status

I2C Write Status This is the write operation of EEPROM. The flow is similar to the last example for usage of I2C control register. In data transfer, it includes two bytes address and one byte data. We will use I2C driver to implement this operation. We follow the write operation to send start, slave address, address high byte, address low byte, data, and stop in sequence.

I2C Write Sample Source void I2C_MasterTx(uint32_t u32Status) { if(u32Status == 0x08) /* START has been transmitted */ I2C0->I2CDAT = g_u8DeviceAddr << 1; /* Write SLA+W to Register I2CDAT */ I2C_SET_CONTROL_REG(I2C0, I2C_I2CON_SI); } else if(u32Status == 0x18) /* SLA+W has been transmitted and ACK has been received */ I2C0->I2CDAT = g_au8TxData[g_u8DataLen++]; else if(u32Status == 0x20) /* SLA+W has been transmitted and NACK has been received */ I2C_SET_CONTROL_REG(I2C0, I2C_I2CON_STA_STO_SI); else if(u32Status == 0x28) /* DATA has been transmitted and ACK has been received */ if(g_u8DataLen != 3) { } else { I2C_SET_CONTROL_REG(I2C0, I2C_I2CON_STO_SI); g_u8EndFlag = 1; printf("Status 0x%x is NOT processed\n", u32Status); This is the write operation of EEPROM. The flow is similar to the last example for usage of I2C control register. In data transfer, it includes two bytes address and one byte data. We will use I2C driver to implement this operation. We follow the write operation to send start, slave address, address high byte, address low byte, data, and stop in sequence.

I2C Read Status This is the read operation of EEPROM. The first four steps are the same with the Write operation.

I2C Read Source void I2C_MasterRx(uint32_t u32Status) { if(u32Status == 0x08) /* START has been transmitted and prepare SLA+W */ I2C0->I2CDAT = g_u8DeviceAddr << 1; /* Write SLA+W to Register I2CDAT */ I2C_SET_CONTROL_REG(I2C0, I2C_I2CON_SI); } else if(u32Status == 0x18) /* SLA+W has been transmitted and ACK has been received */ I2C0->I2CDAT = g_au8TxData[g_u8DataLen++]; else if(u32Status == 0x20) /* SLA+W has been transmitted and NACK has been received */ I2C_SET_CONTROL_REG(I2C0, I2C_I2CON_STA_STO_SI); else if(u32Status == 0x28) /* DATA has been transmitted and ACK has been received */ if(g_u8DataLen != 2) else I2C_SET_CONTROL_REG(I2C0, I2C_I2CON_STA_SI); This is the read operation of EEPROM. The first four steps are the same with the Write operation.

I2C Read Source else if(u32Status == 0x10) /* Repeat START has been transmitted and prepare SLA+R */ { I2C0->I2CDAT = ((g_u8DeviceAddr << 1) | 0x01); /* Write SLA+R to Register I2CDAT */ I2C_SET_CONTROL_REG(I2C0, I2C_I2CON_SI); } else if(u32Status == 0x40) /* SLA+R has been transmitted and ACK has been received */ else if(u32Status == 0x58) /* DATA has been received and NACK has been returned */ g_u8RxData = I2C0->I2CDAT; I2C_SET_CONTROL_REG(I2C0, I2C_I2CON_STO_SI); g_u8EndFlag = 1; else /* TO DO */ printf("Status 0x%x is NOT processed\n", u32Status); This is the read operation of EEPROM. The first four steps are the same with the Write operation.

I2C Sample Test 2 개의 보드를 연결하여 Master / Slave 의 소스를 각각 Downloading 하여 테스트 한다.