Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > USB Controllers > Is this possible, and what is the best way to go about it? USB <-> I2C

Bookmark and Share
Cypress Developer CommunityTM
Forums | Videos | Blogs | Training | Rewards Program | Community Components



Is this possible, and what is the best way to go about it? USB <-> I2C
Moderator:
RSKV

Post Reply
Follow this topic



Is this possible, and what is the best way to go about it? USB <-> I2C

NVergunst posted on 11 Jul 2012 4:52 AM PST
Member
4 Forum Posts

Hello,

Upfront, I have never worked with the Cypress parts (or ARM with an RTOS) but have lots of "regular" FPGA and MCU (PICs) experience. So I should be able to follow your advice, but currently I just don't know where to start or look to begin with to get me going. Or even if this is possible.

My current hardware is the FX3 USB Developement Kit. I don't specifically need USB 3.0, but I do need high-speed 2.0 instead of the fullspeed 2.0 my project currently has.

The first part of my need is a USB to I2C translator. I need to send a bulk transfer to the device, decode these bytes, and wiggle the I2C line. Then when things are received by the I2C line, re-encode, and send back through another bulk transfer endpoint. The second need is to monitor all edges of the I2C and decode all I2C traffic independently. Currently I have all this working and implemented in a standard PIC32 overclocked (120MHz/120MIPS). So I am hoping with the regular 200Mhz/200MIPS I can get something similar working even if the speed improvement is minimal. I am essentially maxed out with the PIC, hence the move.

So architecturally, does this even work? Can I use the built in MCU to write my firmware? I would suspect so. How much slower is slower when the MCU interprets every USB data transfer? Using the standard stream demo I can get 8MB per second. Is the interrupt overhead large? On the PIC it is 12, so interrupting on every rising and falling edge of an IO pin was expensive, but doable. I am hoping to cut that down, but am unfamiliar with the interrupt scheme used, or if that is even required. If I can poll the signal fast enough, that should be OK (400KHz maximum).

Or should I just be using the part as a passthrough and routing the packets to some large parallel bus and then another FPGA later in the stream? If possible, keeping it on one chip would be nice especially given the cost.




Re: Is this possible, and what is the best way to go about it? USB <-> I2C

Bob Marlowe posted on 11 Jul 2012 08:47 AM PST
Top Contributor
1466 Forum Posts

Am I understanding that correctly? You intend to analyze/check every single dataBIT of the I2C transmition? or are you refering to every single transmitted BYTE?? Will you please explain a bit more if you may???

 

Bob



Re: Is this possible, and what is the best way to go about it? USB <-> I2C

aasi posted on 13 Jul 2012 02:58 AM PST
Cypress Employee
1073 Forum Posts

I assume you'll be following I2C protocol i.e. you're monitoring each of the I2C lines in your previous design because you don't have a dedicated hardware I2C.

In the case of FX3/FX2LP there is a hardware I2C. So you don't have to decode the I2C traffic, the data part will be available in a buffer. Will this work or any specific reason you want to monitor each pulse?

Regards,

Anand



Re: Is this possible, and what is the best way to go about it? USB <-> I2C

NVergunst posted on 09 Aug 2012 12:29 PM PST
Member
4 Forum Posts

I have to monitor every bit transition on SDA and SCL to decode I2C /SMBus/PMBus. My current solution has a hardware I2C peripheral and I use it for outbound data. But the other point is to just sit idle on the bus and see the data. Meaning it cannot ACK anything and it must listen to all addresses and all data. I have not seen an I2C library peripheral that meant for passive looking, they all require an address range that they deem theirs and then AC K when they see it. This is exactly what I do not want it to do.






ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.