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.

LP-AM243: SPRADC3 - 8b/10b Intra Drive Communication Using 8b-10b Line Code With Programmable Real Time Unit - Application Note

Part Number: LP-AM243
Other Parts Discussed in Thread: AM4376, ISO7242M

I am trying to evaluate the Intra Drive Communication Using 8b-10b Line Code With Programmable Real Time Unit - Application Note.  Will the source code files be made available?  That would save a considerable amount of time and provide a good example of how to properly use the PRU.  

I have also been looking at the examples for the AM243x Launch_Pad and there are no PRU examples.  What is the best resource for PRU examples that would interface with the R5F cores through shared RAM?  

Ultimately, I am looking to create a high serial link between two MCUs that is essentially driverless from the point of the R5F.  

  • There are various options to run high speed serial link between two MCUs with PRU.

    Standard interfaces:

    1. SPI (50 Mbit, no coding)

    2. FSI (200 Mbit, no coding)

    3. RGMII cross connect (1 Gbit, no coding)

    Custom interface:

    4. up to 125 Mbit with e.g. 8B/10B line coder using serial shift or 3 channel peripheral interface (referenced app note)

    5. serial link as item 4 with DDR and/or multiple data lines.

    Here are basic questions I have:

    - what is the net (uncoded) data rate required?

    - can you work with clock and data lines or only single line per direction?

    - do you need external transceiver such as LVDS or can you do direct connection between the MCUs using LVCMOS (3.3V)?

    - do you plan to use CRC frame check? Which CRC poly or is the CRC poly supported by PRU CRC16/32 widget?

    - "driverless" - are you referring to external signal driver or software driver? Assume it is ARM software driver to allow memory mapped framing which can be served from other bus masters in the system such as PRUs, DMAs, ARM.

    - do you need host port capability e.g. one MCU can read and write into other MCU memory and IO space.

    We have started to put out PRU examples and "PRU getting started Guide" at https://git.ti.com/cgit/pru-software-support-package/pru-software-support-package/tree/examples/am243x 

    We can also add examples for the high speed serial link on the short term.

    - Thomas

  • Thomas thank you for the reply.  Answers to your questions below:

    1. I am trying to replace a design that interfaced two single core Coldfire CPUs with a Dual Port Ram connected to the Flexbus.  This allowed for nearly synchronous operations between the two CPUs.  The CPUs used the DPRAM to synchronize operations and exchange small amounts of data  (32 bytes per encounter), without the use of drivers or really any protocol stacks of any kind.  We will never achieve the performance of a DPRAM without one, but I think that something in the 100 Mbs to 200 Mbs would be acceptable.  It also needs to be very deterministic and SW driverless from the point of view of the R5F if possible. 

    2. We need isolation between the CPUs so any signals have to pass through isolation components, so there is need to limit the number of signals if possible. A data and clock in each direction would be acceptable. 

    3.  I do not think that we need external transceivers as the MCU are mounted on the same card only a few inches apart.  

    4. Some sort of CRC check would be desirable to increase the reliability of the interface.  The ability to Ack/Nak and retransmit failed packets at the network layer would be nice. 

    5. No SW level drivers from the R5F level if possible.  On another implementation using the AM4376 we tried replace the DPRAM by using ethernet between the CPUs, but the RTOS+Drivers+IPStack resulted in a total loss of deterministic behavior.  

    6. Host port capability would somewhat like a DPRAM interface, so that could be desirable. 

    If you could add the examples for the high speed serial link, that would be greatly appreciated.   Do you know if the source code from the 8b/10b Intra Drive Communication Using 8b-10b Line Code With Programmable Real Time Unit - Application Note will be made available?  

    Thanks again. 

  • Shawn,

      thanks for sharing your requirements.

    PRU has min latency to memory and IO which provides you dual port memory performance on a chip 2 chip communication.

    Below diagram shows various data path and memory latency figures on the AM64x/AM243x architecture. I take for example two extremes.

    1. Fastest read latency using scratch pad memory which is shared between PRUs or PRU and RTU.

    PRU0 can read/write single cycle up to 120 bytes using XIN/XOUT. Same memory is shared with PRU1 and can be used for small dual port RAM block. 3 ns latency for 120 bytes translates into very high bandwidth interface of 320 Gbit/s. Ultrafast but limited to smaller memory blocks. 

    2. DDR memory with maximum size 

    XFR2VBUS widget can read from any memory location including DDR memory. Read latency is typically in the range of 380 ns for 4 bytes. In this case other side has to wait for DMA to be complete for sending out data from DDR. Task manager has xfr2vbus read complete trigger which simplifies the coding for long delay requests. 

    Other options for shared RAM are ICSS memory, on-chip 2 MB RAM or R5F TCM.

    In general your read latency is delayed by external iso device and serial to parallel conversion of the interface.

    If you choose for example ISO7242M device you get about 20ns delay in each direction. This device can go up to 150 Mbit rate and gets you two signals in each direction. Whether you do 2 data lines or 1 data and 1 clk for each direction has a couple of dependencies.

    In case you can clock both Sitara device from single oscillator you may not require a clock signal as the inferface will not drift if PRUs on both Sitara run the same clock. Without shared clock synchronization and without clock signal you would need to add synchronization pattern and learning phase to the communication. I expect that this scheme is probably too long for your low latency interface. You also have the option to transfer double data rate in one or two data lines per direction. You can spread out the rising and falling edge data to two PRUs in case you want to do run the interface at e.g. 150 MHz. 

    From a protocol perspective you can do standard type with /command/address/data scheme or any custom, pre-engineered data transfers which are repeated with fixed timing.  For example, every 4 us there is a 64 byte data exchange between the two chips.

    CRC16/32 is a hardware widget from PRU which is called using broadside interface. You can also issue a single cycle CRC calculation over 32 byte register range.

    For 8B/10B line code there is a source code reference in the HDSL SDK example.

    See: C:\ti\mcu_plus_sdk_am243x_08_06_00_43\source\motor_control\position_sense\hdsl\firmware\datalink.asm

    and search for function: recv_dec_10b. It uses two step look-up tables

    ;decode
        ldi     REG_TMP11, (PDMEM00+LUT_5b6b_DEC)
        lbbo &REG_FNC.b0, REG_TMP11, REG_FNC.w2, 1

    ;decode
        and REG_TMP0.w2, REG_FNC.w2, 0x0f
        ldi REG_TMP11, (PDMEM00+LUT_3b4b_DEC)
        lbbo &REG_TMP0.b0, REG_TMP11, REG_TMP0.w2, 1

    The LUTs are pre-loaded from ARM side at: C:\ti\mcu_plus_sdk_am243x_08_06_00_43\source\motor_control\position_sense\hdsl\driver\hdsl_lut.c

    On standard interface the FSI interface comes close to your requirement using 2 data line DDR (200 Mbit) with a clock. However you would still use PRU to read and write low latency data and not involve the ARM core in the interface.

    Let me know if  you need further guidance or discussion on the interface. We can also take it step by step. 

    - Thomas