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 - dania

Pages: [1]
1
Hello,

Code: [Select]
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
/* OS specific libraries */
#ifdef _WIN32
#include<windows.h>
#endif

/* Include D2XX header*/
#include "ftd2xx.h"

/* Include libMPSSE header */
#include "libMPSSE_spi.h"

uint8 wr_buffer[128];
uint8 rd_buffer[128];
uint32 preneseno = 0;

int main()
{
FT_HANDLE handle = NULL;
FT_STATUS status = FT_OK;
FT_DEVICE_LIST_INFO_NODE devList = {0};
ChannelConfig channelConf = {0};
uint32 channels = 0;
uint8 i = 0;

channelConf.ClockRate = 800000;
channelConf.LatencyTimer = 1;
channelConf.configOptions = 0x0020;
channelConf.Pin = 0xFEFBFEFB;

/* init library */
#ifdef _MSC_VER
Init_libMPSSE();
#endif
status = SPI_GetNumChannels(&channels);
if (status != FT_OK) {
printf("status != FT_OK");
return 0;
}
printf("Number of available SPI channels = %d\n",(int)channels);

if (channels > 0)
{
for (i = 0;i < channels;i++)
{
status = SPI_GetChannelInfo(i, &devList);
if (status != FT_OK) {
printf("status != FT_OK");
return 0;
}
if (strcmp("Mila 5000 B", devList.Description) == 0) {
//device is connected
status = SPI_OpenChannel(i, &handle);
if(status != FT_OK) {
printf("status != FT_OK");
return 0;
}
break;
}
}
}
if (handle == NULL) {
printf("not opened");
return 0;
}
status = SPI_InitChannel(handle, &channelConf);
if (status != FT_OK) {
printf("status != FT_OK");
return 0;
}

while (1)
{
//write nasledovane read
wr_buffer[0] = 0x90;
status = SPI_Write(handle, wr_buffer, 1, &preneseno, 0x02);
if (status != FT_OK) {
printf("status != FT_OK");
return 0;
}
status = SPI_Read(handle, rd_buffer, 1, &preneseno, 0x06);

//readwrite
wr_buffer[0] = 0x90;
wr_buffer[1] = 0xFF;
status = SPI_ReadWrite(handle, rd_buffer, wr_buffer, 2, &preneseno, 0x06);
}

return 0;
}


SPI_ReadWrite sends unexpected 0xCC, 0xCC and reads data from SPI slave correctly. Then, even on the second call, SPI_Write sends 0xCC. I think there is a problem in LibMPSSE. How fix it?


2
Discussion - Hardware / FT4232H MPSSE GPIOL1 Wait or Stop CLK - how use it?
« on: February 23, 2022, 01:12:26 PM »
Hello,
in Application Note AN_135 I see in table 2.2 on page 6 Wait or Stop CLK capability. How connect it with microcontroller? How configure MPSSE for it?

Best Regards

3
Hello,

i have connected two devices to PC:
1. SIGMA 2 by ASIX (www.asix.cz), is "black box" for me
2. FT4232H with virtual COMs disabled, DE signal is enabled at Channel C and device name is changed to "Mila 5000". VID and PID are default. Channel A is used as I2C, Channel B is used as SPI and Channel C is used as RS485.

Operating System is Windows 10, Visual Studio 2022, FTD2XX_NET and LibMPSSE are used. Software is developed in C#.

Issue: Channel B have invalid handle (handle value is 0) after SPI_OpenChannel call. Return value of SPI_OpenChannel is FT_OK.
Note: If FT4232H is connected only (OMEGA 2 is disconnected), handle have correct value. When I connect OMEGA 2 only after openning FT4232H, bozh devices work properly.
 

4
Discussion - Software / FT4232H I2C Library recommendations
« on: August 02, 2021, 08:42:19 AM »
Hello,
for I2C are two libraryes: FTCI2C.dll and LibMPSSE.dll. Which library do you recommend? I didn't find how to work with GPIOL lines in libmpsse.

I2C and GPIOs at Port A:
ADBUS0 = SCL, ADBUS1 and ADBUS2 wired together = SDA, ADBUS4 - ADBUS6 = inputs, ADBUS7 = output (drive relay via transistor)

5
Hello,

time between end of transmit and disasserting SS is several miliseconds. It's possible to shorten it?

Pages: [1]