This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Port Read Delay.

Hello,

i am using nrf52832. i am using 8 different pin as a 8-bit parallel port. 

in my process i have to read each bit from each pin then converting those bit  into byte.

like this its taking 14uS to finish a conversion. 

my question is : How can i read all 8 pin as a 8 bit-parallel port?

Parents Reply
  • If you want to read each pin individually, there is no function for reading multiple random pins in the nRF. You could probably reduce your code a bit, but if you configure the compiler to optimize your application for speed, this should not make much difference anyway.

    By making sure the 8 pins are in range, you could read the entire port and mask it out, for instance if you read P0.24-P0.31:

    uint32_t port_state = nrf_gpio_port_in_read(NRF_GPIO);
    uint8_t pins_state = (port_state >> 24) & 0xFF;

Children
Related