espressif / arduino-esp32

Arduino core for the ESP32
GNU Lesser General Public License v2.1
13.75k stars 7.44k forks source link

ESP32-S3 issue on SPI pins #10353

Closed Nezaemmy closed 4 weeks ago

Nezaemmy commented 2 months ago

Board

ESP32-S3 DevKitC-1

Device Description

DevKitC

Hardware Configuration

gpio 10,11and 12 are connected to the 3 chained 74hc595 shift register

Version

v3.0.4

IDE Name

Arduino IDE

Operating System

Windows 11

Flash frequency

80Mhz

PSRAM enabled

no

Upload speed

921600

Description

I have been using the 3 chained 74hc595 shift register with ESP32; the system has been working for more than one year. After switching to ESP32-S3, the system works for 2 to 3 days. The 74HC595 shift register starts misbehaving (for example, if you want to switch on pin 5 of the second chained shift register, pin 3 of the first shift register, and pin 6 of the shift register ON things like that), and with replacing the damaged one, the system works after the same time the issue comes again. The ESP32 doesn't have this issue with 74hc595.

Sketch

#include <ShiftRegister74HC595.h> //https://github.com/Simsso/ShiftRegister74HC595

// create a global shift register object
// parameters: <number of shift registers> (data pin, clock pin, latch pin)
ShiftRegister74HC595<1> sr(11, 10, 12);

void setup() { 
}

void loop() {

  // setting all pins at the same time to either HIGH or LOW
  sr.setAllHigh(); // set all pins HIGH
  delay(500);

  sr.setAllLow(); // set all pins LOW
  delay(500); 

  // setting single pins
  for (int i = 0; i < 8; i++) {

    sr.set(i, HIGH); // set single pin HIGH
    delay(250); 
  }

  // set all pins at once
  uint8_t pinValues[] = { B10101010 }; 
  sr.setAll(pinValues); 
  delay(1000);

  // read pin (zero based, i.e. 6th pin)
  uint8_t stateOfPin5 = sr.get(5);
  sr.set(6, stateOfPin5);

  // set pins without immediate update
  sr.setNoUpdate(0, HIGH);
  sr.setNoUpdate(1, LOW);
  // at this point of time, pin 0 and 1 did not change yet
  sr.updateRegisters(); // update the pins to the set values
}

Debug Message

NA

Other Steps to Reproduce

No response

I have checked existing issues, online documentation and the Troubleshooting Guide