This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Understanding data transfer between MSP430 and PC via the FT2232D (USB IC)

Other Parts Discussed in Thread: MSP430F1232
Hi,

I would be very grateful if someone could clarify my doubts.

My work : The goal is to send four sets(12 bits each) ADC sampled data(A0, A1, A2, A3) to the PC.

The process : 4 voltage values  ---> MSP430 ---> FT2232D ---> PC

Current status : MCU GPIO pins are connected to the FT2232D chip.

My doubts:

1) Where do i store the ADC(12 bit) values before i send them to PC ?

2) How will data transfer between MCU and FT2232D takeplace ?
By "How" i mean whether, bit bang or SPI.

here's my schematic.

My MCU pin connections.
8306.MSP430_Pin_connections.xls

Thanks in advance

best wishes
janmay
  • This question is rather outside the scope of this forum. However...

    The FTDI usually acts as USB<->seerial bridge. So it simulates an UART on its I/O pins. In this scenario, you just send your data in 8 bit chunks (low-byte/high-byte of each sign-extended 12 bit conversion result, or packed or whatever) out to the FTDI through an UART, and the FTDI packs the incoming data, pushes it through USB to the PC where the PC driver will unpack it and present it to the target software as if it had arrived on a COM port.

    That's the usualy way. The USB FETs (including the ones on the experimenters boards) work this way (just that they use a TUSB instead of the FTDI).

    However, you may be able to reprogram the FTDI to do whatever you want, so it features SPI or I2C instead of an UART. I don't have experience with this chip, so I cannot help you with that.

    But your wiring, as shown, looks faulty.

    You have UCA0 and UCA1 SOMI/SIMO connected, which are SPI inputs/outputs, but with same direction (SOMI and SIMO must have opposite directions!) and there is no SPI clock signal, nor is there any chip select signal. And UCB1STE only makes sense if UCB1 is used for SPI in slave mode or in multi-master mode. And it goes in the wrong direction too.

  • For full details of how the FTDI chip works, and its capabilities, see the manufacturer's website: http://www.ftdichip.com/

     

  • Dear Sir,

    Thanks for your reply. 
    
    
    Jens-Michael Gross said:
    But your wiring, as shown, looks faulty.
    
    
    The whole setup is on a PCB, its very difficult for me to change things right now.
    
    
    Is there any way by which i can send data with just GPIO pins (that was my goal) that are 
    connected to the FT2232D right now ??
    
    
    
    
    best wishes
    janmay


  • Dear Sir,
    
    
    Andy Neil said:
    the manufacturer's website: http://www.ftdichip.com/


    Thanks for the link. I have gone through FTDI's site. But there are somethings that i dont get.

    1) They have given sample codes based on platforms (C++, C#, visual basic...etc) 

    what is the meaning of this??.

    2)Is it possible to send data only via GPIO pins, the ones which i have 

    connected to the FT2232D chip??.


    best wishes
    janmay

  • janmay b c said:
    Is it possible to send data only via GPIO pins, the ones which i have connected to the FT2232D chip??.


    Yes. In case of an UART it is difficult because of the timing. The existing implementations of a software UART use teh CCR0/CCR1 units of a timer, which also have dedicated pins. An implementation that uses a plain GPIO pin under software control, might be difficult to implement (because of the timing requirements).

    When using a synchronous protocol like I2C and SPI, and the MSP is the master, then timing requirements are relaxed and it is easy to implement. In fact, I implemented both, software I2C and software SPI, on a MSP430F1232 processor several years ago.

    The important thing is to know what kind of protocol the FTDI requires on its pins, especially if something has to be sent from the FTDI to the MSP (incoming data).

    I didn't look at the examples, but my guessing is that these are examples for the PC side, that access the serial device attached to the FTDI chip through a virtual serial (COM) port. C# and VB won't make much sense on any microcontroller :)

  • Dear Sir,

    Thanks for the reply. I do not have any choice other than to use the GPIO pins to transfer data.

    You are right, on the FTDI site they have platform (C++, C#, VB) specific examples.

    I am still confused about its working, but guess i have to read more :-)

    best wishes

    janmay

  • janmay b c said:
    1) They have given sample codes based on platforms (C++, C#, visual basic...etc) 

    what is the meaning of this??.

    Those are examples for the PC side.

    janmay b c said:

    2)Is it possible to send data only via GPIO pins, the ones which i have 

    connected to the FT2232D chip??.

    Some of the FTDI chips have a parallel interface mode - check the datasheet for details.

    Here's an example: http://www.antronics.co.uk/usbmod2/ - it uses an FT245.

    Alternatively, you might be able to make use of the modem control signals - RTS, CTS, DTR, etc,...

  • Andy Neil said:

    Some of the FTDI chips have a parallel interface mode - check the datasheet for details.

    Here's an example: http://www.antronics.co.uk/usbmod2/ - it uses an FT245.

    Alternatively, you might be able to make use of the modem control signals - RTS, CTS, DTR, etc,...

     Hi Andy, I hope you know FT2232D, is the serial parallel interface used on Luminary JTAG and in some interface like BUS PIRATE.

     I again hope our friend has bounced too many wall and need to learn how to build right thing than try search for impossible help.. Too many fault cannot be made working. Quality is the first thing and bad software and or hardware has to be thrashed away without fear. Track must be cut and rewiring need take place. Why not take half an hour to rewire than spend a mount to try an impossible version?

     Regards

  • Dear sir,

    Roberto Romano said:
    Why not take half an hour to rewire than spend a mount to try an impossible version?

    Very much true sir.

    Sir, I do not want to irritate you with my constatnt questioning :-).

    But i went back and read my schematics, and here are my connections

    MSP FTDI

    UCA1SOMI / UCA1RXD ----> BDBUS0

    UCA1SIMO / UCA1TXD ----> BDBUS1

    UCBISTE / UCA1CLK ----> BDBUS5


    So, hopefully this means i can send data by SPI to the FTDI chip, phew... :-)
    
    
    
    
    best wishes
    janmay

  • janmay b c said:
    i went back and read my schematics, and here are my connections

    MSP FTDI

    UCA1SOMI / UCA1RXD ----> BDBUS0

    UCA1SIMO / UCA1TXD ----> BDBUS1

    UCBISTE / UCA1CLK ----> BDBUS5


    So, hopefully this means i can send data by SPI to the FTDI chip

    That shows that the FTDI chip is connected to the MSP's UART pins - doesn't ot?

    So by far the simplest way to use it would be as a UART!

  •  Dear Janmay, my final opinion is to throw away pcb and whatever is bad... If AND ONLY IF analog part is ok, a good solution can be:

     Remove the buffer between uP and AD9534, this can also free up also some pin to communicate with cpu if critical pin cannot be accessed.

     Buy an MSP board with 5xxx series and USB on chip, wire up from header to old board spi signal and few single port FSYNK to avoid jiitter and phase error.

     Other than a securely working board, all example and support limited to what feasible and not solve all stuff can come from this site.

     If analog measurement has to be done PC connection is a too big source of noise so better to use an on board display, store data on flash then transmit to pc. All professional instrument have digital part isolated from analog to prevent ground loop and noise....
     Have a best knowledge of thing and how to solve problem.

     Admitting that no more error exist on base board this can be a good solution to partially save what is made before now.

     Otherwise good luck, we cannot solve for free what is wrong and also if payd I think rewiring is the only way to made thing work.

     Please grasp this or loose your time forever.

     Regards

  • Dear Sir,

    Roberto Romano said:

     Remove the buffer between uP and AD9534, this can also free up also some pin to communicate with cpu if critical pin cannot be accessed.

     Buy an MSP board with 5xxx series and USB on chip, wire up from header to old board spi signal and few single port FSYNK to avoid jiitter and phase error.

    Yes sir, point taken. The work on the new PCB is underway :-)

    best wishes

    janmay

**Attention** This is a public forum