Understanding Firmware and automation

Click For Summary

Discussion Overview

The discussion revolves around the concepts of firmware and automation in microcontrollers, particularly focusing on how instructions can be stored and executed without needing to re-upload code each time the device is powered on. Participants explore the relationship between firmware and the operation of devices like Arduino boards and Raspberry Pi.

Discussion Character

  • Exploratory
  • Technical explanation
  • Conceptual clarification

Main Points Raised

  • One participant questions whether it is possible to store instructions in a microcontroller to automate tasks without re-sending programs each time, suggesting this falls under the category of 'firmware'.
  • Another participant confirms that instructions can be stored in local Flash memory and executed automatically upon power-up or reset, although there are exceptions where code must be downloaded each time.
  • Discussion includes the distinction between firmware in microcontrollers and higher-level software in PCs, with one participant noting that in microcontrollers, firmware often serves as the application software.
  • Participants mention the use of control structures like "While" loops in programming to manage input from buttons, drawing parallels to older programming languages like Basic.
  • There is a mention of the differences in firmware architecture between Arduino and Raspberry Pi, with the latter being described as a more complex computer system with pre-installed firmware and user-installed applications.

Areas of Agreement / Disagreement

Participants generally agree on the ability to store instructions in microcontrollers and the role of firmware, but there are nuances regarding the differences between various systems (Arduino vs. Raspberry Pi) and the nature of firmware itself. The discussion remains somewhat unresolved regarding the specifics of firmware implementation and its relationship to automation.

Contextual Notes

Participants reference specific programming concepts and structures, but there is no consensus on the best practices for firmware implementation or the exact distinctions between different systems. Some assumptions about the nature of firmware and its application in various contexts are not fully explored.

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   Reactions: 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   Reactions: 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   Reactions: 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   Reactions: hagopbul and jim hardy

Similar threads

  • · Replies 8 ·
Replies
8
Views
3K
Replies
2
Views
1K
Replies
4
Views
3K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 12 ·
Replies
12
Views
3K
  • · Replies 6 ·
Replies
6
Views
4K
Replies
6
Views
4K
Replies
10
Views
4K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 2 ·
Replies
2
Views
9K