Edit: Oh, I overlooked that you have already tried this...
Edit: Oh, I overlooked that you have already tried this...
Explore... Chat... Share...
Pablo2048 wrote:Maybe you can try to read UART_STATUS register bit 31 (txd) - read https://www.espressif.com/sites/default ... nce_en.pdf , page 115, Appendix 3 UART registers.
Edit: Oh, I overlooked that you have already tried this...
#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;
}
void setup() {
Serial1.begin(9600);
pinMode(P_DEBUG,OUTPUT);
U1S |= 0x01 << USTXC;
U1D = 10*50; // 50µs pulse
tick.attach(0.001, send); // every 1ms
}
void loop() {
static uint32_t _U1S;
// Toggle on every change of U1S
if(U1S != _U1S) {
_U1S = U1S;
DEBUG_HIGH;
} else {
DEBUG_LOW;
}
}
// What I get:
// IO_02: ‾‾‾‾|________|‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾|_
// DEBUG: ____|______________________________________|_
#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;
U1F = 0x80;
}
void setup() {
Serial1.begin(9600);
pinMode(P_DEBUG,OUTPUT);
U1S |= 0x01 << USTXC;
U1D = 10*50; // 50µs pulse
tick.attach(0.001, send); // every 1ms
}
void loop() {
static uint32_t _U1S;
// Toggle on every change of U1S
if(U1S != _U1S) {
_U1S = U1S;
DEBUG_HIGH;
} else {
DEBUG_LOW;
}
}
// What I get:
// IO_02: ‾‾‾‾|________|‾‾|________|‾‾|________|‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾|_
// DEBUG: ____|_|‾|_________|‾|_________|‾|______________________|_
It takes about 20-25 seconds for home assistant c[…]
I tried to upgrade tof my sonoff basic R2 with the[…]
a problem Perhaps you want to define "Probl[…]
Rebooting your router will not give you a faster I[…]
There are no other notifications from esptool.py i[…]
Using the Arduino IDE, you'll learn how to set up […]
In this project, you will post to Twitter using an[…]
In this project, we will build a water level contr[…]
I guess I'm late, but I had the same problem and f[…]
Last night I received my first D1 Minis for a lear[…]
Although I am aware that this is an old post, I fe[…]