Use this forum to chat about hardware specific topics for the ESP8266 (peripherals, memory, clocks, JTAG, programming)
User avatar
By centigradz
#73824
btidey wrote:Not feasible in my view to do this directly on an ESP8266. You are talking 2-3 CPU clocks even at 160MHz. The ESP8266 also has a slower internal IO bus and you have some uncertain latency into getting into an ISR if you were going that route.

You should explain a bit more on what you are trying to measure to see if there are other approaches.


What i'm going to do is two way ranging. While i can calculate the delays of the radio modules i need a way to precisely measure the time durations of sending and receiving signals. That's why i thought to use the interrupts. The radio modules will output the demodulated signals after they received them, throught the interrupts on the mcu i want to measure the arrival times of these signals. I saw that with teensy 3.6 it's possible as it has a timer which will timestamp the signals. But programming and developing an standalone product with an arm cortex is much difficult for me. That's the reason why i'm researching the ESP chip.
User avatar
By aDub
#73871 As mentioned the clock speed is too slow! You probably want your processor clock to be running a decade faster that the time domain you want to observe and you probably want to be writing assembler to get the maximum efficiency out of your processor. C is okay, but...

Without further understanding.
A better method (I assume you need to process the signal externally before it hits the interrupt) would be to time your ping externally.
You will require headers and footers to identify "real" signals
so in hardware, start timer, send signal. Wait for return signal, all incoming data runs through a buffer and look for a header match. Stop the clock or time out.
On match, indicate to MPU (INT) and pass the timer (minus any computational overhead) and other data.

You could encapsulate a time stamp in the data-frame, but that would require some funky time keeping and inter-device calibration! Or let someone else deal with that and use GPS modules?

I think it's paper, pencil & data-sheet time! [PPDT]

This is a simple, yet not a trivial project 0.o
User avatar
By alekssmitt
#74593 I have the same problem. I think the general way to resolve this problem simply use input signal (square short impuls, as I presume) as enable signal to set off preprogrammed sysclock counter.
And I think that internal IO (even with a slower bus) and a command itself give certain latency, which doesn't play much role, since the calibration method can be easily involved.