FTDI Community

Please login or register.

Login with username, password and session length.
Advanced Search  

News:

Welcome to the FTDI Community!

Please read our Welcome Note

Technical Support enquires
please contact the team
@ FTDI Support


New Bridgetek Community is now open

Please note that we have created the Bridgetek Community to discuss all Bridgetek products e.g. EVE, MCU.

Please follow this link and create a new user account to get started.

Bridgetek Community

Show Posts

You can view here all posts made by this member. Note that you can only see posts made in areas to which you currently have access.

Topics - Flo80

Pages: [1]
1
Discussion - Software / Different writing speeds
« on: February 04, 2019, 11:31:46 AM »
Hi,
I am using FT2232H mini module to write to a N25P256MB memory with an application in C on Windows 10 Professional x64 operation system. I use libMPSEE library v 1.0.0.1, 2014 and FTDI D2XX driver (version 2.12.28) downloaded from https://www.ftdichip.com/Drivers/D2XX.htm.  My problem is that I obtained different speeds for writing data in that memory. For example, for write consecutive pages (256 bytes) with “SPI_Write” function, it  took  16 ms or 60 ms in the same execution of program.

This are the parameters that I used for “SPI_InitChannel” function:
channelConf.ClockRate = 30000000; // 30 MHz;
channelConf.LatencyTimer = 2; //2ms
channelConf.configOptions = SPI_CONFIG_OPTION_MODE0 | SPI_CONFIG_OPTION_CS_DBUS3 | SPI_CONFIG_OPTION_CS_ACTIVELOW;
channelConf.Pin = 0x00000000;

This are the functions that I used to write a page (256 bytes) on memory

   // SET WRITE ENABLE
   sizeToTransfer = 1;
   sizeTransfered = 0;
   buffer[0] = 0x06;   /// WRITE ENABLE   
   status = SPI_Write(ftHandle, buffer, sizeToTransfer, &sizeTransfered,
      SPI_TRANSFER_OPTIONS_SIZE_IN_BYTES |
      SPI_TRANSFER_OPTIONS_CHIPSELECT_ENABLE |
      SPI_TRANSFER_OPTIONS_CHIPSELECT_DISABLE);
       // WRITE DATA
   sizeToTransfer = 261;
   sizeTransfered = 0;
   buffer[0] = 0x02;   /// WRITE COMMAND
   //buffer[0] = 0x12;   /// WRITE COMMAND
   buffer[1] = ((address & 0xff000000) >> 24) & 0x000000ff;
   buffer[2] = ((address & 0x00ff0000) >> 16) & 0x000000ff;
   buffer[3] = ((address & 0x0000ff00) >> 8) & 0x000000ff;
   buffer[4] = (uint8)address;
   status = SPI_Write(ftHandle, buffer, sizeToTransfer, &sizeTransfered,
         SPI_TRANSFER_OPTIONS_SIZE_IN_BYTES |
         SPI_TRANSFER_OPTIONS_CHIPSELECT_ENABLE |
         SPI_TRANSFER_OPTIONS_CHIPSELECT_DISABLE);

Any suggestion on what the problem could be or how to resolve this?

Pages: [1]