Questions tagged [microcontroller]

A device which includes a central processing unit (CPU), memory, and (generally) an assortment of I/O peripherals (UART, ADC, DAC, general-purpose I/O, I2C, etc.) in a tightly-coupled standalone package.

Microcontrollers are software-controlled devices which provide a convenient way to perform complex tasks like data collection, reporting and control in a compact, tightly integrated package.

There are a few general differences between microcontrollers and microprocessors:

  • Microcontrollers generally use internal flash/ROM/RAM and lack external address and data buses. Microprocessors rely on external memory, and have limited internal memory (usually only cache).

  • Microcontrollers generally have a large variety of input/output peripherals built-in, like general-purpose I/O lines, analog-to-digital converters, dedicated UART hardware, etc. Microprocessors generally do not, since most of their I/O functionality is used for addressing external memory (or memory-mapped peripherals).

  • Microcontrollers are generally optimized for very low power consumption, and have computational trade-offs because of this (many have no floating-point capabilities, no pipelining, etc.). Modern microprocessors perform faster than microcontrollers, and require much higher power budgets.

Major manufacturers of microcontrollers include Microchip, Atmel (acquired by Microchip in 2016), NXP, Texas Instruments, Infineon, and Cypress Semiconductor (acquired by Infineon in 2020).

related tags:

10041 questions
45
votes
6 answers

Why does hardware division take much longer than multiplication?

Why does hardware division take so much longer than multiplication on a microcontroller? E.g., on a dsPIC, a division takes 19 cycles, while multiplication takes only one clock cycle. I went through some tutorials, including Division algorithm and…
Marko Gulin
  • 1,653
  • 4
  • 22
  • 34
44
votes
5 answers

Who receives the value returned by main()?

I know that in computers, value returned by the main() function is received by the operating system. But, what happens in the main() function of a microcontroller?
user18118
  • 571
  • 1
  • 5
  • 5
43
votes
6 answers

How to synchronize two microcontrollers to micro-second accuracy?

I need to synchronize two micro-controllers so that they can measure the speed of propagating waves. The time delay measurements need have microsecond accuracy (error less that 1/2 of a microsecond). I have two micro-controllers ( ATmega328 ) which…
Kevin
  • 529
  • 1
  • 4
  • 6
43
votes
5 answers

FPGA's vs Microcontrollers

I've worked on the Arduino family (specifically the Sanguino), built a few simple devices and a simple phototrope. I am thus pretty comfortable with microcontrollers - specifically Atmel's. I'm curious to know how do FPGA's differ from standard…
Sushrut J Mair
  • 738
  • 2
  • 8
  • 13
43
votes
3 answers

What resides in the different memory types of a microcontroller?

There are different memory segments to which various types of data are put into from C code after compilation. I.e: .text , .data , .bss , stack and heap. I just want to know where each of these segments would reside in a microcontroller memory.…
stenvar
  • 781
  • 2
  • 10
  • 17
42
votes
4 answers

What's the catch with FRAM?

After recently acquiring an MSP430 Launchpad I've been playing with various microcontroller projects. Unfortunately, the MSP430G2553 only has 512 bytes of RAM, so doing anything complex requires external storage. After looking at SPI and I2C SRAM…
David Given
  • 1,189
  • 1
  • 8
  • 19
42
votes
13 answers

Have microcontrollers replaced simpler ICs?

Is it still worthwhile to learn, for example, how to tune a 555 timer with resistors and capacitors, when you can write a timer program for a microcontroller in a human-readable programming language? Or, to put it another way, are there problems…
user955
  • 190
  • 2
  • 5
42
votes
4 answers

Reason of multiple GND and VCC on an IC

What is the reason that most of ICs (e.g. MCU) has multiple (A/D)GND and (A)VCC pins? If it is to increase performance of an IC, how does it help to performance? or is it easier for the IC designer to connect some pins externally? some footprint of…
Angs
  • 3,385
  • 9
  • 38
  • 57
41
votes
7 answers

How do I make sure my electronics design is good from manufacturing perspective?

I am a beginner in electronics design. I have some experience with fairly complex PCB design. I want to design a product that will hopefully sell a lot. How do I ensure that the design is inexpensive from manufacturing perspective? I mean not for a…
superczan
  • 511
  • 4
  • 5
41
votes
14 answers

How can I measure the RPM of a Frisbee?

I'd like to make a little device I can stick onto a Frisbee that could measure stats such as RPM/speed of the Frisbee when thrown. Would this be realistically possible? I was looking into near-field communication to transfer the data from the…
Barodapride
  • 511
  • 1
  • 4
  • 4
40
votes
8 answers

Why do microcontrollers have so little RAM?

Maybe this is more of a perceptional problem, but it seems like microcontrollers have advanced by leaps and bounds in the last 20 years, in almost all regards, higher clock speed, more peripherals, easier debugging, 32-bit cores, etc... It is still…
Grady Player
  • 1,025
  • 1
  • 14
  • 18
39
votes
10 answers

What are some smallest, cheapest microcontrollers with USB built in?

The cheaper, smaller, and fewer external components needed the better. AVR would be preferred, but anything with free SDKs is good.
tlrobinson
  • 559
  • 1
  • 4
  • 6
39
votes
2 answers

What is bit banging

I am new to microcontroller programming. I am using ATmega32-A controller and CodeVisionAVR compiler. I am using the waveform generator(AD9833) to generate a sinewave signal using SPI communication. I am able to generate the sinewave successfully.…
verendra
  • 1,273
  • 2
  • 15
  • 26
39
votes
8 answers

Why do Microcontrollers need a Clock

Why do instructions need to be processed at set time intervals (i.e. with the use of a clock)? Can't they be executed sequentially - immediately after the previous instruction has completed? An analogy for the necessity of clocks in microcontrollers…
M-R
  • 799
  • 1
  • 9
  • 22
39
votes
8 answers

In what situation should I keep the brown-out detection feature OFF on a microcontroller?

When the power supply on a microcontroller falls under a certain threshold, a brown-out conditions occurs and RAM may get corrupted. Provided that every power down sequence of the circuit can mean a potential brown-out condition, I always enable the…
m.Alin
  • 10,957
  • 20
  • 69
  • 90