How to Reset slave devices

Undo83
Posts: 1
Joined: Thu Mar 28, 2019 7:36 pm

How to Reset slave devices

Postby Undo83 » Thu Mar 28, 2019 7:44 pm

Hello everyone,

A noob question.. i have an ESP32 that has 2 attiny85 slaves on the I2C and a I/O expander as well(tca9555). I would like to be able to reset the slaves in case of lack of response. The tca9555 has something called power on reset and no Reset pin. From what i understand if i hook up the attiny Reset pin to the Esp32 En pin when the esp resets(by pressing the button) the attiny will also reset? Will the tca9555 do the same?

If i want to reset only the slaves should I hook the attiny reset pin and the tca9555 vcc pin to a IO on the ESP32 and set it to high? And when i want to reset the slaves just low the pin? Is this a correct approach? Thanks for your patience!

idahowalker
Posts: 166
Joined: Wed Aug 01, 2018 12:06 pm

Re: How to Reset slave devices

Postby idahowalker » Fri Mar 29, 2019 9:42 pm

I have one ESP32 WROVER-B connected to 2 ESP32's. Power to the ESP32's is supplied through two 3.3V relays. The default state for the relays is off. The WROVER B powers the two ESP32's and their related circuits 400mS, after the WROVER-B has powered on. Once a second, over a CAN buss, the 2 ESP32's supply an OK signal to the WROVER-B, If the ESP32's stop sending the OK an increment happens:

Code: Select all

void fLIDAR_Watchdog_Inc( void *pvParameters )
{
  for (;;)
  {
    xEventGroupWaitBits (eg, evtLIDAR_Watchdog_Inc, pdTRUE, pdTRUE, portMAX_DELAY );
    xSemaphoreTake ( sema_LIDAR_Watchdog_Counter, xSemaphoreTicksToWait );
    LIDAR_Watchdog_Counter = LIDAR_Watchdog_Counter << 1;
    if ( LIDAR_Watchdog_Counter < 0 )
    {
      ESP.restart();
    }
    xSemaphoreGive ( sema_LIDAR_Watchdog_Counter );
  }
  vTaskDelete( NULL );
}

at this line : LIDAR_Watchdog_Counter = LIDAR_Watchdog_Counter << 1;.

If the shift reaches a negative value then the LIDAR_Watchdog_Counter, before overflowing, resets the WROVER-B, the power relays drop out and the whole show starts all over again. I do the power thingy this way cause each ESP32 needs to be in sync with the WROVER-B. All the circuits associated with each ESP32 is, also, reset. It takes about 4 seconds, with loss of OK signal, for the reset to happen. The receipt of the OK signal from the two ESP32 clears the counter.
Each ESP32 has their own logic as to why not send the OK signal.

Works really well.

I have, over months, solved the issues that caused the restart but have kept the circuit around as a fail safe, if needed.

Perhaps, such a scheme could suit your requirements.

Who is online

Users browsing this forum: Baidu [Spider], djixon, ramier and 79 guests