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.

AM3356: PRU Soft-UART

Part Number: AM3356

Hello,
customer ask if a soft 16bit UART and a baudrate of 12Mbit/s can be realized in the PRU. He wants to use AM335x.

Regards, Holger

  • Hi Holger,

    There is an example here: processors.wiki.ti.com/.../Soft-UART_Implementation_on_AM335X_PRU_-_Software_Users_Guide . Please note that this is for an obsolete kernel and currently there is no support from TI for porting this to the new kernel versions.
  • Hello Biser,
    I know this example. But do you know if 12Mbit/s with 16bit can be reached with this example?

    Regards, Holger
  • Hi Holger,

    12Mbit/s cannot be reached with this particular example. The max speed for this soft-UART example is 115200 baud. This implementation processes multiple soft-UART ports at different baud rates simultaneously, so we're limited to the kbaud range.

    There is also a hardware UART in the PRU-ICSS that can reach 12Mbit/s with 8bit.

    Regards,
    Melissa
  • Customer wants to change this example. He only needs one UART with 16bit, 12Mbit/so.  Do you think this is possible?

    Regards Holger

  • Hi Holger,

    For the UART RX, what oversampling requirements does the customer have?  

    This soft-UART example supports 8-bit or 16-bit oversampling.  However, after reviewing the soft-UART example, 12 MBaud is not achievable with this oversampling rate.  The example uses the McASP serializers (AXR pins) as the UART I/Os.  The PRU does all data processing and pushes/pulls the data to/from the McASP.  On the RX side, the McASP interrupts the PRU after it receives 8 or 16 oversampled data bits (depending on the oversampling configuration).  This means the PRU has 83 ns, or 16 PRU cycles ( = (1 / 12MBaud) / 5ns), to read and process the data.  Otherwise, it will start missing data bits.  However, it takes 40+ PRU cycles for the PRU to simply read the a byte of oversampled data from the McASP!  This far exceeds the 16 PRU cycles allowance, and the PRU cannot keep up with RX data. 

    The soft-UART example could possibly achieve a single UART port @ 12MBaud if oversampling was removed and the McASP directly sampled the the UART RX signal.  However, the risk of not oversampling is that the sampled RX data may be prone to more errors due to timing drift.

    Regards,

    Melissa

  • Hello Melissa,
    they need as a minimum 3Mbit/s with 4-times oversampling. Would this be possible?

    Regards, Holger