Basic PIC-C I2C Communication

Slides:



Advertisements
Similar presentations
Finite State Machine & PIC-C I2C Communication
Advertisements

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.
Basic PIC-C I2C Communication and Controlling the 7-segment module Arnan (Roger) Sipitakiat Department of Computer Engineering, Chiang Mai University,
Arnan Sipitakiat Dept. Computer Engineering, Chiang Mai Univeristy.
Technion-Israel Institute of Technology Electrical Engineering Department High Speed Digital Systems Laboratory Project subject: wireless biofeedback system.
The Great I2C Mystery. The mystery Occasionally, when accessing the I2C bus, the APVs are found not to respond correctly to I2C commands, actually they.
HT46 A/D Type MCU Series Data Memory (Byte) Program Memory HT46R22 (OTP) HT46C22 (Mask) 2Kx Kx16 4Kx HT46R23 (OTP) HT46C23 (Mask) HT46R24.
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.
Synchronous Serial IO Send a separate clock line with data
Technion-Israel Institute of Technology Electrical Engineering Department High Speed Digital Systems Laboratory Project subject: wireless biofeedback system.
1 © Unitec New Zealand I2C Lecture 10 Date: - 2 Nov, 2011 Embedded Hardware ETEC 6416.
Arduino Nano to Uno I2C Communication Mike Pluma The-Bao Nguyen EE 444 Spring 2013.
LSU 10/22/2004Serial I/O1 Programming Unit, Lecture 5.
Embedded Bus – i2c David E. Culler Lab 2 Feb 2, 2015
Basic PIC-C I2C Communication
The PiTopping and Educational Robotics with Embedded Computers Arnan Sipitakiat 1, Paulo Blikstein 2 1 Department of Computer Engineering, Chiang Mai University,
Lecture 20: Communications Lecturers: Professor John Devlin Mr Robert Ross.
DEVICES AND COMMUNICATION BUSES FOR DEVICES NETWORK
Arnan Sipitakiat Dept. Compute Engineering, Chiang Mai University.
PCA9557: REMOTE 8-BIT I 2 C AND SMBus LOW- POWER I/O EXPANDER.
I2C Master Core Simulation Environment. I2C Master Core Requirements Coverage (*) Requirement I2C IP RS-906: The I2C IP shall define the period of time,
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.
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.
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)
Readout of Temperature Monitor with SEABAS ’11 10/12 Y. Takubo (KEK) 1.
Lab 9 Multiprocessor, Buses, SPI, I2C. Multiprocessors Why multiprocessors? The structure of multiprocessors. Elements of multiprocessors: – Processing.
 The LPC2xxx devices currently have two on- chip UARTS.  Except UART1 has additional modem support.
DIRECT MEMORY ACCESS and Computer Buses
UNIT 24 I2C Test 로봇 SW 교육원 조용수.
Department of Computer Science and Engineering
Serial Communication Originally created by Anurag Dwidedi and Rudra Pratap Suman.
Chapter 6 Input/Output Organization
Outline Analog to digital conversion (ADC) of NuMaker TRIO
I/O SYSTEMS MANAGEMENT Krishna Kumar Ahirwar ( )
Microcontroller basics
Two Wire Interface Another popular serial peripheral interface bus
Do-more Technical Training
ROOM OCCUPANCY INDICATOR
MGITER,NAVSARI. AVR MICROCONTROLLER AND INTERFACING
Inter-IC Bus (I C) 2.
Chapter 11: Inter-Integrated Circuit (I2C) Interface
I/O Memory Interface Topics:
DIGITAL CALCULATOR USING 8051
(Inter-IC bus) By Tejaswini Gadicherla
90-30 DeviceNet configuration
1 Input-Output Organization Computer Organization Computer Architectures Lab Peripheral Devices Input-Output Interface Asynchronous Data Transfer Modes.
I2C Synchronous Serial Two wire communications (plus ground)
Computer to Radio 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.
BJ Furman ME 106 Fundamentals of Mechatronics 15NOV2012
EEPROM Comparison – Parallel or Serial
Communication—the lab course of Snake Robot
Serial EEPROM (Atmel 24C-512)
I2C and RTC Chapter 18 Sepehr Naimi
I2C Protocol and RTC Interfacing
8259 Programmable Interrupt Controller
Principles of Computers 20th Lecture
RPi 2/3, I2C, Analog Sensor
Another Physical Layer – I2C
8051 Micro Controller.
The Need for Addressing
Costas Foudas, Imperial College, Rm: 508, x47590
I/O Experiments Assignment 1.
IN5350 – CMOS Image Sensor Design
Presentation transcript:

Basic PIC-C I2C Communication Arnan (Roger) Sipitakiat Department of Computer Engineering, Chiang Mai University, Thailand

I2C Basics I2C is a Bus. Serial is point-to-point Master and Slave pair Master must start the communication Slave can only respond Slave has a 8-bit address Bit 0 is reserved for direction control

Basic I2C Bus Setup SDA SCL MASTER SLAVE 1 SLAVE 2 5V Pull-up Resistors SDA SCL

i2C Commands in PIC-C Master Only Slave Only Master & Slave I2c_start() I2c_stop() Slave Only I2c_isr_state() Master & Slave I2c_read() I2c_write()

Sending 1 Byte to Slave MASTER SLAVE I2c_start() I2c_write(slave addr | 0) I2c_write(registerAddress) I2c_write(value) I2c_stop() Address Content 1 2 3 4 5 6 7

Reading 2 bytes from slave MASTER SLAVE I2c_start() I2c_write(slave addr | 0) I2c_write(registerAddress) I2c_write(slave addr | 1) Value1 = I2c_read() Value2 = I2c_read(0) I2c_stop() Address Content 1 2 3 4 5 6 7

Controlling the Display Module Show 16 Bit Number 0xB0 0x02 Number Hi Number Low (Slave Address) (Register Address) Clear Screen 0xB0 0x06 (Slave Address) (Register Address)

Example Program // i2c1 - Master #use i2c(MASTER, I2C1) // Show the number 100 on the screen I2c_start(); I2c_write(0xB0 | 0); // display module address I2c_write(2); // show number command I2c_write(0); I2c_wirte(100); I2c_stop();