Understanding Firmware and automation

AI Thread Summary
Firmware is essential for microcontrollers like Arduino and Raspberry Pi, allowing them to execute stored instructions automatically upon power-up. Users can program these devices to perform tasks, such as rotating a motor when a button is pressed, by writing code that includes control structures like "While" loops. Typically, the firmware resides in the microcontroller's flash memory, enabling it to run applications without needing to re-upload code each time. In contrast, Raspberry Pi operates more like a traditional computer, with a layered structure of firmware, operating system, and user applications. Understanding the relationship between firmware and automation is crucial for effectively utilizing these devices in projects.
Tone L
Messages
72
Reaction score
7
Preface: I've done some reading and have minimal experience with micro controllers and circuit boards. Though it is a simple question, the internet has puzzled me, likely with the jargon I don't fully understand!

You can have an Arduino board or Raspberry PI and send it a program to perform functions like lighting a LED in sequence or turning on a digital display. However, this requires the user to send the circuit board 'instructions' each time by compiling and executing some code, right?

So let's consider you want to perform the similar task above but without sending a program each time.
For example, I have an ICB and it is wired to a button. I power the board and then push the button. This then rotates maybe a small DC motor. Can this be accomplished by storing these instructions in the micro controller? Which I presume is a categorized under 'firmware'?

This is surely a beginners question! Hope others who are curious out there find this post useful.
Cheers.
 
Engineering news on Phys.org
Yes.
You have to train your brain to think like a computer program - one tiny step at a time..

Look into the "While..." instruction.
the thought process is "While (button not pushed) do nothing"
when somebody pushes the button the program goes on to the next step.

In old days of Basic i used "While inkey$ ≠ (a particular keyboard key)" .
"inkey$" tells the program to watch the keyboard for input.
That instruction made the program change what it was doing when i'd press that key.

Arduino language will have a similar instruction...
It's called a "Test and Branch" instruction"
and you'll have to figure out how to direct Mr Arduino's attention to that button.https://www.arduino.cc/reference/en/language/structure/control-structure/while/
 
Tone L said:
Can this be accomplished by storing these instructions in the micro controller? Which I presume is a categorized under 'firmware'?
Yes. There are special cases when you have to download the code every time you power up the board, but usually it is just stored in a local Flash memory and it will be started automatically after every RESET or power up (if you set it so).
 
  • Like
Likes Tone L
As pointed out- An arduino - you can download the code and test it. Install it in some physical application and provide a power supply, the program stay resident and will run.
 
  • Like
Likes Tone L
Oh, forgot to mention. Firmware is the software providing low level control of the hardware.

In a PC we use upper level programs that run above the operating system, that operates over the BIOS... the BOIS is the firmware that automatically loads and takes care of the very basic Input and Output, thus the BOIS name = Basic Input/Output System.

You do not have this in a uC - since they are typically a dedicated application device, many if not most systems the Firmware is actually stored on the uC, but additional memory can be added for larger programs ( applications). So typically in a uC the Firmware IS the Application software - this is how an Arduino is set up.

In a Pi this is different -- a Pi is more of a computer system, with Firmware(pre-installed) -> LINUX (typ user installed) -> Application(user written) as the standard config. ( But it is possible for a hobbyist to "hack" their way down to the Firmware level)

Still - once set up a Pi (or a PC if you set it up this way) can "go to work" doing programmed tasks as you describe on power up.

So the relationship of automation and firmware is not set in stone.
 
  • Like
Likes hagopbul and Tone L
jim hardy said:
In old days of Basic i used "While inkey$ ≠ (a particular keyboard key)" .
I just looked at my old Borland Trubo Basic (Basic compiler) reference book for the "While" statement. It had examples for using it in "Do Loops". e.g. "Do [While] ... Loop"
It also had the example of "Do [Until] ... Loop", but the book didn't show the "Until" statement. :oldconfused: Go figure.
 
  • Like
Likes hagopbul and jim hardy
Thread 'Weird near-field phenomenon I get in my EM simulation'
I recently made a basic simulation of wire antennas and I am not sure if the near field in my simulation is modeled correctly. One of the things that worry me is the fact that sometimes I see in my simulation "movements" in the near field that seems to be faster than the speed of wave propagation I defined (the speed of light in the simulation). Specifically I see "nodes" of low amplitude in the E field that are quickly "emitted" from the antenna and then slow down as they approach the far...
Hello dear reader, a brief introduction: Some 4 years ago someone started developing health related issues, apparently due to exposure to RF & ELF related frequencies and/or fields (Magnetic). This is currently becoming known as EHS. (Electromagnetic hypersensitivity is a claimed sensitivity to electromagnetic fields, to which adverse symptoms are attributed.) She experiences a deep burning sensation throughout her entire body, leaving her in pain and exhausted after a pulse has occurred...
Back
Top