I am new to microcontrollers and am facing a problem regarding the understanding of the terms firmware, bootloader and the actual code of a microcontroller. In some places I have read that the firmware is there to communicate with other devices. But in some place I have read that the firmware is the code that runs on the microcontroller mainly the C code in case of Arduino. The bootloader is basically to initialize the counters etc. as far as I've read. Kindly tell me the difference in all of these in simple words as there is no clear explanation as far as I've seen.
Different groups use different terminology.
For starters, some groups will use "firmware" exclusively for FPGA bitstreams, and "software" for anything that runs on a processor -- or "firmware" will be for bitstreams and boot code, but not for anything on a thumb drive, etc. Just be prepared to have to figure things out from context, and if source "A" seems to disagree with source "B" it's probably because they are, actually, in disagreement.
If there's no FPGA in sight, then "firmware" and "bootloader" are both actual code of the microcontroller.
Note that some people get really hot about the precise definitions of these -- I've learned not to care, and just go with whatever the group I'm in uses.
- "Firmware" -- usually means the code a microcontroller runs if it's "little", i.e. if it's flashed on and not on something that looks like a disk.
- "Software" -- something that's on a disk, or source code for the firmware depending on who you ask.
- "Bootloader" -- firmware that boots the microprocessor, and manages downloading applications firmware onto flash. It may be build in to the chip, or you may have written it to support your own communications scheme.