datasheet4u.com

900,000+ datasheet pdf search and download

Datasheet4U offers most rated semiconductors data sheet pdf




Cypress Semiconductor Electronic Components Datasheet

AN2352 Datasheet

I2C USB Bridge Usage

No Preview Available !

AN2352 pdf
www.DataSheet4U.com
Application Note
AN2352
I2C-USB Bridge Usage
Author: Valeriy Kyrynyuk
Associated Project: Yes
Associated Part Family: CY8C24894
Software Version: PSoC Designer™ v. 4.3
Associated Application Notes and Kits: AN2304,
CY3240-I2USB, CY3242-IOX >> Available in Cypress Online Store
Abstract
This Application Note, which is included in the CY3240-I2USB kit available in the Cypress Online Store, details several
examples using the I2C-USB bridge design. It is also a supplement to the I2C-USB Bridge Quick Start Guide reference [2] at
the end of this document, also available in CY3240-I2USB. The Application Note contains details about implementing an I2C
interface into existing projects and using I2C communication to test, debug and tune device designs.
Introduction
The normal capabilities of a PC can be well expanded
upon by using the new I2C-USB bridge and its supporting
software. A PC with I2C-USB bridge can be useful for
following tasks:
Debug existing projects (using I2C communication
instead of UART, for example).
Acquire and manipulate data from various I2C
devices, such as ADCs, DACs, IO expanders,
sensors with I2C interfaces, etc.
Program EEPROM, SRAM devices.
Train users and demonstrate I2C device capabilities.
This Application Note details the following examples of
bridge usage:
1. Monitoring CapSense CSR User Module operation.
2. Monitoring tachometer operation.
3. Working with a 20-pin IO port expander with
EEPROM.
4. Programming 24Cxxx serial EEPROM devices.
5. Working with a PSoC-based 3-channel potentiometer.
The simplest way to implement I2C into a PSoC project
and attach the device to the bridge will also be looked at
closely. This document does not describe the internal
structure and protocol of the bridge. For this information
refer to the I2C-USB Bridge Guide reference [1] at the end
of this document, also available in CY3240-I2USB. The
USB2IIC.exe program was used in all examples. Details of
this program are described in [2].
Attach Device to Bridge
Execute the following steps to connect the device to the
I2C-USB bridge:
1. Connect GND of the device to GND of the bridge.
2. Connect the SDA, SCL lines to the bridge (Figure 1).
Bridge has 2.2k pull-up resistors connected to +5V.
3. Power the device from the Vdd pin on the bridge if it
does not have its own power supply. Note that the
connection of Vdd between the bridge and target
board is REQUIRED, even if the board is self-
powered. The bridge can (optionally) provide 3.3V or
5V, or it can work with an externally powered board
using 2.4V to 5.6V.
4. Connect the bridge to USB.
5. Run USB2IIC.exe program from PC.
6. Select the bridge in the list at the bottom center of the
screen.
9/22/2006
Revision **
-1-


Cypress Semiconductor Electronic Components Datasheet

AN2352 Datasheet

I2C USB Bridge Usage

No Preview Available !

AN2352 pdf
www.DataSheet4U.com
AN2352
7. Click the List button in the USB2IIC.exe program.
The list of all connected I2C devices will appear. Note
that if the bridge is providing power, it is necessary to
turn the power on before the List button will work.
Now designers can work with all listed devices.
Figure 1. I2C-USB Bridge
Implement I2C Interface into PSoC
A tool that can continuously collect and display variable
values is very useful during debugging/testing PSoC-
based projects. Reading measurement results, pin states
and dynamic modification of device properties are tasks
commonly performed by designers. The UART User
Module is frequently used for such tasks. But such a
method contains several disadvantages:
The design requires one spare digital PSoC block for
half-duplex UART operation. (The I2C interface
hardware is independent of the digital blocks.)
Some computers, particularly notebooks, do not have
COM ports and communication capabilities for a
UART. A USB-UART bridge is needed.
The additional level-bridge, such as a MAX232, is
necessary on the designed board.
The bandwidth of an I2C-USB bridge is greater than
the bandwidth of a standard UART. The maximum
bandwidth for a UART is about 11 kB/s, but I2C-USB
bridge can attain a 25kB/s bandwidth.
Taking into account everything mentioned above, using an
I2C-USB bridge is more suitable and cheaper than other
solutions.
To implement the I2C slave interface into a PSoC project,
the following steps are required:
Place the EzI2Cs User Module in the PSoC project.
Set the following User Module Parameters:
o Slave_Addr to 1 (this address can be
almost anything, it is not restricted to 1)
o Address_Type to Static
o ROM_Registers, in most cases, to
Disable
o I2C Clock to 400 kHz Fast
o I2C Pins to P1[0]-P1[1] or P1[5]-P1[7]
Define the RAM buffer that will contain data required
for I2C transmission. Define the array or structure
whose address will be specified when the
SetRamBuffer function is called. For example:
struct I2C_Regs {
WORD wX1;
int iADC;
BYTE bStatus;
} MyI2C_Regs;
// Example I2C interface structure
// read/write value
// read only value
// read only value
Insert, into the initialization part of program, the
following two strings:
EzI2Cs_SetRamBuffer(cI2CREAD,cI2CWRITE,(BYTE
*)&MyI2C_Regs);
EzI2Cs_Start();
Set the arguments of EzI2Cs_SetRamBuffer function
to proper values. Length of data, which could be read,
is set by cI2CREAD argument and length of data,
which could be written, is set by cI2CWRITE. The
address of the I2C buffer is set by MyI2C_Regs, which
is the third argument.
Once the above steps are complete, there is no additional
code required to support I2C communication. The EzI2Cs
User Module works in the background with I2C interrupt
handlers.
The first byte received by I2C slave is the offset into the
buffer from where data will be read from or written to.
Default offset is 0. There is one aspect that should be
considered when working with the I2C buffer. If the size of
the variable going into the buffer is greater than 1 byte, a
special technique must be used. First, always disable the
interrupt before changing or reading this variable in the
program. Second, verify the permissibility of variable
access. To implement this, the program must analyze the
EzI2Cs bRAM_RWcntr variable. This variable points to
current transmission index of the I2C buffer. Without such
analysis, the situation depicted in Figure 2 can occur.
9/22/2006
Revision **
-2-


Part Number AN2352
Description I2C USB Bridge Usage
Maker Cypress
Total Page 8 Pages
PDF Download
AN2352 pdf
AN2352 Datasheet PDF
[partsNo] view html
View PDF for Mobile








Similar Datasheet

1 AN2352 I2C USB Bridge Usage Cypress
Cypress
AN2352 pdf
2 AN2356 Graphics Library Cypress
Cypress
AN2356 pdf





Part Number Start With

0    1    2    3    4    5    6    7    8    9    A    B    C    D    E    F    G    H    I    J    K    L    M    N    O    P    Q    R    S    T    U    V    W    X    Y    Z

Site map

Webmaste! click here

Contact us

Buy Components

Privacy Policy