Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

PIC Parallel Communication

Status
Not open for further replies.
Hi,

Yes, you can connect the data lines from ADC to FTDI... just read both datasheets on timing.

A simple pld could do the job.


********
FT2232H: Last week we did some tests.
With FPGA to a Linux PC we achieved about 11MBytes/s. With dual 245 FIFO mode, traffic only on one channel in one direction.

Using 4kbytes blocks with echoing through FPGA (traffic from PC via FTDI and back on the same channel) we achieved a bit more than 4Mbytes/s.

Just as first test without any optimisations. FPGA was clocked with about 100MHz.

Klaus
 
Ok but in this way how can i send a command from PC to the microcontroller..?
 

Hi,

If you use the single channel FT245, then you need to think about a protocol how to share the single port for two endpoints.
Although somehow unusual, but fore sure possible. And for sure this is a way for throughput optimization.

Klaus
 
With the UM232H at CPU style FIFO configuration, can i send commands to the microcontroller and read data from microcontroller..?
 

Hi,

Yes, but you need to decide how. You will need additional hardware and a timing/prtocol o how to handle data transfer.

But it is more difficult than with a two channel system like the FT2232H.

Klaus
 

What do you mean..? Tha i can have only 1 way communication at the same time? So i must send the command from PC to microcontroller and from the firmware side i must wait for PC command, execute it and then wait again..?
 

Hi,

With a single channel system you obviously can not communicate three devices the sane time

PC side is fix, no problem.
But you need to switch between microcontroller and ADC.

Best way is that the controller decides what to do. For sure the PC also needs to know where the data come from.
Therefore you need some communication between controller and PC.

Maybe the controller sends to the PC that the coming 512 bytes are from ADC.
After the PC aknowledges, the controller switches databus ADC to FTDI, starts 512 conversions and manages the control lines.

Since the FTDI has an RXF flag, indicating that the PC sent data, you can use this to stop sampling intermediately.

Klaus
 
Thanks for your time, i have decide to do the following connection ADC <-> dsPIC30F4013 <-> FT232H. My controller has lot's of I/O pins so there is no problem to connect ADC directly to a controller port and another port to the FTDI. So the main controller's firmware logic will be: Initialize (PIC and ADC) -> wait command from PC (e.g sampling ADC data for 10 sec) -> execute the command and fetch data to the PC and loop again. From software side i will create a C#.net application (FTDI has a .NET wrapper ready) to handle the data coming from the controller and send the appropriate commands.

Is this idea correct..?
 

Hi,

It seems correct to me.

But then all ADC data must be read by the controller, and then written to the FTDI? This may slow down communication.

Klaus
 
I'll check this out and i'll inform..!!
 

Hi again, with a 2 or more channel chip (like FT2232H or FT4232H) how can you set what channel will be active to the usb at a time..? E.g one channel is used to get the sample data from PIC to PC and from the other channel i want to send a command to PIC. How the command will be inserted into the USB bus as the other channel uses it..?
 

Hi,

Hi again, with a 2 or more channel chip (like FT2232H or FT4232H) how can you set what channel will be active to the usb at a time..? E.g one channel is used to get the sample data from PIC to PC and from the other channel i want to send a command to PIC. How the command will be inserted into the USB bus as the other channel uses it..?

it´s not clear what you mean..
1) the communication between periferal and FTDI chip:
--> The FT2232H chip has two channles with independent control- and datalines each (in dual 245 mode). Using the lines of channel one transmits via channel one.. the same is for the second.

2) the communication on the USB bus lines:
--> The FT2232H is a single chip and afaik it uses three interfaces. One control and two data communication interfaces. If you need more detailed information read:
www.ftdichip.com support->documents..

3) communication port on the PC side:
it depends on OS and what driver you use.
COM-Port: You can define a dedicated COM port number on each channel.
If you need more detailed information read: www.ftdichip.com support->documents..

Klaus
 
Thanks a lot for your time,
I prefer to use the D2XX driver directly, not a COM port. So within the D2XX library can i chose to with channel i want to write? Let's say that on channel A i have the sampled data from microcontroller's ADC (in SPI or FT1248 mode) and on channel B i have the command interface (in 9600 baud RS232 mode, that doesn't need to be so fast). So from PC i send a command to microcontroller through channel B and the sampling data are start coming from Channel A. While channel A is transmitting the data from the controller to PC, anytime i want i can send a stop command through channel B to the micontroller to stop the sampling. So i must set an interrupt on microcontroller's firmware to UART, read the command an do what the command says..?
 

Hi,

So within the D2XX library can i chose to with channel i want to write?
For sure, otherwise it makes no sense....

And YES about your question about "command" and "data" channel. That´s how we work today. We work both channels in 245 mode.
I´m the hardware man, my software guy works with drivers for LINUX on the PC side.

Klaus
 

And you achieved 11 MByte/s as you told me with no data errors..?
 

Hi,

Yes, with no data errors.
I think USB protocol (or FTDI protocol) includes error handling. I´m not sure.

Klaus
 

With witch driver..? With D2XX or the VCP..? I am interfacing it from C#.net, what's your interface..? Maybe the driver interface plays a role on speed. You said that you are using FT2232H in parallel FIFO for both channels, right..? Witch exactly FIFO interface from datasheet?
 

Hi,

LINUX driver.

But read at ftdichip.com. They say with d2xx drivers are more than 10MBytes/s possible.

Klaus
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top