#include <Arduino.h>
#include <Ticker.h>
Ticker tick;
// U1 TX: GPIO_02 / D4
#define P_DEBUG 14 // D5
#define DEBUG_HIGH GPOS = 1<<P_DEBUG
#define DEBUG_LOW GPOC = 1<<P_DEBUG
void ICACHE_RAM_ATTR send() {
DEBUG_HIGH;
DEBUG_LOW;
U1F = 0x80;
U1F = 0x80;
}
void setup() {
Serial1.begin(9600);
pinMode(P_DEBUG,OUTPUT);
U1S |= 0x01 << USTXC;
U1D = 10*50; // 50µs pulse
U1C0 |= 1<<UCLBE; // enable loobback mode
tick.attach(0.001, send); // every 1ms
}
void loop() {
if(U1S&(1<<USRXD)) {
DEBUG_HIGH;
} else {
DEBUG_LOW;
}
}
// What I get:
// IO_02: ‾‾‾‾|_____|‾|_____|‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾|___
// DEBUG: ‾‾‾‾|_____|‾|_____|‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾|___
Whats the best way to tell espressif about that? I'd be really interested if it is an hardware issue...
Can please someone confirm that?