Finite State Machine & PIC-C I2C Communication

Slides:



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

Common Customer Issue: I2C Cable Glitches
MSP430G2553 launchpad and MPU6050 Introduction
LOGO Lab Supervisor – Dr. WH Lau EE3271 Design Laboratory.
Engineer Training XL1200 Electronics. Engineer Training XL1200 Electronics Confidential 2 XL1200 Electronics The XL Jet Electronic System consists of.
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.
Serial Interfaces, Part Deux -I 2 C and SPI December 4, 2002 Presented by Eugene Ho.
Basic PIC-C I2C Communication and Controlling the 7-segment module Arnan (Roger) Sipitakiat Department of Computer Engineering, Chiang Mai University,
Lecture 8: Serial Interfaces
Introduction of Holtek HT-46 series MCU
Serial Communication Buses: I 2 C and SPI By Brody Dunn.
Interrupts What is an interrupt? What does an interrupt do to the “flow of control” Interrupts used to overlap computation & I/O – Examples would be console.
Introduction An interrupt is an event which informs the CPU that its service (action) is needed. Sources of interrupts: internal fault (e.g.. divide by.
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.
1 Arduino Board: Arduino UNO Arduino Programing Environment: Arduino 0022
Two Wire Interface Another popular serial peripheral interface bus -More flexible than SPI -Master and slave modes supported -7-bit slave address -400khz.
USB: UNIVERSAL SERIAL BUS Joe Kaewbaidhoon Alex Motalleb Vishal Joshi Prepared for EECS 373 University of Michigan, Ann Arbor 1.
ECE 353 Introduction to Microprocessor Systems Michael G. Morrow, P.E. Week 13.
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.
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.
PS2 Keyboard Interface Using Spartan-3 Starter Kit Board
Interfaces A practical approach. Lesson 2 I2C and SPI
1 EECS 373 Design of Microprocessor-Based Systems Prabal Dutta University of Michigan Lecture 10: Serial buses Oct 6, 2011.
2 Lines Electronics I 2 C Analyzer Ching-Yen Beh Robert S. Stookey Advisor: Dr. J. W. Bruce.
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.
Engineer Training Electronic System Overview. Engineer Training XL1500 Electronics Confidential 2 XLjet Electronics The XL1500 Electronic System consists.
LSU 10/22/2004Serial I/O1 Programming Unit, Lecture 5.
Embedded Bus – i2c David E. Culler Lab 2 Feb 2, 2015
Ballooning Bundle. What is a Microcontroller? Small computer with a processor core, memory and programmable input/output Continuously repeats software.
4.0 rtos implementation part II
ECE 493T9 Real Time Embedded System Tutorial Set 3 June 10, Spring 2008.
Basic PIC-C I2C Communication
EE 446 Project Assignment Top Design Sensor Components Pin Assignment and Configuration Completed Physical Setup Project Tasks.
Lecture 20: Communications Lecturers: Professor John Devlin Mr Robert Ross.
ECE 353 Introduction to Microprocessor Systems Michael Schulte Week 13.
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,
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.
Microprocessor based Design for Biomedical Applications MBE 3 – MDBA XI : Project Outlooks.
Embedded Network Interface (ENI). What is ENI? Embedded Network Interface Originally called DPO (Digital Product Option) card Printer without network.
ENTC-489 Embedded Real Time Software Development Embedded Real Time Software Development Week 4 Review.
Teachers Name : Suman Sarker Telecommunication Technology Subject Name : Microcontroller & Embedded System Subject Code : 6871 Semester : 7th Department.
©2008 R. Gupta, UCSD COSMOS Summer 2008 Peripheral Interfaces Rajesh K. Gupta Computer Science and Engineering University of California, San Diego.
APPLICATION OVER I2C Kıvanç ÖZBEK What is I2C? 2-wired communication interface Communication protocol used in small areas Defined in 1980’s.
S4525A Peripherals & Enhanced FLASH 1 © 1999 Microchip Technology Incorporated. All Rights Reserved. S4525A Peripherals & Enhanced FLASH 1 Peripherals.
Essentials of Communication This simple model requires many guarantees. Sender Receiver Communication Link Data.
Readout of Temperature Monitor with SEABAS ’11 10/12 Y. Takubo (KEK) 1.
Interrupt-Driven I/O There are different types of interrupts –Hardware Generated by the 8259 PIC – signals the CPU to suspend execution of the current.
INTERRUPTS. Topics to be discussed  8088/86 Hardware Interrupts pins 8088/86 Hardware Interrupts pins   Pin description Pin description.
Microcontroller basics Embedded systems for mortals.
Intel 8259A PIC EEE 365 [FALL 2014] LECTURE 21 ATANU K SAHA BRAC UNIVERSITY.
میکرو کنترلرهای AVR Serial Interfaces, I2C and SPI
1. PIC ADC  PIC18F877 has 8 analog input channels i.e. port A pins(RA0 to RA5) and port E pins(RE1 and RE2). These pins are used as Analog input pins.
CORDLESS MOUSE FEATURES BY TV REMOTE USING PIC MICROCONTROLLER
UNIT 24 I2C Test 로봇 SW 교육원 조용수.
Outline Analog to digital conversion (ADC) of NuMaker TRIO
Two Wire Interface Another popular serial peripheral interface bus
Chapter 11: Inter-Integrated Circuit (I2C) Interface
Basic PIC-C I2C Communication
8259A PRIORITY INTERRUPT CONTROLLER
Communication Lines Fundamentals.
مقدمة في الاردنيو د فضل الاكوع.
BJ Furman ME 106 Fundamentals of Mechatronics 15NOV2012
Keypad Source: under under
Keypad Source: under under
I/O Experiments Assignment 1.
Presentation transcript:

Finite State Machine & PIC-C I2C Communication

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()

Communication example MASTER SLAVE I2c_start() I2c_write(slave addr | 0) I2c_write(data) I2c_stop() i2c_read() Data = i2c_read() interrupt state = 0 interrupt state = 1

A slave->master read example I2c_start() I2c_write(slave addr | 0) I2c_write(command) I2c_write(slave addr | 1) Data1 = I2c_read() Data2 = I2c_read(0) I2c_stop() i2c_read() Cmd = i2c_read() I2c_read() I2c_write(data1) I2c_write(data2) interrupt state = 0 interrupt state = 1 No i2c_stop() interrupt state = 0x80 No Interrupt interrupt state = 0x81

Data flow and slave ISR state Data Transmission (Green = Slave -> Master) 0xB0 0x01 0xB1 0x11 0x22 Slave ISR State 1 0x80 0x81

Download examples via SVN from http://svn.e-cpe.org/svn/i2c

Finite State Machine

Finite State Machine 2

Dual-I2C PIC I2c 1 Serial I2c 2 Sensor 1 Sensor 2 (Software Based) GoGo Board I2c 1 (Software Based) Serial I2c 2 (Hardware Based)

Creating dual i2c ports // i2c1 - Master #use i2c(MASTER, SDA=PIN_B1, SCL=PIN_B2, stream=i2c_sensor) // i2c 2 - SLAVE #use i2c(SLAVE, SDA=PIN_C4, SCL=PIN_C3, address=0xB0, FORCE_HW, stream=i2c_gogo) // Example of use I2c_start(i2c_sensor); I2c_read(i2c_gogo); …