High speed clock rate of I2C for FX2LP

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
frank
Level 2
Level 2
10 replies posted 10 sign-ins 5 replies posted

Have any chance to set the clock rate to 10MHZ for FX2LP?

Use GPIF or any other method ?

Or how can operate the IO in high speed toggle For FX2LP

 

0 Likes
1 Solution
Pranava_YN
Moderator
Moderator
Moderator
100 likes received 500 replies posted 250 solutions authored

Hi,

FX2LP GPIO can be manually toggled at a maximum frequency of 4MHz when CPU is running at 48MHz. How to do it? 

>> You can repeatedly toggle bit corresponding to respective GPIO in "IOx" register. As a register write in FX2LP takes 12 clock cycle and CPU is running at 48MHz, so at max you can toggle GPIO at 250ns interval.

We have bitbanging implementation of SPI (https://www.cypress.com/file/125791/download#:~:text=Both%20FX2LP%20UARTs%20have%20a,UART0%20as%20an....) not I2C but you can definitely not do it at 10MHz using this approach.

We do not have I2C sample implementation using GPIF. 

Best regards,
Pranava

View solution in original post

0 Likes
10 Replies
Pranava_YN
Moderator
Moderator
Moderator
100 likes received 500 replies posted 250 solutions authored

Hi,

CPU in FX2LP can run at 12, 24 or 48MHz. There is no way to run it at 10MHz. However the GPIF/ Slave FIFO can be made to run at 5 - 48MHz but inputting corresponding clock through IFCLK pin.

FX2LP GPIO can be manually toggled at a maximum frequency of 4MHz when CPU is running at 48MHz.

Can you please elaborate on your exact requirement so that I can help you better?

Best regards,
Pranava
0 Likes

 

  I have a customize device, it can operate the max clock frequency 10mhz at I2C protocol.

   The build-in I2C in FX2 just support 400KHZ.

    May I have any change to use GPIF or GPIO to make a faster I2C to control my component? 

0 Likes
frank
Level 2
Level 2
10 replies posted 10 sign-ins 5 replies posted

Hi :

    I have a customize device, it can operate the max clock frequency 10mhz at I2C protocol.

   The build-in I2C in FX2 just support 400KHZ.

    May I have any change to use GPIF or GPIO to make a faster I2C to control my component? 

 

0 Likes
frank
Level 2
Level 2
10 replies posted 10 sign-ins 5 replies posted

FX2LP GPIO can be manually toggled at a maximum frequency of 4MHz when CPU is running at 48MHz.

How to do it? 

Have any sample code for this high speed GPIO to implement high speed I2C protocol?

0 Likes
Pranava_YN
Moderator
Moderator
Moderator
100 likes received 500 replies posted 250 solutions authored

Hi,

FX2LP GPIO can be manually toggled at a maximum frequency of 4MHz when CPU is running at 48MHz. How to do it? 

>> You can repeatedly toggle bit corresponding to respective GPIO in "IOx" register. As a register write in FX2LP takes 12 clock cycle and CPU is running at 48MHz, so at max you can toggle GPIO at 250ns interval.

We have bitbanging implementation of SPI (https://www.cypress.com/file/125791/download#:~:text=Both%20FX2LP%20UARTs%20have%20a,UART0%20as%20an....) not I2C but you can definitely not do it at 10MHz using this approach.

We do not have I2C sample implementation using GPIF. 

Best regards,
Pranava
0 Likes

Hi ,

I test the first GPIO

I got toggle GPIO at 250ns interval,it's right.

But I try the bitbanging methode, it's around 3MHZ (around 165ns ~ 170ns), how can I speed up to reach your mention 4MHZ?

thx..

0 Likes
Pranava_YN
Moderator
Moderator
Moderator
100 likes received 500 replies posted 250 solutions authored

Hi,  

250ns toggling is the ideal scenario where there is no conditional/ looping overheads. If you add some other code along with writing to IOx registers it would add some extra delay.

I would like to correct myself, 250ns toggling would result in clock pulse of 2MHz instead of 4MHz as I mentioned earlier. Apologies for the mistake.

Is short, Maximum speed of GPIO (Only IOx register writes and no other code) is approx 2MHz. There will definitely some overhead code that reduces it even further.

Best regards,
Pranava
0 Likes

Hi,

     The GPIO is approx 2MHZ, I will implement the I2C in it.

     Another method is 8051 UARTs, it seems more faster to 12MHZ

     But the I2C protocol need to check for ACK, the 8051 UART use the Buffer send out data, not use IO. Is any possible to implement the I2C protocol to use 8051 UART to speed up the clock rate?

0 Likes
Pranava_YN
Moderator
Moderator
Moderator
100 likes received 500 replies posted 250 solutions authored

Hi,

UART and I2C protocols implementations are fairly different, therefore it would be difficult to implement I2C protocols using UART commands. We currently do not have any such implementation readily available

Best regards,
Pranava
0 Likes

Hi,

    SPI master for Serial Port Mode 0, RxD0OUT / MOSI   PORTE.3

    I want to know where to set the related between PORTE.3  and RxD0OUT.

    void SPIByteWriteU (BYTE d)
{
TI = FALSE; //Clear flag
SBUF0 = swap1[d]; //Write byte
while (!TI); //Wait until transmit done
}

Why SBUF0 can send out data through PORTE.3 ?

 

If I want to use serial Port1 the SNUF1 will send out the data through which pin?

0 Likes