Readdy Write  
0,00 €
Your View Money
Views: Count
Self 20% 0
Your Content 60% 0

Users by Links 0
u1*(Content+Views) 10% 0
Follow-Follower 0
s2*(Income) 5% 0

Count
Followers 0
Login Register as User

Schnellster Impuls mit ESP32 bei 50ns Nanosekunden Impulsbreite

04.05.2020 (👁9020)


Wie schnell kann man einen Impuls in ESP32 programmieren. Impulsbreite in ns

Die kürzeste Impulsbreite liegt bei 50ns Nanosekunden und die Perioden-Weite bei 140ns.

Allerdings muss man hierzu direkt die Ausgangs-Pins ansprechen mit

  //PIN GPIO4->ON

  GPIO.out_w1ts = 0b10000;

  

  //PIN GPIO4->OFF

  GPIO.out_w1tc = 0b10000

 

 

 

 

 

Arduino IDE Code für ESP32

Einfach laden und öffnen in  der Arduino IDE und hochladen auf den ESP32 Prozessor im ESP32 NodeMCU DevKit

//*FASTEST IMPULSE TEST ON ESP32

//====< VARIABLES >====

int OUT_PIN = 4;

//====</ VARIABLES >====

//BitMask

//0b11111=GPIO 0, 1, 2, 3, 4,

//0b10000=GPIO4

//=============< SETUP >============

void setup(){

  //--------< setup() >--------

  

  //< GPIO >

  //pinMode(OUT_PIN, OUTPUT);

  //digitalWrite(OUT_PIN, LOW);    // PULS_OFF DEFAULT  

  //</ GPIO >

  //ESP32 config io

  gpio_config_t io_conf;

  //ESP32 config io to output

  io_conf.mode = GPIO_MODE_OUTPUT;

  //Bitmask GPIO4 as Output

  io_conf.pin_bit_mask = 0b10000;

  //Set BitMask

  gpio_config(&io_conf);

  

  Serial.begin(115200);

  Serial.println("\n FASTEST IMPULSE TEST ON ESP32");

  //--------</ setup() >--------

}

//=============</ SETUP >============



//=============< Main_Loop >============

void loop(){

  //--------< Main Loop() >--------

  

  ///--< Fastest Impulse >--

  //*with write on/off

  //*ImpulsWidth=50-60ns jitter 1/10

  //*PeriodeWidth=140ns (136-156) jitter 1/10

  //PIN GPIO4->ON

  GPIO.out_w1ts = 0b10000;

  

  //PIN GPIO4->OFF

  GPIO.out_w1tc = 0b10000

  ///--</ Fastest Impulse >--

  //--------</ Main Loop() >--------

}

//=============</ Main_Loop >============

 

 

Zum Vergleich:

Das Schreiben mit digitalWrite HIGH und LOW erzeugt eine minimale Impulsbreite  von 116ns

  //--< Fast Impulse >--

  //*with write on/off

  //*ImpulsWidth=166ns

  //*PeriodeWidth=308ns

  digitalWrite(4, HIGH);  

  digitalWrite(4, LOW);

  //--</ Fast Impulse >--

Gemessen an einem ESP32 WROOM-32 Mikroprozessor direkt über den GPIO4 Pin

Arduino kompatibel