Skip to main content

Posts

ESP32: UART interrupt Handling

I am Sushant, from Mumbai, India. I am an embedded firmware engineer, i love to write code for micro controllers. This may not be a professional post, you may have to tolerate my unprofessional writing skills. Anyways todays topic in ESP32, a very commonly and trending MCU. I had come across project where there was a need to write my own code for UART, i tried or you can searched google even on page 2, but could find any sample code or example. I found the solution, not easy way, had to put in some hours, but i would like to put this example in blog so everybody can use it or understand it, It is simple code for UART receive interrupt, So Lets start, Everybody must be aware of how to initialise UART to use as RTOS task in ESP32, oh yeah and also i have used ESP-IDF to demostrate this code, so for arduino geeks this may not help, not a arduino FAN :). Firstly,  Configuring parameters of an UART; uart_config_t uart_config = { .baud_rate = 115200, .data_bits =
Recent posts

ESP32: Webserver using esp-idf SDK

Web-Server or Web-socket oe http socket is most commonly used method to read or write data from Ethernet or now as we move to new technology WiFi in embedded universe. It was already there, but with cheap and easily available ESP modules it has taken a big leap forward. Here in this topic, i will explain you to added Web Server to ESP32 module using eclipse. If you are new to ESP32 using eclipse you start from here for adding ESP32 in eclipse. Ok lets start with ESP32 Webserver, initialization, struct netconn *conn, *newconn; err_t err; conn = netconn_new(NETCONN_TCP); // Create TCP socket netconn_bind(conn, IP_ADDR_ANY, 80); // bind socket netconn_listen(conn); Now, write the main body to accept web client connection and to decrypt http frame. do { err = netconn_accept(conn, &newconn); // accept incoming connection if (err == ERR_OK) { ESP_LOGI(TAG, "Accepted Conn %d\n", err); http_server_netconn_serve(n