Digital Input
Posted: Wed Oct 16, 2019 8:11 pm
Hello All
I have a 868Mhz Radio connected to GPIO 14.
The transmitter ( handheld remote) sends a Logic 1 as a 0.88 MS Pulse and logic 0 as 0.44 Pulse.
I have tried every thing I can think of but I cannot seem to read the port quickly enough. I fail to detect the Logic pulses.
The transmitter uses a Sync bit ( Logic 1) of 2.6 MS this can be detected.
I have attached a change Interrupt and with in the ISR I have the following code:
Is there a better way to read the pin so that I can detect the fast pulses. Help
JT
I have a 868Mhz Radio connected to GPIO 14.
The transmitter ( handheld remote) sends a Logic 1 as a 0.88 MS Pulse and logic 0 as 0.44 Pulse.
I have tried every thing I can think of but I cannot seem to read the port quickly enough. I fail to detect the Logic pulses.
The transmitter uses a Sync bit ( Logic 1) of 2.6 MS this can be detected.
I have attached a change Interrupt and with in the ISR I have the following code:
Code: Select all
void IRAM_ATTR ISR(){
unsigned long timestamp = micros();
unsigned long pulse_width = timestamp - last_timestamp;
int pin = digitalRead(14);
last_timestamp = timestamp;
last_pulse_width = pulse_width;
update = true;
}
void loop(){
if (change){
Serial.println(last_pulse_width);
change = false;
}
JT