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

  • Hello Karl,

    Thanks for your quick response.  I will get a fixed rate output from SPI, so I may give it a shot.  Any examples using PPI are welcome.  I am just preparing myself for the task.

    Thanks,

    Joseph

  • Hello again Joseph,

    Since we do not recommend sharing the easyDMA sections between peripherals we do not have any examples that demonstrates this exactly, but we do have general PPI/DPPI samples so that you can use to familiarize with the PPI/DPPI peripheral.
    The simplest one is shown here and it shows how to connect a GPIOTE event to a GPIOTE task using PPI.
    You can then proceed to roughly use the same approach to link an SPI event to a UART task, for instance.

    Please do not hesitate to ask if you should have any questions! :) 

    Best regards,
    Karl

Reply
  • Hello again Joseph,

    Since we do not recommend sharing the easyDMA sections between peripherals we do not have any examples that demonstrates this exactly, but we do have general PPI/DPPI samples so that you can use to familiarize with the PPI/DPPI peripheral.
    The simplest one is shown here and it shows how to connect a GPIOTE event to a GPIOTE task using PPI.
    You can then proceed to roughly use the same approach to link an SPI event to a UART task, for instance.

    Please do not hesitate to ask if you should have any questions! :) 

    Best regards,
    Karl

Children
No Data
Related