B4R Question Timer or Digital Interrupt

rodmcm

Active Member
Licensed User
Are there program calls for these in B4r for the ESP32.?

I want to sample an analog (1 sample per mS) and measure frequency based on a square wave into a DI derived with external hardware from the analog signal.
What approach would I use with B4R?

At present, with conventional Arduino the analogRead() interferes with the Digital interrupt, so B4r may be the solution.
 

rodmcm

Active Member
Licensed User
Yes,I've been thinking about addlooper for a while. ,I'll give it a try thanks.. Is the count rate deterministic, in other words if the same addlooper program was placed in a lot of ESP32s would the count/period be the same in all of them? I see that the frequency of the count is 1.75MHZ for the 80MHZ ESP32.. What actually determines this?
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
in other words if the same addlooper program was placed in a lot of ESP32s would the count/period be the same in all of them?
Assuming that the chips are identical then they will run in the same way. Nothing else runs on the MCU except of your code.

I see that the frequency of the count is 1.75MHZ for the 80MHZ ESP32.. What actually determines this?
B4R uses a scheduler to handle the timers and loopers. There is a bit of code that is executed every loop.
 
Upvote 0
Top