Docsity

Inter Integrated Circuit Communications-Microcomputers-Lecture 10 Slides-Electrical and Computer Engineering, Slides of Microcomputers

Toggle sidebar
bg1
1
Microcomputers
Inter-Integrated Circuit (I2C)
Communications
Communications
1
I2C Serial Interfaces
•
I
2
C is asynchronous serial interface on the PIC24
•
I
C
is
asynchronous
serial
interface
on
the
PIC24
µC
•Commonly used in industry
•The I2C port requires only two wires regardless of
the number of peripherals, is half-duplex, and top
speed is 1
MHz
speed
is
1
MHz
.
•Best if you are trying to reduce external pin usage.
2
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download Inter Integrated Circuit Communications-Microcomputers-Lecture 10 Slides-Electrical and Computer Engineering and more Slides Microcomputers in PDF only on Docsity!

Microcomputers

Inter-Integrated Circuit (I2C) CommunicationsCommunications

1

I 2 C Serial Interfaces

  • • II C is asynchronous serial interface on the PIC24 2 C is asynchronous serial interface on the PIC μC
  • Commonly used in industry
  • The I 2 C port requires only two wires regardless of the number of peripherals, is half-duplex, and top speed is 1 MHzspeed is 1 MHz. - Best if you are trying to reduce external pin usage.

2

Bus Definition

When a device on a bus talks, all hear what isall hear what is said.

An address is used to specify what device the communication is intended for.

Copyright Delmar Cengage Learning 2008. All Rights Reserved. From: Reese/Bruce/Jones, “Microcontrollers: From Assembly to C with the PIC24 Family”.

3

Inter-Integrated Circuit (I^2 C) Bus

Copyright Delmar Cengage Learning 2008. All Rights Reserved. From: Reese/Bruce/Jones, “Microcontrollers: From Assembly to C with the PIC24 Family”.

4

Support Functions – I 2 C Operations

These are primitive operations.

7

Support Functions – I 2 C Transactions

These are use the primitive operations to read/write 1 or more bytes to a slave.

8

I 2 C Read/Write Transactions

9

Example primitive function

10

24LC515 I 2 C Address Format, Write Operation

Most efficient to write 64 bytes at a time as write takes 3 – 5 ms to complete.p

Poll device to see when the write is finished.

13

24LC515 I 2 C Read Operation

We will do this to read the device, and always will read 64 bytes at a time. 14

Support Functions

Poll device to see when the write is finished.

Write 64 bytes in **** pu_bufb f** tto device

15

Support Functions

Read 64 bytes from device, return in *pu_buf

16

What do you have to know?

  • I2C Bus operation
  • I2C primitive function operation and usage
  • I2C Transaction function operation and usageI2C Transaction function operation and usage
  • 24LC515 EEPROM Operation

19