Open Jvsjvs opened 4 weeks ago
What version of inspector What version of ESP32 framework Do you not get any capture interrupts at all or are all packets discarded with wrong times? Do a print just to be sure you got the right input pin (default is GPIO5).
Harald.
Hi,
DCC Packet Analyze initialising
INPUTPIN=4
- I don't see any interrupts being reported.
My config.h file:
/ Copyright (c) 2021 Neil McKechnie
// The following logic should work for all supported platforms, hopefully.
#define ESP32
// nothing needs done here.
// Uncomment the "#define USE_DIO2" to use the 'Fast digital i/o library' DIO2 // in place of the normal digitalRead() and digitalWrite(). // Reduces CPU load by about 17%. Only applicable to Arduino Uno/Mega/Nano. //#define USE_DIO2
// Uncomment the "#define USETIMER" to perform the timing using the ATmega328's // and ESP32's Input Capture mode which captures the time through hardware instead // of software. This enables a higher accuracy and consistency, and because we can capture the // Timer counter register (TCNTn) at the time of the digital change, it is immune to // timing errors caused by other interrupts. // Works on Arduino Uno (Timer1/pin D8) // Arduino Nano (Timer1/pin D8) // Arduino Mega (Timer4/pin D49) // If we don't use this, then the selected input pin must support change interrupt // (defaults to pin D2 on Uno, Nano and Mega, GPIO2 on ESP8266 and GPIO5 on ESP32.
// Input pin definitions. Defaults: // Nano (USETIMER): 8 // Uno (USETIMER): 8 // Mega (USETIMER): 49 // Nano/Uno/Mega, Non-USETIMER: 2 // ESP32: 5 // ESP8266: 2 // Other: 2
#define INPUTPIN 8
#define INPUTPIN 49
#define INPUTPIN 4
// Assume timer not supported, use default pin
#undef USETIMER
#define INPUTPIN 2
#define INPUTPIN 4
#define INPUTPIN 2
// Uncomment following lines to enable OLED output on pins SDA_OLED and SCL_OLED. // (ESP or Mega only). //#define USE_OLED
// #define SDA_OLED 4 // #define SCL_OLED 15
// Button for selecting new page on OLED. The button action is carried out // when the pin goes from 1 to 0 (pull-up is enabled).
// LED pin definitions - uncomment and assign as required.
//#define LEDPIN_LOCOSPEED 3 // Driven from loco speed packet for loco 3
//#define LEDPIN_FAULT 6 // Lights when a checksum error or glitch is encountered.
// Uncomment the following line to enable HTTP Server (ESP32 or ESP8266 only).
// SSID and password can be configured here. However, the server will, by preference, // connect using the same credentials as last time; if that fails it will try WPS; // only if that fails too, will it use the credentials below.
// Name used by mDNS to register the device. On some browsers it can be accessed // through this name with a ".local" suffix (e.g. http://DccInspector.local/).
// OLED isn't supported on Uno or Nano
#undef USE_OLED
// HTTP Server isn't supported on Uno or Nano or Mega
#undef USE_HTTPSERVER
Any idea what could be wrong?
The ESP32 uses the mcpwm capture mechanism which should be the same on the ESP32-S3, but who knows with espressif? Does setting the IDF debug level to max verbose give any more information? No, I don't have any more ideas and I don't have any S3. Harald.
Problem solved. The SW works as is on an ESP32-S.
My own SW was a bit more tolerant to the input signal. I changed the input filter on my board a bit and now the Inspector also works on my board.
Thanks.
EX-DCCInspector Version
9.1.0
Bug description
I have a board with an ESP32 S on it.
I use this board to decode DCC signals which works perfectly (on GPIO 4). So I know that the board works and that the DCC interface works. The board is connected to the track and currently controlling turnouts.
If I download your firmware to this board and configure it to use GPIO4 and disable the OLED display it does not work:
If I flash my own SW the board again functions perfectly, decodes DCC and controls the connected turnouts.
Any idea what could go wrong, I guess it has to do with the "S" version of the ESP32.
Steps to reproduce the bug
Run the software on a board with an ESP32 S
Expected behaviour
Activity on the DCC track should be detected, it currently detects nothing.
Screenshots
No response
Hardware in use
ESP32S populated board (own design)
Additional context
No response