Open krisjdev opened 3 months ago
Reading the GPIO pins directly with gpio_get()
does produce the correct values, so it's not got anything to do with the wiring
for (int i = 0; i < 8; i++) {
printf("pin %d is %d\n", GPIO_IN_DATA_BASE_PIN+i, gpio_get(GPIO_IN_DATA_BASE_PIN+i));
}
Partially resolved by adding a new function (babyif_get_data_word_gpio()
), but I would much rather that this use the PIO system -- not strictly necessary, but would be nice
The data input pins (GP 2-9) are not being read correctly by the PIO state machine, and its not 100% clear why. The data output pins (GP 10-17), that are driven by the same PIO program in
data_io.pio
seem to be correct (as tested via FPGA).Single stepping through the main program sometimes causes it to read correctly.
Ideas:
Reproduce by cloning the repo at ca337c0, tie GP 2-9 either high or low and observe and incorrect value being read back on the terminal.