4 ms·
I'm always a little perplexed by the world of microcontrollers. How would you program this without having some kind of embedded linux? And where does the OS liv
by tetris11 2y ago
I'm always a little perplexed by the world of microcontrollers. How would you program this without having some kind of embedded linux? And where does the OS live in this modules? Or does this sit on a Pi?
- deleted 2y ago[deleted]
- markus_zhang 2y agoIn many cases there is no OS, just bare metal. I have dabbed into embedded programming (but never really into hardware) briefly and the process looks like this: you manipulate some pins and they make things work. You read manuals to figure out which pins to use and how to manipulate them to make certain things happen. For example, to make a peripheral work, you first need to connect certain pins (following the manual), then you need to send some black magic signals to these pins to make it work in certain ways (think ROM reading/writing, LCD screen display, etc.). Reading the manual and the data sheets, IMO, is where the real complexity comes from -- and you can always use "Standard" components and use a library. Here is a good textbook: https://web.eece.maine.edu/~zhu/book/ https://web.eece.maine.edu/~zhu/book/ If you need an OS sometimes a RTOS is considered instead of Linux. Embedded Linux is pretty "heavy" in the embedded world AFAIK.
- tetris11 2y agoIn the context of the camera modules above, what would you wire the pins into? Surely a Pi, running Linux?
- bigiain 2y agoYou kinda cheat. There's a bunch of dedicated hardware/firmware that you use to run the camera module. That lets a fairly simple microcontroller and code to mostly ignore the electrical details of the camera, and just abstract that away so you can just send commands to the camera via pre existing libraries, then deal with the data representing an image. Here's a reasonable overview: https://lastminuteengineers.com/getting-started-with-esp32-cam/ https://lastminuteengineers.com/getting-started-with-esp32-c...
- tetris11 2y agoOh wow, so that tiny chip can run a whole webserver with bluetooth and wifi, programmed purely using arduino. Pretty cool!
- bigiain 2y agoCraziest thing about it is, you can get one including the camera for under $10: https://www.aliexpress.com/item/1005006299363624.html https://www.aliexpress.com/item/1005006299363624.html
- bigiain 2y agoNo OS. There's just a setup() function and a main loop() that runs forever. It's really really fun, at least to my brain. If you want to see how it works without spending any money, TinkerCAD (https://tinkercad.com https://tinkercad.com) will let you layout, program, and simulate an Arduino. They're somewhat less powerful than the ESP32 CAM proposed to replace this, but it's a good way to "dip your feet" in programming and wiring up microcontrollers.