I am trying to set a timer pulse at 500kHz and on every high pulse i want to do a read on another pin.
I have an IC HX711, that has a 24bit output MSB. every positive cycle it changes to the next bit.
If i were to bit bang it would be like this, but I feel there is a more elegant way to do this and i hate using delays. I know they have PPI or times and PWM. I just dont know how to ensure i do a reading during a low signal of the period. An arduino function that would be similar is the shiftIn function, if nrf libraries have something similar
for(int i = 0; i < 24; i++){
if(i > 0) result = result << 1;
nrf_gpio_pin_write(_SCLK, 1);
nrf_delay_ms(1000);
nrf_gpio_pin_write(_SCLK, 0);
nrf_delay_ms(1000);
result = result & nrf_gpio_pin_read(_SDATA);
result = result << 1;
}