SPI to UART pipe using PPI

Can PPI be used to establish a pipe from a SPI output to an UART input??   PPI does not need CPU intervention, so it does not require CPU to read SPI and then write to UART. 

Thanks,

 JC

Parents
  • Hello JC,

    You are right that this can be done, technically.
    To do this, you could have both the SPI and UART point to the same easyDMA section, and then connect the SPI RX complete event to the UART TX task through PPI. This will cause the UART to echo the data that was just placed in the easyDMA section by the SPI peripheral, without any interaction by the CPU.
    However, it is not recommended that you do this practically, since you will be in trouble if you - for whatever reason - receive anything else than the expected number of byte on the SPI.
    For this reason we do not recommend this use of the easyDMA + PPI (specifically, we do not recommend that different peripherals share sections of the easyDMA), but you are of course free to do this if you would like.

    Best regards,
    Karl

Reply
  • Hello JC,

    You are right that this can be done, technically.
    To do this, you could have both the SPI and UART point to the same easyDMA section, and then connect the SPI RX complete event to the UART TX task through PPI. This will cause the UART to echo the data that was just placed in the easyDMA section by the SPI peripheral, without any interaction by the CPU.
    However, it is not recommended that you do this practically, since you will be in trouble if you - for whatever reason - receive anything else than the expected number of byte on the SPI.
    For this reason we do not recommend this use of the easyDMA + PPI (specifically, we do not recommend that different peripherals share sections of the easyDMA), but you are of course free to do this if you would like.

    Best regards,
    Karl

Children
Related