hi
I want to start with rtos ,It is not clear for me from where should I
start . could anyone please tell me what I should do ? please suggest some programming tutorials for a beginner to pro.
Regards
hi
I want to start with rtos ,It is not clear for me from where should I
start . could anyone please tell me what I should do ? please suggest some programming tutorials for a beginner to pro.
Regards
for many real-time application, not using an OS is actually better. there's less overhead using the OS and it is less compliated.
multi-tasking is often more helpful as a social management rather than a technology tool, people develop their code within their task without needing to manage interactions with code developed by others
OS are of course ideal for machines with multiple users all working independently or PC running many application. this is not the case for tasks in an embedded application where tasks interact with one another. this is why OS's have mechanisms for inter-process communications.
what is more common with processors like esp32s is inter-processor communication where the application is composed of multiple esp32s. there are a variety of ways to support inter-processor communication, but the esp32 is well suited for using WiFi
you could probably learn more about multi-tasking using your laptop.
Start with "Mastering the FreeRTOS Real Time Kernel - A Hands On Tutorial Guide" ... Here. You can skip the first two chapters.
Then read Here about the differences between "Vanilla" FreeRTOS and the ESP32's implementation that supports the dual-core architecture.
You will find few examples in the attached file using 30-pin ESP32 Dev Board.
ch-18 ESP32Lec.pdf (1.2 MB)
In a practical session students (using Arduino UNO) have wanted to learn multi-tasking using Arduino UNO (and NOT ESP32) so that they can develop small-scale industriall applicatioons like simultaneous/concurrent monitoring of fire-hazard area, security-zone area, and the regular task of opening/closing the entry door. I immediately refrerred them to this thread .
Why anyone would want to try using an RTOS on such a resource-limited platform still escapes me. Especially when an ESP32 can be had at a MUCH lower cost than an Uno.
I am aware that OP wants to exercise multi-tasking using ESP32 + FreeRTOS.
I have referred OP to the discussion/examples on multi-tasking using Arduino UNOR3 + Arduino_FreeRTOS in case he finds some interest.
Again, why? ESP32 is cheaper and more suited for the job.
Does that mean Arduino UNOR3 is unfit for multi-tasking and should be abondoned?
Turn the question around. Why would you choose to use an Uno when the ESP32 is better suited and cheaper?
The Uno has ONE advantage over an ESP - more I/O. In EVERY other respect, the ESP is vastly superior - it is MUCH faster, has MUCH more memory, is smaller, cheaper, and has a vastly superior "OS". And, with the WiFi capability, you can do SO much more with it. A web-based UI is a total no-brainer with any ESP, making whatever application you are doing more functional and accessible. Why anyone uses an Uno at this point is a complete mystery to me.
Bit banging on the Uno is easy. For example generating a frequency modulated square wave.
Bit banging on an RTOS is not because the time slicing system ruins you ability to do things at precise moments in time. To get around this problem involves using additional hardware and each bit of hardware has its own datasheet and learning curve making things substabtially more complicated.
That’s a specious argument. The Uno implementation will of course have timing jitter because of the interrupts from Timer 0 -- implements millis() --, UART, etc. Given the ESP32’s faster processor, you’d need to actually quantify the different … not just waive your hands like you did here.
But of course, that’s why microcontrollers have built in hardware for such tasks (no “extra” datasheets). Again, the ESP32 has a much richer set of such hardware.
To do really precise timing you need to be in a spin loop. That is not compatible with the RTOS concept because you would have to disable interrupts and therefore the RTOS isn't functioning.
There are so many Arduinos among which Arduino UNO R3 is the most popular. This UNO R3 supports multi-tasking with the help of Arduino_FreeRTOS.h Library is a good news to the beginners as it goes with AE's idea that wise people starts with the simple thing (UNO R3) and then gradually moves to the complex one (ESP32).
Nobody does "really precise" timing in a software loop. Also disabling interrupts for an extended period really impairs the usefulness of the processor.
People who know what they've doing use hardware timers.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.