This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Read 8-bits from GPIO without intervention from the CPU

Hi!

I am working with an nRF5340.

- Is it possible to somehow fill an array with values read from a GPIO OUT register using DMA or PPI?

- Is it possible to assign a function to an EGU event and call it at a GPIOTE event using PPI?

- Is it possible to benefit from the two cores of the nrf5340 and continuously sample data in one core and use the other core for other types of processing?

- Should the network core in the nrf5340  only be used for BLE matters?

- When we send a BLE message using functions such as bt_nus_send(), does it interfere with the running of the application CPU, or is it fully handled by the network core (nRF5340)?

If it is possible, please point me to an example code or hints on how to do it.

Thank you.

Parents
  • Hello Thiago,

    Sorry for late reply. I was sick last week.

    1. Sampling digital signals using the SAAD and timer should be possible, technically. You just need to decode the analog samples as high or low level based on sampled value. For example: sampled value above 0.7xVDD is for high and below 0.3xVDD is for low. 

    If you want data from multiple GPIO pins, you need to consider that there is only on ADC core, so sampling multiple analog inputs will happen sequentially (SCAN mode). Then there will be (T_acq + T_conv) ''delay'' between samples from each input. One thing, you have to consider that SADDC is quite high power (see the table below from our product electrical specification) when it

    is active.

     

    Therefore it would not be a low power operation if this is you want to implement, not involving the CPU. 

    2. The EGU will not be able to perform any software functions without involving the CPU (https://infocenter.nordicsemi.com/topic/ps_nrf5340/egu.html?resultof=%22%45%47%55%22%20%22%65%67%75%22%20 ). The EGU can be used for the PPI to link peripherals to custom callbacks. For example: you can use GPIOTE+PPI to trigger the STARTTX task of the UARTE peripheral to send a predefined buffer when the button is pressed. 

    Could you please share why do you would you like to use EGU to generate a new Event? The EGU is used to generate for hardware events. If you already have an event from GPIOTE, do you think it is relevant using EGU again to generate a new event? It may be redundant. 

    Best Regards,

    Kazi Afroza Sultana

  • Hi! I hope you are feeling better now.

    Could you please share why do you would you like to use EGU to generate a new Event? The EGU is used to generate for hardware events. If you already have an event from GPIOTE, do you think it is relevant using EGU again to generate a new event? It may be redundant. 

    I may be wrong, but I thought we could not use a GPIOTE event to trigger a read GPIO_IN task using PPI, so I was looking for alternatives that would allow offloading the CPU while reading the GPIO_IN register.

    Using the SAADC is an interesting approach that I haven't thought about before. Is it possible to trigger 8-pin SAADC sampling tasks using a single GPIOTE event? I think this could solve my problem.

Reply
  • Hi! I hope you are feeling better now.

    Could you please share why do you would you like to use EGU to generate a new Event? The EGU is used to generate for hardware events. If you already have an event from GPIOTE, do you think it is relevant using EGU again to generate a new event? It may be redundant. 

    I may be wrong, but I thought we could not use a GPIOTE event to trigger a read GPIO_IN task using PPI, so I was looking for alternatives that would allow offloading the CPU while reading the GPIO_IN register.

    Using the SAADC is an interesting approach that I haven't thought about before. Is it possible to trigger 8-pin SAADC sampling tasks using a single GPIOTE event? I think this could solve my problem.

Children
  • Hello Thiago,

    ''Using the SAADC is an interesting approach that I haven't thought about before. Is it possible to trigger 8-pin SAADC sampling tasks using a single GPIOTE event?''

    If you enable 8 channels in SAADC, one for each analog input and then trigger the sample task from GPIOTE, you will get result from all channels. But you will get result sequentially not simultaneously. GPIOTE has Port event (https://infocenter.nordicsemi.com/topic/ps_nrf9160/gpiote.html?cp=2_0_0_5_4) where an event can be generated from multiple input pints (for example you 8 analog input from SAADC) using the GPIO DETECT signal. 

    Thanks. 

    Best Regards,

    Kazi Afroza Sultana

Related