We're going to use an HX711 amplifier to read data from a strain gauge – the SparkFun page says you can use any GPIO pins but it one is "clock" and one is "data." What does that mean in this case? Does that mean in needs to be connected to an SCLK pin? Or can I really use any GPIO pin?
Electrical – use any GPIO pins on the Raspberry Pi for the HX711 Amplifier
arduinogpioload cellraspberry pi
Related Solutions
Debouncing idea is not good if you need use quadrature encoder. Even the max. theoretical frequency (counted from max. RPM) is low you can see high frequency flickering at one channel which is plus one, minus one, etc. When you miss some edge (e.g. handled by external interrupt), you see shift. If you need count up/down pulses, you can reuse an external clock for two AVR counters. MCU supports some simple debouncing and bandwidth is high enough. It on-loads MCU as well. I found that evaluating quadrature A-B signals in code is useless, i.e. not reliable enough for high precision systems and rather using external quadrature counters LSI.
Some issues related to connecting two port are in AVR ATMega I/O pin overcurrent protection thread.
Assuming the Raspberry Pi is just a consumer of data its GPIO would be configured as an input, and whether or not you enable a pull-up resistor would depend on if that's built into the controller or not. I can't think of a reason why the Raspberry Pi would ever actively drive the data line. I would guess you need to enable the pull-up on the Raspberry Pi, because otherwise what's the point of having an open collector interface on the controller. You might need to use an external pull-up resistor if the internal pull-up is too weak; the tutorial I reference below suggests 2.2k Ohms, whereas the internal pull-ups on the Pi are likely > 30k.
I wonder whether you're actually going to be able to get sufficiently frequent / deterministic sampling of the signal on the Raspberry Pi by polling the GPIO though, in order to decode the (presumably) serial data coming from the controller. I'm not familiar with the N64 controller protocol, so it's hard to say.
I found this reference on the internet, which might be helpful to you:
To understand how to interface with an N64 controller, one must first understand the protocol that a genuine N64 uses to interface with the controller. All data is transmitted on a single, half-duplex wire (the signal wire plugged into pin 25 above). When this wire is idle, it is high (hence the pull-up resistor). If a falling edge is detected, it means that bits are being transmitted. Bits are transmitted in 4μs intervals. For a 0, the wire is low for 3μs and high for 1μs. For a 1, the wire is low for 1μs and high for 3μs. In order to read a bit, you must simply wait for a falling edge, and then read the wire 2μs after the falling edge. If the wire is high, the value is a 1, if it is low, the value is a 0. All transmissions end with a 1 bit that is not followed by a falling edge, called the signal bit.
Looks like a serial Pulse Width Modulation encoding. I'm skeptical that one can decode this with a Raspberry Pi easily. It would, on the other hand, be trivial to decode with a microcontroller, e.g. using pin change interrupts and/or hardware timers / input capture interrupts.
Update
Seeing as it is a bi-directional bus, you should indeed never set the GPIO to an output-HIGH. When you want the output to be HIGH, you just st it to an input with pull-up enabled (or no pull-up maybe). When you want to output LOW, set the GPIO to an output low. Again though, I doubt you can get the timing right with a Pi given the O/S in the way.
Best Answer
The statement of HX711 amplifier module from Sparkfun says,
Also, from the example code, as Jack Creasy says, you can confirm the above statement:
See the '>>>>' marked line. You can use any pin in Arduino. Hence, HX711 amplifier's D_OUT and SCK pins don't need to be connected only with I2C pins of the microcontroller.
The same case is for Raspberrypi. Like Arduino, RaspberryPi also can be used with HX711 amplifier via python library of HX711. And there is no need to use SCK pin of Raspberrypi. For more info, find this tutorial.