AN2352 PDF даташит

Спецификация AN2352 изготовлена ​​​​«Cypress» и имеет функцию, называемую «I2C USB Bridge Usage».

Детали детали

Номер произв AN2352
Описание I2C USB Bridge Usage
Производители Cypress
логотип Cypress логотип 

8 Pages

No Preview Available !

AN2352 Даташит, Описание, Даташиты
Application Note
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
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.
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
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
Revision **

No Preview Available !

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
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
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 {
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:
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
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.
Revision **

No Preview Available !

AN2352 Даташит, Описание, Даташиты
Figure 2. Example of Erroneous Transmission of WORD-Type Variable
Step 1. I2 C Sends MSB Byte of WORD
Current buffer index
of I2C interrupt
I2C Sends 00 h
00 FF
This is MSB Byte
of WORD Value
WORD type variable into I2C buffer
Step 2. Program Updates I2C Buffer
WORD Value Changed by 1
Current buffer index
of I2C interrupt
01 00
WORD type variable into I2C buffer
Step 3. I2 C Sends LSB Byte of WORD
Current buffer index
of I2C interrupt
01 00
I2C Sends 00 h
This is LSB Byte
of WORD Value
WORD type variable into I2C buffer
Revision **

Скачать PDF:

[ AN2352.PDF Даташит ]

Номер в каталогеОписаниеПроизводители
AN2352I2C USB Bridge UsageCypress
AN2356Graphics LibraryCypress

Номер в каталоге Описание Производители

100 мА, регулируемый прецизионный шунтирующий регулятор

Unisonic Technologies
Unisonic Technologies

8 А, 500 В, N-канальный МОП-транзистор


Линейный стабилизатор напряжения, 1,5 А

STMicroelectronics    |    2020    |

  Контакты    |    Поиск