Use this forum to chat about hardware specific topics for the ESP8266 (peripherals, memory, clocks, JTAG, programming)

User avatar
By buzzy
#78515 Hey! I am trying to use a 74HC165 to get more INPUT pins on my esp8266.
I have connected everything according to the data sheet, but I still get all zeroes when pulling the values.
I have all 8 "D"-pins on the 74HC165 connected to GND using 10k resistors. Then one of the Pins to a button that pulls it to VCC. Pushing the button has no effect :(

Here is my code:

Code: Select all#include <Arduino.h>
#include <SPI.h>

byte shift_1;

void setup() {
    Serial.begin(9600);
    SPI.setClockDivider(SPI_CLOCK_DIV2);
    SPI.setDataMode(SPI_MODE0);
    SPI.setBitOrder(MSBFIRST);
    SPI.begin();

    pinMode(4, OUTPUT);
    digitalWrite(4, HIGH);
}

void loop() {
    digitalWrite(4, LOW);
    shift_1 = SPI.transfer(0);
    digitalWrite(4, HIGH);

    Serial.print(micros());
    Serial.print(" Register 1 = ");
    Serial.println(shift_1, BIN);

    delay(1000);
}


I have also attached a picture of my wiring. What am I doing wrong? :(
You do not have the required permissions to view the files attached to this post.
User avatar
By rudy
#78516
I have connected everything according to the data sheet


No you didn't. http://www.ti.com/lit/ds/symlink/sn74hc165.pdf 10 Power Supply Recommendations

How much work do you expect someone to put in in order to help you? Do you not think that providing a schematic of your circuit would be helpful? The picture of your wiring is poor. It is hard to see where in the breadboard the wires end up. A picture is useful in order to see in general how you have done things. What things you have left out. (like bypass capacitors)

At this point I need to trace out your circuit to see if what you have done is actually correct. I need to look up the pin functions for your ESP8266 board, the pin functions for the 74HC165. Then go through your code and make sure you did all that right.

When you ask for help be considerate. Try and make it easier for someone to help you.
User avatar
By buzzy
#78522
rudy wrote:
I have connected everything according to the data sheet


No you didn't. http://www.ti.com/lit/ds/symlink/sn74hc165.pdf 10 Power Supply Recommendations

How much work do you expect someone to put in in order to help you? Do you not think that providing a schematic of your circuit would be helpful? The picture of your wiring is poor. It is hard to see where in the breadboard the wires end up. A picture is useful in order to see in general how you have done things. What things you have left out. (like bypass capacitors)

At this point I need to trace out your circuit to see if what you have done is actually correct. I need to look up the pin functions for your ESP8266 board, the pin functions for the 74HC165. Then go through your code and make sure you did all that right.

When you ask for help be considerate. Try and make it easier for someone to help you.


Sorry about that. I have attached the schematics. Adding a 0.1uF capacitor made no difference.
You do not have the required permissions to view the files attached to this post.