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
  • This is how i read and convert. would you please point me a example. i only need those 8 pin not the all pin of nrf52832.

    uint8_t data_in() {
    
    uint8_t data[10], sum = 0, i, j = 7;
    config_dataport_in();
    data[0] = nrf_gpio_pin_read(M1);
    data[1] = nrf_gpio_pin_read(M2);
    data[2] = nrf_gpio_pin_read(M3);
    data[3] = nrf_gpio_pin_read(M4);
    data[4] = nrf_gpio_pin_read(M5);
    data[5] = nrf_gpio_pin_read(M6);
    data[6] = nrf_gpio_pin_read(M7);
    data[7] = nrf_gpio_pin_read(M8);
    
    
    for (i = 0; i <= 7; i++) {
    sum = sum << 1;
    sum = sum + data[j];
    j--;
    }
    return sum;
    }

Children
Related