Shop OBEX P1 Docs P2 Docs Learn Events
P2 Fast connection P2 <--> PC — Parallax Forums

P2 Fast connection P2 <--> PC

Hello,
What are the possibilities to transfer large amounts of data from P2 to PC in a short time?
6...12...24 Mbyte/s
A fast USB connection does not yet exist for P2 <--> PC.
Thank you.

Comments

  • have a look at the FTDI portfolio, they have USB 2 <-> parallel bus converters and they should do something like 40MBytes/sec, their USB 3 chips can do even more

  • Yes FT2232H has a mode that I think can do two serial pipes, each 40 MB/s

  • jmgjmg Posts: 15,173
    edited 2021-10-31 22:39

    @pic18f2550 said:
    Hello,
    What are the possibilities to transfer large amounts of data from P2 to PC in a short time?
    6...12...24 Mbyte/s
    A fast USB connection does not yet exist for P2 <--> PC.

    As above, the FTDI are mainstream parts, but they are not simply clip-on devices at the top speeds.

    To hit the full claimed 40MBytes/sec one-way bursts, you need to deliver data sync to the FTDI 60MHz Clock out, derived from the 12MHz XTAL.

    Choices there would be to drive 12MHz from P2, to replace the Xtal, and live with the phase-delays inside FTDI, or drive P2 from the 60MHz out, an use P2 PLL to clock from that.
    That's likely to have less phase variance, but you need a PCB designed to sit the FTDI close to P2.

    A bit slower is FT1248 mode, but that is more like Wide SPI, so uses a slower clock, which the P2 can burst generate.

    FTDI app note on FT1248 says this
    " .... Interface options include: UART (up to 12MBaud), asynchronous FIFO (up to 8MByte/s), synchronous FIFO (up to 35MByte/s), MPSSE (up to 30Mbit/s), FT1248 up to 30Mbytes/s. ...

    The width of the FT1248 data bus may be configured as 1 bit, 2 bit, 4 bit or 8 bit wide.
    The external clock can be up to 30MHz. This provides a transfer rate of up to a maximum of 30Mbytes/s. "

    The 30MHz number sounds like it needs to be double sampled at 60MHz, so it may need to be < FTDI.60MHz/2

  • Parallel at P2 is not due to pinn deficiency. :)
    The FDI chips found only have 3M baud.
    Special Win drivers are also out of the question because it should also run under Linux.

    cat /dev/ttyACM0 > /var/data/raw

    The processing should then simply be done with a script.

    Or do you have a link to something faster?

  • jmgjmg Posts: 15,173

    @pic18f2550 said:
    Parallel at P2 is not due to pinn deficiency. :)

    Do you mean serial only ? That will always limit your speed.

    Serial only will not hit your 6...12...24 Mbyte/s spec, as that is needing 60MHz, 120MHz or 240MHz UART clocks
    Their Fast Serial mode (clocked UART) can clock to 50MHz, half-duplex, but includes a handshake phase, FWIR is it about 14 clocks per byte peak using 4 wires.

    The FDI chips found only have 3M baud.

    Not quite. All their HS-USB parts can do 12MBd (sustained duplex), and there is a HS-USB EXAR part XR22801 that can do 15MBd, (sustained duplex), but it's less mainstream.

    Special Win drivers are also out of the question because it should also run under Linux.

    cat /dev/ttyACM0 > /var/data/raw

    The processing should then simply be done with a script.

    I think the modes inside FT232H / FT2232H can all be run in VCP mode, so they look like a COM port.

    Or do you have a link to something faster?

    See https://ftdichip.com/product-category/products/ic/
    Anything with FT1248 can give you the highest and easiest interface.
    The FT2232H has larger buffers than FT232H, so that may be one reason to select the larger device.

  • jmgjmg Posts: 15,173

    Adding some more - an alternative approaches could be to make your own serial-bridge. These are sub $20

    See for example the new RaspberryPi Zero 2W, which has 4 cores so might sustain better numbers than older Zero.
    https://forums.parallax.com/discussion/173950/new-raspberry-pi-zero

    or, use some MCU module, with a HS-USB capable MCU

    https://www.pjrc.com/teensy/
    The Teensy4x series use a HS-USB MCU, and the firmware-to-USB support seems to be good, well over 100MBd, so that leaves a choice of serial peripheral to best connect to P2.
    The banner headings say UARTS are good to 20MBd, but some other sync interfaces mention 208MHz tops.

  • Another option would be to look into a Cypress FX2 device. While it does require a firmware, it's loaded from the host every time, and is limited to about 2KiB. But, the firmware's only job is to set up data transfers between an external (user defined) parallel bus and the USB-HS peripheral. The FX3 does USB-SS, but I don't see a way to use 500MiB/sec from the Propeller yet. 48MiB/sec would, I imagine, be plenty for most applications.

  • Bits or Byts?

  • pik33pik33 Posts: 2,366

    Maybe 100 Mbps Ethernet? This is 10 MB/s raw, 6 MB/s "cooked" seems to be available.

    24 MB/s seems to be way too fast for a P2. This means 300 Mbps serial.

    You can use a Raspberry Pi 4 and connect it using good quality, short, twisted pairs. Pi4 has 6 UARTs and the speed is limited only by the cable quality.

  • Also, data comms rates are usually specified in SI units, so Mbps is 1,000,000 bits per second, unlike RAM size (with the whole argument about MB vs MiB)

    That gives the raw line (bit) rate, then you need to understand the coding scheme to understand the symbol rate that then translates to the (payload) data bit rate.

    Generally speaking, a reliable link will never give a data bit rate that is as high as the raw line (bit) rate, because errors happen and therefore some bandwidth needs to be made available to account for this, and generally there will be some type of framing to allow identification of where the first bit is.

  • Maybe 100 Mbps Ethernet? That's 10 MB/s in the raw state, 6 MB/s in the "cooked" state seems to be available.
    - What module is there where the control code fits in a COG.

    24 MB/s seems way too fast for a P2. That means 300 Mbps serial.
    - 16 bit parallel transmission (HDD in PIO6 mode [90ns] = 11.111.111 Word/s = 22.222.222 Byte/s )

    You can use a Raspberry Pi 4 and connect it via good quality short twisted pair wires. Pi4 has 6 UARTs and the speed is only limited by the quality of the cable.
    - and what then there I also have to buffer once before it goes on to the PC.

    The problem must still simmer a little :)

  • @pic18f2550 said:
    Bits or Byts?

    Bytes. The FX2 will give you up to 48 MegaBytes per second (though inconsistently, usable rate depending on the quality of your USB cable), and the FX3 will push 500 MegaBytes per second (again, depending on the quality of your USB cable).

  • Does anyone know the chip CH376S?
    If the documentation translates correctly, it has an 8-bit interface and can work as a USB slave on the PC.
    Unfortunately I haven't found anything about the driver or VID:PID.

  • SimoniusSimonius Posts: 94
    edited 2021-11-04 18:44

    @pic18f2550 said:
    Maybe 100 Mbps Ethernet? That's 10 MB/s in the raw state, 6 MB/s in the "cooked" state seems to be available.
    - What module is there where the control code fits in a COG.

    100 Mbits/s would be 12,5 MBytes/sec. So depending on the frame size and on the protocol it could be 10-11 MB/s "cooked", also depending on how you handle flow control.
    I'm working on an ethernet implementation but right now it needs a little more simmering as well. Also that means RAW ethernet, not TCP/IP nor UDP. p2<>p2<>p2.... networks could be done in 2 cogs, over a normal switch and over looong distances

  • jmgjmg Posts: 15,173

    @pic18f2550 said:
    Does anyone know the chip CH376S?
    If the documentation translates correctly, it has an 8-bit interface and can work as a USB slave on the PC.
    Unfortunately I haven't found anything about the driver or VID:PID.

    That's only FS-USB ?

    The FT232H is HS-USB, and has an 8-bit slave interface that is good for ~30M Bytes/sec, where the P2 generates the CSN and CLK and it looks like FT-PROG can configure that to run in VCP mode.

    Another pathway could be to use WiFI ? - and a SDIO slave ?

    eg ESP32 data says this :
    4.1.9 SDIO/SPI Slave Controller ESP32 integrates an SD device interface that conforms to the industry-standard SDIO Card Specification Version 2.0, and allows a host controller to access the SoC,
    using the SDIO bus interface and protocol. ESP32 acts as the slave on the SDIO bus.
    The host can access the SDIO-interface registers directly and can access shared memory via a DMA engine, thus maximizing performance without engaging the processor cores.
    The SDIO/SPI slave controller supports the following features:
    • SPI, 1-bit SDIO, and 4-bit SDIO transfer modes over the full clock range from 0 to 50 MHz
    • Configurable sampling and driving clock edge
    • Special registers for direct access by host
    • Interrupts to host for initiating data transfer
    • Automatic loading of SDIO bus data and automatic discarding of padding data
    • Block size of up to 512 bytes
    • Interrupt vectors between the host and the slave, allowing both to interrupt each other
    • Supports DMA for data transfer

    So that's looking like ~25M Bytes/s

Sign In or Register to comment.